Krolyxon
Commit 2fb8a8d

Branches

Refs →

nsxiv2fb8a8d

Remove tagging from key-handler

Author
Bert Münnich
Date
2018-12-31 15:16 +0100
Parent
6a662ae
Commit
2fb8a8d5fe93939f42f582fa4d41e38e5bcb7aa9

+1 −24

1 file changed

  1. M exec/key-handler +1 −24
M exec/key-handler View
@@ -12,10 +12,6 @@
1212 # where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
1313 # keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
1414
15−readonly KEY="$1";
16−readonly TAGFILE="$HOME/.config/sxiv/tags"
17−readonly TMPFILE="/tmp/sxiv.$$"
18−
1915 rotate() {
2016 degree="$1"
2117 tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read file; do
@@ -26,24 +22,7 @@ rotate() {
2622 done
2723 }
2824
29−tag_add() {
30− >>"$TAGFILE"
31− tags=$(dmenu <"$TAGFILE" | tr '\n' ',')
32− [ -z "$tags" ] && return
33− iptckwed -i -a "$tags"
34− echo -n "$tags" | tr ',' '\n' | sort - "$TAGFILE" | uniq >"$TAGFILE.new"
35− mv -f "$TAGFILE"{.new,}
36−}
37−
38−tag_del() {
39− cat >"$TMPFILE"
40− tags=$(iptckwed -iql <"$TMPFILE" | cut -f 2 | tr ',' '\n' | sort | uniq | dmenu | tr '\n' ',')
41− [ -z "$tags" ] && return
42− iptckwed -i -r "$tags" <"$TMPFILE"
43− rm -f "$TMPFILE"
44−}
45−
46−case "$KEY" in
25+case "$1" in
4726 "y") tr '\n' ' ' | xclip -i ;;
4827 "C-c") while read file; do xclip -selection clipboard -target image/png "$file"; done ;;
4928 "C-e") while read file; do urxvt -bg "#444" -fg "#eee" -sl 0 -title "$file" -e sh -c "exiv2 pr -q -pa '$file' | less" & done ;;
@@ -51,7 +30,5 @@ case "$KEY" in
5130 "C-comma") rotate 270 ;;
5231 "C-period") rotate 90 ;;
5332 "C-slash") rotate 180 ;;
54−"C-t") tag_add ;;
55−"M-T") tag_del ;;
5633 esac
5734