mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 03:37:10 -04:00
(nsxiv): make key handler more concise and update reference to wallpaper set script
This commit is contained in:
parent
b38f76eda1
commit
adfb149084
|
@ -1,28 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
copy() {
|
||||
file="$1"
|
||||
|
||||
file_ext="${file##*.}"
|
||||
case "$file_ext" in
|
||||
"png")
|
||||
copy_path="$file"
|
||||
;;
|
||||
*)
|
||||
file_name="${file##*/}"
|
||||
file_base="${file_base%%.*}"
|
||||
copy_path="/tmp/copy_$file_base.png"
|
||||
;;
|
||||
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
|
||||
while IFS= read -r file; do
|
||||
case "$1" in
|
||||
w)
|
||||
wallpaper-set "$file"
|
||||
;;
|
||||
e)
|
||||
setsid -f gimp "$file"
|
||||
;;
|
||||
y)
|
||||
xclip -sel clip -t image/png "$file"
|
||||
notify-send "nsxiv" "Copied <b>${file##*/}</b> to the clipboard."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue