Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-04-16 13:00:47

vladimir_goosini
Member
Registered: 2025-04-16
Posts: 3
UbuntuFirefox 111.0

re-querying display.xml

I need to collect information from monitors. I found displays.xml where information about them is stored, but there are devices where the information is not updated for some reason (the old one is stored). Only opening xfce4-display-settings helps, only after that the file is overwritten, but then displayed in the GUI, which is very bad. How is it possible to resample with a command?

Offline

#2 2025-04-16 14:51:42

Tamaranch
Member
From: France
Registered: 2020-12-31
Posts: 389
Website
LinuxFirefox 137.0

Re: re-querying display.xml

xfconf-query -c displays -lv

Offline

#3 2025-04-16 15:05:37

vladimir_goosini
Member
Registered: 2025-04-16
Posts: 3
iPhoneSafari 18.3

Re: re-querying display.xml

Tamaranch wrote:
xfconf-query -c displays -lv

I don't need to display information, I can look at the path .config/xfce4/xfconf/../displays.xml. I need to update display.xml without the graphical interface, because it is not updated after reboot

Offline

#4 2025-04-16 15:45:37

Tamaranch
Member
From: France
Registered: 2020-12-31
Posts: 389
Website
LinuxFirefox 137.0

Re: re-querying display.xml

Not sure what you mean, but anyway:
* xml files aren't necessarily up to date, as it's possible that xfconfd has cached information that it hasn't yet written (hence the use of xfconf-query instead of reading xml files directly);
* xfconfd is likely to overwrite the contents of these files at any time (especially when it exits following a SIGTERM signal), and is also likely to restart at any time if an application calls it via dbus.

So unless you modify the xml files outside an xfce session (and even then, having taken care to check that xfconfd is no longer running), the way to modify the settings stored in xfconf is to use xfconf-query (see xfconf-query --help).

Finally, to make changes made in xfconf active in xfsettingsd for displays, create the /Schemes/Apply property on the displays channel (xfsettingsd listens for these changes):

xfconf-query -c displays -p /Schemes/Apply -s Default --create --type string

Offline

#5 2025-04-16 18:49:38

vladimir_goosini
Member
Registered: 2025-04-16
Posts: 3
Windows 10Chrome 135.0

Re: re-querying display.xml

Tamaranch wrote:

Not sure what you mean, but anyway:
* xml files aren't necessarily up to date, as it's possible that xfconfd has cached information that it hasn't yet written (hence the use of xfconf-query instead of reading xml files directly);
* xfconfd is likely to overwrite the contents of these files at any time (especially when it exits following a SIGTERM signal), and is also likely to restart at any time if an application calls it via dbus.

So unless you modify the xml files outside an xfce session (and even then, having taken care to check that xfconfd is no longer running), the way to modify the settings stored in xfconf is to use xfconf-query (see xfconf-query --help).

Finally, to make changes made in xfconf active in xfsettingsd for displays, create the /Schemes/Apply property on the displays channel (xfsettingsd listens for these changes):

xfconf-query -c displays -p /Schemes/Apply -s Default --create --type string

I will describe the situation more specifically in display.xml the information on monitors (monitor model) is displayed very well. This is important to me. But on some devices it is not possible to collect information correctly, because in display.xml there is information from 2021, the monitor has already changed 100%. I noticed that if I open xfce4-display-settings in the GUI, the information is updated in display.xml. I need to execute the command without the GUI so that nothing opens, but at the same time receive up-to-date information. I need a command in the console that updates this display.xml

Added later 08 min 07 s:
After turning off, turning on display.xml is not updated. Is it possible to implement what I described?

Offline

#6 2025-04-17 05:01:40

Tamaranch
Member
From: France
Registered: 2020-12-31
Posts: 389
Website
LinuxFirefox 137.0

Re: re-querying display.xml

So what you have to do is do by hand what xfce4-display-settings does in the background:
* call xrandr to retrieve information from the monitor;
* call xfconf to finally update the xml file.

xfce4-display-settings does this in C via the APIs of the libxrandr and libxfconf libraries. I suppose the simplest thing to do in your case would be to write a script based on the xrandr and xfconf-query commands. Once you've finished, kill xfconfd and it will write the xml file. Unfortunately, it doesn't get much simpler than that: it's not magic...

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 8 queries executed - Memory usage: 551.42 KiB (Peak: 552.27 KiB) ]