2023-11-28 21:33:15 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# set the following quirk in .config/spectrwm/spectrwm.conf
|
|
|
|
# quirk[XConsole] = FLOAT + ANYWHERE
|
|
|
|
|
|
|
|
# get XConsole window id
|
|
|
|
WID=$(wmctrl -x -l XConsole | fgrep '.XConsole' | cut -d" " -f1)
|
|
|
|
|
|
|
|
if [ -z "$WID" ]
|
|
|
|
then
|
|
|
|
xconsole &
|
|
|
|
else
|
|
|
|
# check if window is iconfified or on another WS (or both)
|
|
|
|
if xwininfo -id $WID | fgrep -q IsUnMapped
|
|
|
|
then
|
|
|
|
# move window to current workspace
|
|
|
|
#wmctrl -i -r $WID -t $(xprop -root _NET_CURRENT_DESKTOP | cut -d'=' -f2)
|
|
|
|
wmctrl -i -r $WID -t $_SWM_WS
|
|
|
|
# remove hidden flag
|
|
|
|
wmctrl -i -r $WID -b remove,hidden
|
|
|
|
else
|
2023-12-30 08:31:01 +01:00
|
|
|
wmctrl -i -r $WID -t 11
|
2023-11-28 21:33:15 +01:00
|
|
|
# window is visible => hide
|
|
|
|
wmctrl -i -r $WID -b add,hidden
|
|
|
|
fi
|
|
|
|
fi
|