#!/bin/ksh ID=$(xdotool search --class scratchpad) if [ -e $ID ]; then sterm -c scratchpad & else bspc node "$ID" --flag hidden -f fi