summaryrefslogtreecommitdiffstats
path: root/.config/sxiv
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-01-03 14:03:09 -0500
committerLuke Smith <luke@lukesmith.xyz>2019-01-03 14:03:09 -0500
commitdfaa31fe5cbcc89216c56efe40c6ef48ae1359ad (patch)
tree4d64cfa1c732b7328e3986e7acc6a96ca61afa46 /.config/sxiv
parentebdff2ce6aafc95e51986447b1add7389f7a3a3a (diff)
downloadeibhear-dfaa31fe5cbcc89216c56efe40c6ef48ae1359ad.tar.gz
eibhear-dfaa31fe5cbcc89216c56efe40c6ef48ae1359ad.tar.zst
eibhear-dfaa31fe5cbcc89216c56efe40c6ef48ae1359ad.zip
sxiv key handler added
Diffstat (limited to '.config/sxiv')
-rwxr-xr-x.config/sxiv/exec/key-handler37
1 files changed, 37 insertions, 0 deletions
diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler
new file mode 100755
index 0000000..e0303f9
--- /dev/null
+++ b/.config/sxiv/exec/key-handler
@@ -0,0 +1,37 @@
+#!/bin/sh
+while read file
+do
+ fullpath="$(pwd)/$file"
+ case "$1" in
+ "w")
+ cp "$file" ~/.config/wall.png &&
+ feh --bg-scale "$HOME/.config/wall.png"
+ notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." ;;
+ "c")
+ [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
+ [ -z "$destdir" ] && exit
+ cp "$file" "$destdir" && notify-send -i "$fullpath" "$file copied to $destdir." &
+ ;;
+ "m")
+ [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
+ [ -z "$destdir" ] && exit
+ cp "$file" "$destdir" && notify-send -i "$fullpath" "$file moved to $destdir." &
+ ;;
+ "r")
+ convert -rotate 90 "$file" "$file" ;;
+ "R")
+ convert -rotate -90 "$file" "$file" ;;
+ "f")
+ convert -flop "$file" "$file" ;;
+ "y")
+ echo -n "$file" | xclip -selection clipboard &&
+ notify-send "$file copied to clipboard" & ;;
+ "Y")
+ echo -n "$fullpath" | xclip -selection clipboard &&
+ notify-send "$fullpath copied to clipboard" & ;;
+ "d")
+ [ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
+ "G")
+ gimp "$file" & ;;
+ esac
+done