Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-03-06 07:24:12

manjaro_user
Member
Registered: 2018-03-06
Posts: 1

display settings set via xfconf-query not applied until after reboot

I'm a beginner to linux and xfce and I'd really appreciate some help! smile I'm trying to figure out how to set my monitor display settings from the commandline.

I've been able to set properties using xfconf-query with success for themes, icons, and panels. For whatever reason, when I use it to alter properties from the displays channel, the changes are not applied until after a reboot. Running the code below and checking the property values using xfconf-query -c displays -lv or cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml show that the relevant settings are being changed as would be expected.

Here's the code. The single display mode block is commented out, but the same idea applies. The eventual plan was to trigger one or the other based on a signal or interrupt of plugging in or unplugging the HDMI cord. I have no idea how to do that, but I'm guessing it's possible. No sense in figuring that out until I can change display settings without rebooting, but if you do know how to do this I'd appreciate a pointer on what docs or manpages to read.

LAPTOP_PFX="/Default/eDP1"
EXTERNAL_PFX="/Default/HDMI1"
X_POS="/Position/X"

LAPTOP_X_OFFSET="1920"

# ******************** Dual Display Mode ********************
# Turn both displays on
xfconf-query -c displays -p "$LAPTOP_PFX/Active" -s true
xfconf-query -c displays -p "$EXTERNAL_PFX/Active" -s true

# Set external monitor to primary display
xfconf-query -c displays -p "$LAPTOP_PFX/Primary" -s false
xfconf-query -c displays -p "$EXTERNAL_PFX/Primary" -s true

# Set the secondary display to be to the right of the primary display
xfconf-query -c displays -p "$LAPTOP_PFX$X_POS" -s "$LAPTOP_X_OFFSET"

# ******************** Single Display Mode ********************
# # Turn laptop display on
# xfconf-query -c displays -p "$LAPTOP_PFX/Active" -s true
# xfconf-query -c displays -p "$EXTERNAL_PFX/Active" -s false

# # Set laptop monitor to primary display
# xfconf-query -c displays -p "$LAPTOP_PFX/Primary" -s true
# xfconf-query -c displays -p "$EXTERNAL_PFX/Primary" -s false

# # Reset offset
# xfconf-query -c displays -p "$LAPTOP_PFX$X_POS" -s 0

Changing these settings using the Display gui program xfce4-display-settings is how I've set my (dual) monitor setup manually for the months since I've started using xfce4. The settings in the gui program always reflect the actual settings, nothing I do via xfconf-query affects it although it (the Display gui program) affects the same settings that xfconf-query affects. Changes made in the Display gui program applied instantly, which makes me wonder how it works. Also opening the gui after I've changed settings from the commandline (without a reboot) causes them to be reset to what they were before.

Xfce 4.12
Manjaro Linux 17.1.6

Last edited by manjaro_user (2018-03-06 07:30:39)

Offline

#2 2018-03-06 15:36:43

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: display settings set via xfconf-query not applied until after reboot

Hello and welcome.

I can verify that xfconf-query does not automatically change display settings. I'm not sure if this is by design or a bug. You could create a bug report and see what the developers say.

You can use xrandr to make immediate changes to your display settings though. I've successfully used this script and udev rule (udev + xrandr) to recognize display changes and enable customized configurations automatically.


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

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 524.56 KiB (Peak: 529.33 KiB) ]