(nsxiv): make key handler more concise and update reference to wallpaper set script

This commit is contained in:
frosty 2024-07-29 04:19:39 -04:00
parent b38f76eda1
commit adfb149084

View file

@ -1,28 +1,16 @@
#!/bin/sh #!/bin/sh
copy() { while IFS= read -r file; do
file="$1" case "$1" in
w)
file_ext="${file##*.}" wallpaper-set "$file"
case "$file_ext" in ;;
"png") e)
copy_path="$file" setsid -f gimp "$file"
;; ;;
*) y)
file_name="${file##*/}" xclip -sel clip -t image/png "$file"
file_base="${file_base%%.*}" notify-send "nsxiv" "Copied <b>${file##*/}</b> to the clipboard."
copy_path="/tmp/copy_$file_base.png" ;;
;; esac
esac
xclip -sel clip -t image/png "$file"
notify-send "nsxiv" "Copied <b>$copy_path</b> to the clipboard."
}
while read -r file; do
case "$1" in
w) wallpaper "$file" ;;
e) gimp "$file" ;;
y) copy "$file" ;;
esac
done done