#!/bin/sh -x # set the following quirk in .config/spectrwm/spectrwm.conf # quirk[scratchpad] = FLOAT + ANYWHERE + FOCUSPREV WID=$(wmctrl -x -l scratchpad | fgrep '.scratchpad' | cut -d" " -f1) if [ -z "$WID" ] then st -c scratchpad -g 128x38+250+150 & else wmctrl -i -r $WID -b toggle,hidden if xwininfo -id 0x01800005 | fgrep -q IsViewable then wmctrl -i -R $WID fi fi