X11. How to find out the full size of the window (with the size of its scenery)

I would like to get the full size of any windows in X11 to automatically resize it.

So far I have used wmctrl, but the size seems to be incomplete. eg

>$ wmctrl -lG 0x00e0000f -1 0 0 1920 1200 tclogin1 KDE Desktop 0x010000ee -1 0 1160 1920 40 tclogin1 kicker 0x01200008 0 4 28 1920 1127 tclogin1 ...p7zip_9.13/bin - Shell No. 8 - Konsole 

Kicker's height is 40 and the screen resolution is 1920x1200, so if I wanted to resize my Konsole to display the entire screen, but its size should be 1920x1160 (1200-40).

But when I do this, Konsole overrides the kicker size. Therefore, I assume that this means that window decorations cannot be taken into account here.

How do I know the size of the decor that I will need to add to the window size specified by wmctrl?

thanks

+4
source share
1 answer
 $ cat allborders.sh # assumptions: # windows ids are at least 5 digits long # we dont need to bother with windows that have no name # "first argument" from the pipe is east (could be west) # WINDOW_IDS=`xwininfo -int -root -tree |\ grep '[0-9]*\ (has no name)' -v |\ grep -Eo '[0-9]{5,}'` for win in $WINDOW_IDS; do xprop -id $win |\ grep -Ee '^(_NET_FRAME_EXTENTS|WM_CLASS)' |\ sed 's/.*=\ //' |\ sed -e :a -e '/$/N;s/\n/ /;ta' |\ grep ^[0-9] |\ while read line; do set -- $line E=`echo $1|sed 's/,$//'` W=`echo $2|sed 's/,$//'` N=`echo $3|sed 's/,$//'` S=`echo $4|sed 's/,$//'` NAME=`echo $5|sed 's/,$//'` CLASS=`echo $6|sed 's/,$//'` echo -e "$CLASS $NAME $N $E $S $W" done done $ ./allborders.sh "URxvt" "urxvt" 1 1 1 1 "XTerm" "aterm" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "Firefox" "Navigator" 18 1 3 1 "Gmpc" "gmpc" 18 1 3 1 "XTerm" "aterm" 0 0 0 0 "XTerm" "one" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "XTerm" "one" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "XTerm" "aterm" 0 0 0 0 "FbPager" "fbpager" 0 0 0 0 
+3
source

All Articles