19 lines
453 B
Plaintext
19 lines
453 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
SCRID=urxvt-scratch
|
||
|
focused=$(xdotool getactivewindow)
|
||
|
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
||
|
|
||
|
if [[ $scratch ]]; then
|
||
|
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
|