From 36747fcd8d21f6cc3492097e1d38e144a14eafdc Mon Sep 17 00:00:00 2001
From: Yaroslav <contact@yaroslavps.com>
Date: Sun, 5 Jul 2020 04:35:09 +0300
Subject: little sxiv script to remove raw and jpeg pictures

---
 dotfiles/.config/sxiv/exec/key-handler | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'dotfiles')

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
-- 
cgit v1.2.3