diff options
author | Thorsten Wißmann <edu@thorsten-wissmann.de> | 2012-09-14 17:26:11 +0200 |
---|---|---|
committer | Thorsten Wißmann <edu@thorsten-wissmann.de> | 2012-09-14 17:26:11 +0200 |
commit | 97702235d28fec5138f01e068b02c4cd87b67cbc (patch) | |
tree | d13f3f0c40685ddab91e83293a15a15c45c4b142 /scripts | |
parent | 0415f55170f29276d01eadbce6ec38ac490d523c (diff) |
Add scripts/lasttag.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/lasttag.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/lasttag.sh b/scripts/lasttag.sh new file mode 100755 index 00000000..98c68792 --- /dev/null +++ b/scripts/lasttag.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# usage: start this script in anywhere your autostart (but *after* the +# emit_hook reload line) + +# to switch to the last tag, call: herbstclient emit_hook goto_last_tag +# or bind it: herbstclient keybind Mod1-Escape emit_hook goto_last_tag + +herbstclient --idle '(tag_changed|goto_last_tag|reload)' \ + | while read line ; do + ARGS=( $line ) + case ${ARGS[0]} in + tag_changed) + LASTTAG="$TAG" + TAG=${ARGS[1]} + ;; + goto_last_tag) + ! [ -z "$LASTTAG" ] && herbstclient use "$LASTTAG" + ;; + reload) + exit + ;; + esac + done + + + |