From 62360d0f1de820cb4bef2bf4eda29a5504a54896 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Sat, 30 Dec 2023 08:36:38 +0100 Subject: [PATCH] Update 2023-12-30 08:36 OpenBSD/amd64-x13 --- .bin/sp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.bin/sp b/.bin/sp index 76651cc..6c33c1f 100755 --- a/.bin/sp +++ b/.bin/sp @@ -23,15 +23,11 @@ WID=$(wmctrl -x -l scratchpad | fgrep '.scratchpad' | cut -d" " -f1) if [ -z "$WID" ] then # start terminal (sterm is st.suckless.org) - # XXX st is resized properly when hidden, st takes rows, - # columns as size input. We don't have that so that's just - # what echo $COLUMNS $LINES reports after the resize. - # So on the first start, the windows is "almost" correctly - # sized and we fix it later (when hidden). sterm -c scratchpad -g 134x29+$GAP+$GAP & # XXX we cannot resize with wmctrl here, because the window is not # mapped yet. Adding a sleep here and resize then is visually - # unpleasant. + # unpleasant. Therefore st is started with hardcoded dimensions + # and resized when hidden. else # check if window is iconified or on another WS (or both) if xwininfo -id $WID | fgrep -q IsUnMapped @@ -45,10 +41,12 @@ else # activate (give focus) wmctrl -i -a $WID else - wmctrl -i -r $WID -t 11 # window is visible => hide wmctrl -i -r $WID -b add,hidden # correct size while hidden wmctrl -i -r $WID -e 0,$GAP,$GAP,$H,$V + # move it beyond the WS limit to completely hide it from the bar + # XXX could also be skip_pager / skip_taskbar? + wmctrl -i -r $WID -t 11 fi fi