herbstluftwm-scratch (775B)
1 #!/bin/sh 2 scratchpad=/tmp/herbstluftwm:scratchpad 3 if xdotool search --onlyvisible --classname 'scratchpad' >/dev/null ; then 4 if [[ $(herbstclient list_monitors | grep '[FOCUS]' | cut -d'"' -f2) = $(herbstclient attr clients.$(cat $scratchpad) | grep 's - - tag' | awk '{ print $6 }' | tr -d '"') ]]; then 5 xdotool search --onlyvisible --classname 'scratchpad' windowunmap 6 exit 7 fi 8 fi 9 10 if [[ -f $scratchpad ]]; then 11 if ! herbstclient bring $(cat $scratchpad); then 12 xdotool search --classname 'scratchpad' windowmap && exit 13 fi 14 fi 15 16 if ! xdotool search --classname 'scratchpad' windowmap; then 17 urxvt -title 'scratchpad' -name 'scratchpad' -pe tabbed & 18 xdotool search --sync --onlyvisible --classname 'scratchpad' 19 herbstclient attr clients.focus.winid > $scratchpad 20 fi