You are not logged in.

#1 2013-02-21 00:27:44

From: Detroit, Michigan
Registered: 2011-12-23
Posts: 22

XFCE workaround: Laptop wallpaper not kept when undocked

So I've been running into the minor annoyance of XFCE always using the wallpaper from the monitor on the left screen after I unplug my secondary monitor. Not sure if anyone else runs into this. Just to clarify:
(pretend the pipe is the border between screens)   
While docked: Wallpaper A (VGA-1) | Wallpaper B (LVDS)
Undocked: Wallpaper A (LVDS)
I would expect wallpaper B to persist on the laptop display regardless of whether the second monitor is hooked up or not.

Since I use a script to toggle my monitor off and on using a hotkey I made a few modifications to it so that you can specify the wallpaper setup while docked or undocked. You could also have completely different wallpapers while mobile if you don't want to be seen in public with your My Little Pony wallpaper.

(I still use a CRT as a second monitor, don't make fun of me)

#Absolute path seems to be required for some reason. 
function xfset {
        cat $location/$1 | while read line; do
                variable=`echo $line |awk '{print $1}'`
                setting=`echo $line |awk '{print $2}'`
                xfconf-query -c xfce4-desktop -p $variable --create -s $setting
current=`xrandr |grep current |awk '{print $8 $10}'`
if [ $current == '1366768,' ]
#Going to Dual
        xfconf-query -c xfce4-desktop -l -v|grep backdrop>$location/single.set
        xrandr --output LVDS --mode 1366x768 --pos 1600x432 --rotate normal --output CRT1 --mode 1600x1200 --pos 0x0 --rotate normal --output DFP1 --off;
        xfset dual.set
#going to single
        xfconf-query -c xfce4-desktop -l -v|grep backdrop>$location/dual.set
        xrandr --output LVDS --mode 1366x768 --rotate normal --output CRT1 --off --output DFP1 --off
        xfce4-panel -r
        xfset single.set

Let me know if you have any feedback or found this useful. I'm curious if this is a problem anyone else has.

Last edited by Jasonvw (2013-02-21 09:51:36)

RAID !=backup


#2 2013-02-21 02:10:38

Registered: 2012-11-15
Posts: 51

Re: XFCE workaround: Laptop wallpaper not kept when undocked

You could look at xfconf properties comparing both monitors with one montor connected to find out differences.
i.e. xfconf-query -c xfce4-desktop -l

Setting a wallpaper in xfce through xfconf:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path --create -t string -s $wp
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show --create -t bool -s true
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style --create -t int -s 0

Where $wp is set to full path of image file.

When comparing the properties you might find monitor1 becomes monitor0 and that might explain the wallpaper switching.

You can find out the path to the current wallpaper using a query like:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path

May be some of the above will help you figure something out. I only mention it because it is disconcerting to me that you are killing stuff like xfconfd and xfdesktop to achieve the proper wallpapers.



#3 2013-02-21 09:49:10

From: Detroit, Michigan
Registered: 2011-12-23
Posts: 22

Re: XFCE workaround: Laptop wallpaper not kept when undocked

Yeah, you are definitely correct. It seemed odd to be killing those off to me too. It was the predominate way I was finding so I kind of followed the crowd. Using your suggestions I've essentially re-written it. No longer messes with those XML files and just does a straight dump of xfconf settings to a file then re-loads them when you switch back. Thanks so much for the help. To avoid confusion I just edited my original post.

RAID !=backup


Board footer

Powered by FluxBB