aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/sxiv/exec/key-handler
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-10-07 14:43:37 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-10-07 14:43:37 +0300
commit7ac60e4a99344d96239f2f4da63b6c9e190045f1 (patch)
tree3aa920bff8c0c18e79c420a630c5bd177b8d8cec /dotfiles/.config/sxiv/exec/key-handler
parent653da507074730db446bc54e8a1165c8f919d4bd (diff)
parent4213b8745e62801b9926c699edf7ad3ffd94f0b4 (diff)
downloadswayrice-7ac60e4a99344d96239f2f4da63b6c9e190045f1.tar.gz
swayrice-7ac60e4a99344d96239f2f4da63b6c9e190045f1.zip
Merge branch 'back-to-qute'
Diffstat (limited to 'dotfiles/.config/sxiv/exec/key-handler')
-rwxr-xr-xdotfiles/.config/sxiv/exec/key-handler76
1 files changed, 42 insertions, 34 deletions
diff --git a/dotfiles/.config/sxiv/exec/key-handler b/dotfiles/.config/sxiv/exec/key-handler
index 17abf60..f20a143 100755
--- a/dotfiles/.config/sxiv/exec/key-handler
+++ b/dotfiles/.config/sxiv/exec/key-handler
@@ -9,39 +9,47 @@ rotate() {
esac
}
+if [ "$1" = "t" ]; then
+ while read file; do
+ files="$(printf "%s\n%s" "$files" "$file")"
+ done
+ dragon-drag-and-drop -a $files
+ exit 0
+fi
+
while read file; do
- case "$1" in
- "C-a" | "C-1")
- setbg "$file"
- exit ;;
- "C-2")
- setbg "$file" "2"
- exit ;;
- "C-s")
- setbglblur "$file"
- exit ;;
- "C-d")
- setbglsimple "$file"
- exit ;;
- "C-c")
- wl-copy < "$file"
- exit ;;
- "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" ~/.local/trash/
- if [ "JPEG" = "$(basename $dir)" ]; then
- mv $(dirname "$dir")/"$base".NEF ~/.local/trash/
- fi
- exit ;;
- "C-comma") rotate 270 $file ;;
- "C-period") rotate 90 $file ;;
- "C-slash") rotate 180 $file ;;
- esac
+ case "$1" in
+ "C-a" | "C-1")
+ setbg "$file"
+ exit ;;
+ "C-2")
+ setbg "$file" "2"
+ exit ;;
+ "C-s")
+ setbglblur "$file"
+ exit ;;
+ "C-d")
+ setbglsimple "$file"
+ exit ;;
+ "C-c")
+ wl-copy < "$file"
+ exit ;;
+ "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" ~/.local/trash/
+ if [ "JPEG" = "$(basename $dir)" ]; then
+ mv $(dirname "$dir")/"$base".NEF ~/.local/trash/
+ fi
+ exit ;;
+ "C-comma") rotate 270 $file ;;
+ "C-period") rotate 90 $file ;;
+ "C-slash") rotate 180 $file ;;
+ esac
done