summaryrefslogtreecommitdiff
path: root/.config/sxiv/exec/key-handler
diff options
context:
space:
mode:
authorVito Graffagnino <vito@graffagnino.xyz>2020-09-08 18:10:49 +0100
committerVito Graffagnino <vito@graffagnino.xyz>2020-09-08 18:10:49 +0100
commit3b0142cedcde39e4c2097ecd916a870a3ced5ec6 (patch)
tree2116c49a845dfc0945778f2aa3e2118d72be428b /.config/sxiv/exec/key-handler
parent8cc927e930d5b6aafe3e9862a61e81705479a1b4 (diff)
Added the relevent parts of the .config directory. Alss add ssh config
Diffstat (limited to '.config/sxiv/exec/key-handler')
-rwxr-xr-x.config/sxiv/exec/key-handler41
1 files changed, 41 insertions, 0 deletions
diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler
new file mode 100755
index 0000000..0dd23e8
--- /dev/null
+++ b/.config/sxiv/exec/key-handler
@@ -0,0 +1,41 @@
+#!/bin/sh
+while read file
+do
+ fullpath="$(pwd)/$file"
+ case "$1" in
+ "w")
+ mv ~/.config/wall.png{,.orig} &&
+ cp "$file" ~/.config/wall.png &&
+ wal -c; wal -s -i ~/.config/wall.png -o ~/.config/wal/postrun; xsetroot -name "fsignal:xrd";
+ #feh --bg-scale "$HOME/.config/wall.png" &&
+ xwallpaper --zoom "$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
+ mv "$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 -f "$file" &&
+ notify-send "$file deleted " & ;;
+
+ esac
+done
+