Create A Desktop Background Wallpaper Changer For Xfce

Want to support HowtoForge? Become a subscriber!
 
Submitted by sjau (Contact Author) (Forums) on Sun, 2006-12-31 20:47. :: Desktop | Other

Create A Desktop Background Wallpaper Changer For Xfce

Author: Stephan Jau

Introduction

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 irc.freenode.org (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:

ctrl-x

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:

hyper@xubi:~$ 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.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Tue, 2009-09-29 06:52.
well, i often use wallpaper template to make wallpaper on mac, i think that will more easier.
Submitted by El Siurell (not registered) on Sat, 2009-06-06 12:21.

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

Submitted by LuckyMusic (not registered) on Mon, 2009-03-09 11:33.

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)

Submitted by 3d wallpaper creator (not registered) on Sat, 2009-01-17 07:26.
Very good site! I am a fan of different cool wallpapers ! I will recommend this site to my all my friends!
Submitted by Sharntehnub (registered user) on Fri, 2007-06-29 03:23.

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.

Submitted by Drew (not registered) on Thu, 2009-01-22 07:39.

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

 

 

Submitted by Anonymous (not registered) on Thu, 2009-01-22 15:41.

when i type crontab cron.txt i get this:

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

?