diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-01-14 01:31:08 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-01-14 01:31:08 +0300 |
commit | 3bcbfcaa68fd6968f92659c397580e81efd0a8f7 (patch) | |
tree | a63c1cc3d04c2c2eed960b1bf9f68caa067c4e20 /dotfiles | |
parent | 66ebc9c033ebd1c0cb0f83e5b962884446198587 (diff) | |
download | swayrice-3bcbfcaa68fd6968f92659c397580e81efd0a8f7.tar.gz swayrice-3bcbfcaa68fd6968f92659c397580e81efd0a8f7.zip |
nsxiv handle delete on multiple images
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/.config/mimeapps.list | 1 | ||||
-rwxr-xr-x | dotfiles/.config/nsxiv/exec/key-handler | 28 |
2 files changed, 17 insertions, 12 deletions
diff --git a/dotfiles/.config/mimeapps.list b/dotfiles/.config/mimeapps.list index 622cc74..b280cc2 100644 --- a/dotfiles/.config/mimeapps.list +++ b/dotfiles/.config/mimeapps.list @@ -8,6 +8,7 @@ audio/mpeg=mpv.desktop; audio/x-xm=mpv.desktop; audio/x-mod=mpv.desktop; audio/x-it=mpv.desktop; +application/x-object=mpv.desktop; image/gif=nsxiv.desktop; image/jpeg=nsxiv.desktop; image/png=nsxiv.desktop; 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 ;; |