Ubuntu wallpaper slideshow

The desktop background switcher included with Karmic Koala has a cool feature, a wallpaper slideshow that rotates images at a predetermined interval. However, getting it to cycle through your own set of images isn’t exactly user friendly. In order to get a sequence of images to display, the wallpaper picker must be supplied with an xml file with the following structure:

        1795.0
        /path/to/image1.jpg
 
        5
        /path/to/image1.jpg
        /path/to/image2.jpg
 
        1795.0
        /path/to/image2.jpg
 
        5
        /path/to/image2.jpg
        /path/to/image1.jpg

Where all paths are absolute. The xml file can be chosen as a wallpaper in the standard gnome wallpaper picker by going pressing add and choosing “All files” from the file filter drop down.

To make the process of creating these xml files a bit simpler, I made a python script that takes all images in a directory and generates an xml file for them. To use it, simply run it in the directory where the images are located and it will generate a file called “desktop.xml”. The default transition time is 1795 seconds (30 minutes). To change the switch time, supply the new interval in seconds as an argument:

./ubuWallGen 1200

You can get the latest version of the script using git:

git clone git://github.com/royvandewater/ubuWallGen.git

You can also download the script directly here

    • Geoff
    • January 10th, 2010

    Brilliant Roy!! … many thnx *smile*

    GR

    • Nick
    • February 15th, 2010

    Ln 35 has an extra “>”

    • Roy
    • February 16th, 2010

    Good catch, I updated the script to fix this

  1. Great post!

    I’d suggest adding that you have to select desktop.xml as the selected wallpaper in “Change Desktop

  2. Great post!

    I’d suggest adding that you have to select desktop.xml as the selected wallpaper in “Change Desktop Background”, as I had to go to another site to find out how to use the XML file.

    Thanks!

    • Roy
    • June 10th, 2010

    Thanks for the suggestion, I added in some instructions for that to the post.

  3. Great script!! Thanks

  1. No trackbacks yet.