First of all check Xfce 4 Desktop Manager help. Click on the New list… button and create a list with all the backgrounds you want to rotate.

From this page:

To refresh the backdrop with a new random image from the list just run the xfdesktop command again, e.g. from a terminal or the run dialog, or xfdesktop [-reload].

What we have to do now is to create a shell script that runs xfdesktop -reload and to add a cron job to run it.

Let’s begin with the script, here is the code:

#!/bin/bash

#check if we are under xfce
for foo in  `ps aux | grep xfdesktop | awk '{print $11}'`;
do
  if [ $foo == "xfdesktop" ];
  then
    #reload xfdesktop
    export DISPLAY=:0
    xfdesktop -reload
  fi;
done;

Now we need to add a line in the crontab, run the script every 25 minutes:
*/25 * * * * /home/etd/scripts/xfdesktop-reload.sh

NOTE: If someone finds an easier way to check whether the user is running Xfce or not, please let me know.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • Technorati