Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-01-18 17:30:52

michja
Member
Registered: 2017-10-31
Posts: 9

Find usable desktop area

Hey,

I'm trying to do some manual window positioning. I've found the workspace margins in xfconf-query -c xfwm4 -p /general/margin_*
But this doesn't account for panels. Is there some way to get an absolute usable desktop area?

Cheers,
Michael

Offline

#2 2019-01-18 18:20:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,998

Re: Find usable desktop area

Actually, xfdesktop tracks this for it's icon placement. You can find the usable desktop space in ~/.config/xfce4/desktop. Locate the latest .rc file and the usable geometry will be in the filename:

$ ls -lt | sed -n '2p' 
-rw-r--r-- 1 toz toz  201 Jan 16 07:07 icons.screen0-1366x745.rc

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-01-18 20:25:02

michja
Member
Registered: 2017-10-31
Posts: 9

Re: Find usable desktop area

Awesome. Thanks ToZ!

In case anyone else winds up here the full line is now:

$ ls -t $HOME/.config/xfce4/desktop | head -n 1 | cut -d "-" -f 2 | cut -d "." -f 1 
1350x725

Last edited by michja (2019-01-18 20:25:48)

Offline

#4 2019-01-18 20:40:12

michja
Member
Registered: 2017-10-31
Posts: 9

Re: Find usable desktop area

Looks like I spoke too soon. That number isn't right. I'm missing 16px from the margins somewhere. Any ideas?

$ls -t $HOME/.config/xfce4/desktop | head -n 1 | cut -d "-" -f 2 | cut -d "." -f 1
1350x725

$ xdpyinfo | awk '/dimensions/{print $2}' | cut -d "x" -f1
1366

$ xfconf-query -c xfwm4 -p /general/margin_left
16

$ xfconf-query -c xfwm4 -p /general/margin_right
16

Offline

#5 2019-01-18 21:17:28

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,998

Re: Find usable desktop area

Looks like it doesn't take into account the margins. Maybe you could use both pieces of information to get the "real" available space?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2019-01-18 21:49:03

michja
Member
Registered: 2017-10-31
Posts: 9

Re: Find usable desktop area

The problem is reliably knowing where the usable area begins and ends if it could be defined by a margin or a panel height at the top or bottom of the screen. But if there isn't an easy place to check then I don't need to know that badly.
I can set the margins to overlap my panels exactly, Use those values & provide override parameters. And probably never have to worry about it again smile

Offline

#7 2019-01-19 05:28:31

Misko_2083
Member
Registered: 2015-10-13
Posts: 191
Website

Re: Find usable desktop area

The window manager calculates this space by taking the current page minus space occupied by dock and panel windows.
You can find it in root window's property _NET_WORKAREA.

xprop -root _NET_WORKAREA

The output is printed like this x, y, width, height
where x, y is the top left corner.
If you have several workspaces those will be in the output as well.
https://specifications.freedesktop.org/ … ETWORKAREA

For reserved space for panels check _NET_WM_STRUT or _NET_WM_STRUT_PARTIAL properties of the panel windows.
https://specifications.freedesktop.org/ … NETWMSTRUT


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#8 2019-01-23 16:11:05

michja
Member
Registered: 2017-10-31
Posts: 9

Re: Find usable desktop area

Cheers Misko.

The combination of STRUT_PARTIAL and xfconf general/margin is perfect. Between them that's all the info needed smile

Offline

Board footer

Powered by FluxBB