dotfiles/.bin/OLD/sp2
2024-02-14 07:55:58 +01:00

19 lines
448 B
Plaintext
Executable File

#/bin/sh
windowname="scratchpad-$1"
desk=`wmctrl -d | grep '*' | cut -d ' ' -f '1'`
scratch_desk=`wmctrl -l | grep $windowname | cut -d ' ' -f '3'`
xprop -name "$windowname"
if [ $? -eq 0 ]; then
if [ $desk -eq $scratch_desk ]; then
wmctrl -r $windowname -t $desk
wmctrl -r $windowname -b toggle,hidden
else
wmctrl -R $windowname
wmctrl -r $windowname -b remove,hidden
fi
else
st -c $windowname
fi