nsxiv2fb8a8d
Remove tagging from key-handler
+1 −24
1 file changed
- M exec/key-handler +1 −24
| @@ -12,10 +12,6 @@ | |||
| 12 | 12 | # where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X | |
| 13 | 13 | # keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix. | |
| 14 | 14 | ||
| 15 | − | readonly KEY="$1"; | |
| 16 | − | readonly TAGFILE="$HOME/.config/sxiv/tags" | |
| 17 | − | readonly TMPFILE="/tmp/sxiv.$$" | |
| 18 | − | ||
| 19 | 15 | rotate() { | |
| 20 | 16 | degree="$1" | |
| 21 | 17 | tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read file; do | |
| @@ -26,24 +22,7 @@ rotate() { | |||
| 26 | 22 | done | |
| 27 | 23 | } | |
| 28 | 24 | ||
| 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 | |
| 47 | 26 | "y") tr '\n' ' ' | xclip -i ;; | |
| 48 | 27 | "C-c") while read file; do xclip -selection clipboard -target image/png "$file"; done ;; | |
| 49 | 28 | "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 | |||
| 51 | 30 | "C-comma") rotate 270 ;; | |
| 52 | 31 | "C-period") rotate 90 ;; | |
| 53 | 32 | "C-slash") rotate 180 ;; | |
| 54 | − | "C-t") tag_add ;; | |
| 55 | − | "M-T") tag_del ;; | |
| 56 | 33 | esac | |
| 57 | 34 | ||