August 31, 2020

xfce -- setting the desktop background

The basic way to do this is to go to Settings -- Desktop and then fiddle around. I put background images into ~/Backgrounds. The desktop GUI lets you set a folder, but do NOT try to actually pick out an image when setting the folder. The image files are greyed out -- because they aren't folders, and this always confuses me.

If you want to set a solid background color, you must set style to None and then you are good to go.

Setting background from the command line

If this could be done, it would be fun because I could have a cron job or something set a different image for each day of the week. Or for morning, afternoon, and at night. The sky is the limit.

The following shell script works like a charm.

#!/bin/sh
IMM=/home/tom/Backgrounds/east_lake_bg.jpg
PROP=/backdrop/screen0/monitorDP-1/workspace0/last-image
xfconf-query --channel xfce4-desktop --property $PROP --set $IMM
Interestingly, this sets the background for all of the 8 workspaces I have in use. Note that you must specify the full path for the image.

You may have to discover the exact name of the property to set. Typing this will give a full list of properties:

xfconf-query --channel xfce4-desktop --list

Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org