Score:1

Applying Gnome Wayland display settings monitors.xml via automation / command-line?

gb flag

Basically, I want to automate changing display settings manually in Gnome Settings. If I am not wrong, it seems that the settings is stored in ~/.config/monitors.xml. So, I guess I could create multiple of them and apply one via script, but how to apply that file?

I am using Wayland, and when I searched the web for a way to do it, the result was an old forum post that was just restarting gnome-shell. But, you cannot restart gnome-shell in Wayland.

enter image description here

Score:1
ca flag

It seems to activate the monitors.xml the session needs to be terminated. But display settings can be changed via dbus, i.e. using python like: Python Script

Credit

Damn Vegetables avatar
gb flag
I cannot know what exactly the script does. The settings I need to change would be (1)monitor on/off state, (2)monitor position (because, when enabling/disabling monitors, Gnome misplaces my monitors), (3)the primary monitor, and (4)monitor scaling (because, sometimes Gnome seems to reset the scaling), all of which are can be changed with Gnome Setting's GUI above. Are all of (1)~(4) changeable with Python scripting?
Hanspeter Gosteli avatar
ca flag
yes - un-commenting lines 18-36 should print your current structs which then can be manually copied and applied to the script. (1) by not configuring a display it will go off. (2) position is in first two parameters of struct x, y. (3) primary is a boolean at the fifth position. (4) scaling happens at the third ... refer to line 32 it shows the parameters.
Damn Vegetables avatar
gb flag
It seems a lot complicated than I expected, but at least now I know it can be done. Thanks. I think I have to experiment a lot to get what I want.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.