aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/sxiv/exec
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-07-05 04:35:09 +0300
committerYaroslav <contact@yaroslavps.com>2020-07-05 04:35:09 +0300
commit36747fcd8d21f6cc3492097e1d38e144a14eafdc (patch)
treea350f48ca28156b6dea02223defaf66510eab378 /dotfiles/.config/sxiv/exec
parent378cab2ec31574daae3f8332cf30924214b58c8f (diff)
downloadswayrice-36747fcd8d21f6cc3492097e1d38e144a14eafdc.tar.gz
swayrice-36747fcd8d21f6cc3492097e1d38e144a14eafdc.zip
little sxiv script to remove raw and jpeg pictures
Diffstat (limited to 'dotfiles/.config/sxiv/exec')
-rwxr-xr-xdotfiles/.config/sxiv/exec/key-handler11
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