diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/desktop-audio-record | 20 | ||||
| -rwxr-xr-x | bin/hotkey-legend | 38 | ||||
| -rwxr-xr-x | bin/ocr | 7 | ||||
| -rwxr-xr-x | bin/srtrename | 42 |
4 files changed, 107 insertions, 0 deletions
diff --git a/bin/desktop-audio-record b/bin/desktop-audio-record new file mode 100755 index 0000000..2e8bc74 --- /dev/null +++ b/bin/desktop-audio-record @@ -0,0 +1,20 @@ +#!/bin/bash + +rm /tmp/desktop_audio_temp.mp3 + +cleanup() { + echo "Recording stopped. Cleaning up..." + kill $FFMPEG_PID + echo "file:///tmp/desktop_audio_temp.mp3" | xclip -sel c + gxmessage -geometry 350x50 -title "audio recorded" -center "desktop dudio has been copied to your clipboard." + exit 0 +} + +trap cleanup SIGINT SIGTERM + +ffmpeg -f pulse -i alsa_output.usb-FX-AUDIO-_DAC-X3PRO_20313330544D4319001C8004-00.analog-stereo.monitor /tmp/desktop_audio_temp.mp3 & + +FFMPEG_PID=$! +xev | grep -q "keycode: 9" && cleanup + +wait $FFMPEG_PID diff --git a/bin/hotkey-legend b/bin/hotkey-legend new file mode 100755 index 0000000..6660ebf --- /dev/null +++ b/bin/hotkey-legend @@ -0,0 +1,38 @@ +#!/bin/sh + +gxmessage -center "help: +================================================================ +window controls: +win+w/a/s/d - move window left/right/top/bottom +win+q/e/z/c - move window to corner +win+shift+w/a/s/d/q/e/z/c - move to window in direction + +win+shift+r - resize window +win+shift+x - move window +win+ctrl+q - close window + +alt+left click - move window +alt+right click - move/resize window + +win+x - maximize window +win+ctrl+t - tile windows +win+ctrl+r - untile windows +win+1 - toggle tile mode +win+2/3 - resize tile master/slave + +win+1 - make current window tiled master +win+2/3 - resize tile master/slave + +win+shift+1 - toggle tile mode +win+ctrl+2/3 - change tiled master window count +win+shift+2/3 - change tiled slave window count +win+alt+w/s - move tiled window to prev/next position +win+alt+a/d - move tiled window to prev/next screen + +launchers: +win - xfce4-popup-whiskermenu +win+r - xfce4-appfinder +win+t - xfce4-terminal +win+ctrl+s - screenshot (scrot + xclip) +win+ctrl+e - ocr +" @@ -0,0 +1,7 @@ +#!/bin/bash +READ=$(scrot -s 'temp_%Y%m%d_%H%M%S.png' -e 'tesseract $f stdout -l jpn && rm $f') + +if [[ ! -z $READ ]]; then + echo $READ | xclip -selection clipboard +fi + diff --git a/bin/srtrename b/bin/srtrename new file mode 100755 index 0000000..33166e8 --- /dev/null +++ b/bin/srtrename @@ -0,0 +1,42 @@ +#!/bin/bash + +# Enable debug output +set -x + +# Loop through all subtitle files +for srt in *.srt; do + # Skip if no .srt files found + [[ -f "$srt" ]] || { echo "No .srt files found"; exit 1; } + + echo "Processing subtitle file: $srt" + + # Extract the episode number (S01E04) - more specific pattern + episode=$(echo "$srt" | grep -o "S[0-9]\{2\}E[0-9]\{2\}") + echo "Extracted episode number: $episode" + + # Find the corresponding video file + video_file=$(find . -maxdepth 1 -type f -name "*${episode}*.mkv") + echo "Found video file: $video_file" + + # If a matching video file is found + if [[ -n "$video_file" ]]; then + # Remove the .mkv extension and leading ./ + video_basename=$(basename "$video_file" .mkv) + # Create new subtitle name + new_name="${video_basename}.srt" + + echo "Will rename '$srt' to '$new_name'" + + # Only rename if the new name is different + if [[ "$srt" != "$new_name" ]]; then + mv -v "$srt" "$new_name" + else + echo "File already has the correct name" + fi + else + echo "No matching video file found for '$srt'" + # List all mkv files for debugging + echo "Available mkv files:" + ls -l *.mkv + fi +done |
