mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 11:47:09 -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
|
#!/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
|
||||||
|
|
Loading…
Reference in a new issue