aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/nsxiv/exec/key-handler
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.config/nsxiv/exec/key-handler')
-rwxr-xr-xdotfiles/.config/nsxiv/exec/key-handler28
1 files changed, 16 insertions, 12 deletions
diff --git a/dotfiles/.config/nsxiv/exec/key-handler b/dotfiles/.config/nsxiv/exec/key-handler
index f20a143..36e39ab 100755
--- a/dotfiles/.config/nsxiv/exec/key-handler
+++ b/dotfiles/.config/nsxiv/exec/key-handler
@@ -9,13 +9,28 @@ rotate() {
esac
}
-if [ "$1" = "t" ]; then
+action="$1"
+
+if [ "$1" = "C-t" ]; then
while read file; do
files="$(printf "%s\n%s" "$files" "$file")"
done
dragon-drag-and-drop -a $files
exit 0
fi
+if [ "$1" = "C-r" ]; then
+ while read file; do
+ # 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
+ done
+fi
while read file; do
case "$1" in
@@ -37,17 +52,6 @@ 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" ~/.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 ;;