From dbdfd4328082beb45479cd3522e56fc72e762528 Mon Sep 17 00:00:00 2001 From: Raoul Branten Date: Fri, 5 Sep 2025 13:44:57 +0200 Subject: [PATCH] Add margin from bottom --- windowmanagement.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/windowmanagement.sh b/windowmanagement.sh index 402e06b..cb6015a 100755 --- a/windowmanagement.sh +++ b/windowmanagement.sh @@ -32,7 +32,8 @@ fi get_usable_height() { local screen_height=$(xdpyinfo | awk '/dimensions/{print $2}' | grep -oE [[:digit:]]\+$) local panel_height=$(xdotool getwindowgeometry $(xdotool search --onlyvisible --class 'panel') | awk '/Geometry/{print $2}' | grep -oE [[:digit:]]\+$) - echo $((screen_height - panel_height)) + local margin=26 # For window decoration subtract margin + echo $((screen_height - panel_height - margin)) } # extract and set argument @@ -95,10 +96,10 @@ esac currentWindow=$(xdotool getactivewindow) # undo maximized -wmctrl -ir $currentWindow -b remove,maximized_vert,maximized_horz +wmctrl -ir "$currentWindow" -b remove,maximized_vert,maximized_horz -# resize window use 95% of height -xdotool getactivewindow windowsize $WIDTH $(get_usable_height) +# resize +xdotool getactivewindow windowsize $WIDTH "$(get_usable_height)" # move window to location steer clear of top xdotool getactivewindow windowmove $XPOS 0.1