Create A Desktop Background Wallpaper Changer For Xfce

Author: Stephan Jau


I have switched to Xubuntu a few months ago coming from Kubuntu. In Kubuntu I liked the (already available) option of setting up a list of image files and have them randomly displayed as background image on the desktop. This was one of the things I have missed so far in Xfce.

Also to say as former Windows user I have aquired/gathered quite a large number of wallpapers (thx goes to HTTrack for downloading over 18k wallpapers... I couldn't have manually done that... ok, maybe I could have...) and I like to have them displayed randomly on the background. That's more or the less the only major change I do on a theme (if you can call that a change...) as I let things normally as they are...

Anyway, thanks to TheSheep from the #xubuntu channel on (he's a really helpful guy and has helped me countless time) I can provide you with this small howto.

(1) Creating the list of images

1.1 Right-click on your desktop.

1.2 Select Desktop settings.

1.3 Make sure that the Allow Xfce to manage the desktop and Show Image boxes are checked (they are by default).

1.4 Click then on New list.

1.5 Add the image files by clicking on the +

1.6 Once you are done, save the list.

1.7 You are back in the previous screen and your newly created list should be selected in the File input box.

1.8 Then close that interface.

(2) Creating tje cron file for the wallpaper changer functionality

I normally create a cron.txt file where I add/delete cronjobs to and then, after modifying, I add it. This is also what I do here. If you add cronjobs differently, then you will have to see how you do that but the basic command that's executed stays the same.

2.1 Open a terminal.

2.2 Open your existing cron.txt file (or similar one) with your preferred editor. If you have no cron file then simply issue this command:

nano cron.txt

2.3 Now you are in the text editor nano and you need to paste now the following code into the file:

# Reload Background Image
0,5,10,15,20,25,30,35,40,45,50,55 * * * * killall -USR1 xfdesktop

This will change the image every 5 minutes. You can also change the behaviour. Please refer here: Wiki: Cron

2.4 To exit nano press:


Then press y to save the file

(3) Adding the Cronjob for Wallpapcher Changer

3.1 Before you overwrite any existing user cronjobs please execute this command:

crontab -l

If nothing is returned then it's fine to add you wallpaper changer script!

However if something appears, then you may want to copy'n'paste that into your cron.txt file otherwise it will be overwritten with the next step.

3.2 Add the cron.txt file that we created under section (2) by issuing the following command in the shell:

crontab cron.txt

3.3 Enter now again the command listed in 3.1 and you should have an output like this:

[email protected]:~$ crontab -l
# Reload Background Image
0,5,10,15,20,25,30,35,40,45,50,55 * * * * killall -USR1 xfdesktop

(4) That's it

Get some coffee or whatever and enjoy your desktop bakground wallpaper changer.

Share this page:

Suggested articles

8 Comment(s)

Add comment



Just want to say - thanks a ton for this howto, I've been looking for a way to do this for a couple days. Works great, though I set mine to work only every 30 minutes. (Only 10 wallpapers so far. :)

Anyway, instead of the whole cron.txt thing, simply use "crontab -e", as this will open your cron file if you have one already or make a new one if you don't. Just eliminating one step.

By: Drew

How do you save and exit after typing crontab -e? I can't exit that file in terminal. using fedora. thanks.



By: Anonymous

when i type crontab cron.txt i get this:

"cron.txt":2: premature EOF
errors in crontab file, can't install.


By: 3d wallpaper creator

Very good site! I am a fan of different cool wallpapers ! I will recommend this site to my all my friends!

By: LuckyMusic

Thank you very much for the help, you can use this crontab string to execute command every 5 minutes:

*/5 * * * *  killall -USR1 xfdesktop

 Also, USR1 signal does not changes walpaper on my freebsd box, I'm using XFCE 4.6 on it, but KILL signal works well (it seems that XFCE restarts xfdesktop process when it killed)

By: El Siurell

My version  xfce4 4.6.1


 Hi, on my debian there is no option -USR1. I think the killall is real overkill. Sometimes xfdesktop came not back again.


So, create the list of images and put that in your crontab:

*/5 * * * *     xfdesktop --reload

That avoid also the grey screen while changing.

Thanks a lot for your article Stephan

El Siurel

By: Anonymous

well, i often use wallpaper template to make wallpaper on mac, i think that will more easier.

By: Kyle

I don't know which version of Xfce you're using or when this was posted (no timestamp) but in Xfce 4.13.6 that I use, Xfce deskop setting already has an option to change the background, optionally randomly, with any time interval of your choice, without having to resort to a cron job.

I found this webpage while trying to find a way to change the way transition between background is done. Currently it is instantaneous, which distracts me when I have a whole bunch of windows open and only a snippet of the background is seen.

When that snippet of background suddenly changes, it grabs my attention unnecessarily, so I was hoping to have an option to slowly transition to a new background without me noticing.