diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-07-05 04:35:09 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-07-05 04:35:09 +0300 |
commit | 36747fcd8d21f6cc3492097e1d38e144a14eafdc (patch) | |
tree | a350f48ca28156b6dea02223defaf66510eab378 | |
parent | 378cab2ec31574daae3f8332cf30924214b58c8f (diff) | |
download | swayrice-36747fcd8d21f6cc3492097e1d38e144a14eafdc.tar.gz swayrice-36747fcd8d21f6cc3492097e1d38e144a14eafdc.zip |
little sxiv script to remove raw and jpeg pictures
-rwxr-xr-x | dotfiles/.config/sxiv/exec/key-handler | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dotfiles/.config/sxiv/exec/key-handler b/dotfiles/.config/sxiv/exec/key-handler index b63fbd6..6e17c5a 100755 --- a/dotfiles/.config/sxiv/exec/key-handler +++ b/dotfiles/.config/sxiv/exec/key-handler @@ -17,5 +17,16 @@ while read file; do "C-f") wl-copy "$file" exit ;; + "C-r") + # Move file to 'trash' directory, if the current directory's name is + # JPEG, remove the NEF file as well + dir="$(dirname "$file")" + name="$(basename "$file")" + base="${name%.*}" + mv "$file" ~/etc/temp/trash/ + if [ "JPEG" = "$(basename $dir)" ]; then + mv $(dirname "$dir")/"$base".NEF ~/etc/temp/trash/ + fi + exit ;; esac done |