2017-12-05 22:39:10 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
SCRID=urxvt-scratch
|
|
|
|
focused=$(xdotool getactivewindow)
|
|
|
|
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
|
|
|
|
2017-12-31 22:33:49 -08:00
|
|
|
if [[ -n $scratch ]]; then
|
2017-12-05 22:39:10 -08:00
|
|
|
if [[ $focused == $scratch ]]; then
|
|
|
|
tmux kill-session -t scratch
|
|
|
|
else
|
|
|
|
xdotool windowactivate $scratch
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
bspc monitor -f primary
|
|
|
|
urxvt -name $SCRID \
|
|
|
|
-geometry 100x26 \
|
|
|
|
-e bash \
|
|
|
|
-c 'tmux new-session -A -s scratch -n scratch'
|
|
|
|
fi
|