summaryrefslogtreecommitdiffstats
path: root/.config/sxiv/exec/key-handler
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-03-25 17:10:41 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-03-25 17:10:41 +0530
commit6b5d60fc05f814bbc5bd7132a17c726d3a029a39 (patch)
tree80d9ba03231d0dd29c9432fe027c08ae4a77d13f /.config/sxiv/exec/key-handler
parent9e3f962b952b71471c601a02831d3ccca0efaf44 (diff)
downloaddotfiles-6b5d60fc05f814bbc5bd7132a17c726d3a029a39.tar.gz
dotfiles-6b5d60fc05f814bbc5bd7132a17c726d3a029a39.tar.bz2
dotfiles-6b5d60fc05f814bbc5bd7132a17c726d3a029a39.zip
removed symbolic link
Diffstat (limited to '.config/sxiv/exec/key-handler')
-rwxr-xr-x.config/sxiv/exec/key-handler33
1 files changed, 33 insertions, 0 deletions
diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler
new file mode 100755
index 0000000..def7871
--- /dev/null
+++ b/.config/sxiv/exec/key-handler
@@ -0,0 +1,33 @@
+#!/bin/sh
+while read -r file
+do
+ case "$1" in
+ "w") set_wallpaper "$file" & ;;
+ "c")
+ [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
+ [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
+ cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
+ ;;
+ "m")
+ [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
+ [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
+ mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
+ ;;
+ "r")
+ convert -rotate 90 "$file" "$file" ;;
+ "R")
+ convert -rotate -90 "$file" "$file" ;;
+ "f")
+ convert -flop "$file" "$file" ;;
+ "y")
+ printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
+ notify-send "$file copied to clipboard" & ;;
+ "Y")
+ readlink -f "$file" | tr -d '\n' | xclip -selection clipboard &&
+ notify-send "$(readlink -f "$file") copied to clipboard" & ;;
+ "d")
+ [ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
+ "g") ifinstalled gimp && setsid -f gimp "$file" ;;
+ "i") notify-send "File information" "$(mediainfo "$file")" ;;
+ esac
+done