Changing display with xfconf-query

Boris Hollas boris.hollas at gmx.de
Thu Nov 29 17:42:13 CET 2012


Ok, I can switch between internal and external screen with

~$ xfconf-query -c displays -p /Default/DVI-0/Active -t bool -s 'true'
~$ xfconf-query -c displays -p /Default/LVDS/Active -t bool -s 'false'
~$ xfconf-query --create -c displays -p /Schemes/Apply -t string -s 
'Default'
~$
~$ xfconf-query -c displays -p /Default/DVI-0/Active -t bool -s 'false'
~$ xfconf-query -c displays -p /Default/LVDS/Active -t bool -s 'true'
~$ xfconf-query --create -c displays -p /Schemes/Apply -t string -s 
'Default'

However, after the last command, my panel was lost. Also, when I used 
xfce-display-settings -m to switch back to DVI-0, both screens were 
blank. I blindly typed "disp", which runs

#!/bin/sh
LVDS=LVDS
VGA=VGA-0
DVI=DVI-0

xrandr | grep -q "$DVI connected" && DVI_ON=1 || DVI_ON=0
xrandr | grep -q "$VGA connected" && VGA_ON=1 || VGA_ON=0

if [ $DVI_ON -eq 1 ]; then
     xrandr --output $LVDS --off --output $DVI --mode 1920x1200
elif [ $VGA_ON -eq 1 ]; then
     xrandr --output $VGA --auto --output $LVDS --mode 1024x768 
--same-as $VGA
else
    xrandr --output $LVDS --mode 1680x1050
fi


but to no avail. I got my screen back after I switched to the console 
and back to X11. No I have my panel and my screen back.

While I can use xfce-display-settings -m to dock, undock and connect a 
beamer, I need a fail-safe solution to bring my internal LCD back in 
case I forgot to call xfce-display-settings -m before undocking (in 
whcih case my internal LCD is blank and therefore I can't click any 
menus). Unfortunately, my disp script doesn't always work and sometimes 
the panel isn't visible (see my mail from 20.11.)


Best regards,
Boris


More information about the Xfce mailing list