• ARTICLES
SEARCH

How-To Geek

How to Create a Wallpaper Slideshow in Ubuntu

Just like Windows 7 and OS X, Ubuntu has the ability to create a slideshow wallpaper thanks to GNOME 2.28. Here is how you can take control of your wallpaper slideshows with a simple to use GUI tool or a down and dirty text editor.

The easy way

Let’s start by showing you the easy way to create a slideshow wallpaper using a GUI tool called CreBS (Create Background Slideshow). CreBS is an easy install in Ubuntu. To install the software open up a terminal and type

sudo add-apt-repository ppa:crebs/ppa
sudo apt-get update
sudo apt-get install crebs

This will install the CreBS repository, update your available packages, and then install CreBS. Once CreBS is installed, head over to your menu and launch CreBS.

To create your wallpaper slideshow just use the add button and select images to add to the wallpaper. You can also drag and drop your wallpapers to change their order.

Once you have all the images you want, change the settings below for the amount of time between slideshow changes and how long you want transitions.
After all the settings are set up the way you want, type in a name at the very bottom and then click the green check to apply and save the desktop wallpaper.

If you ever want to apply the theme again later you can right click on the desktop and select change desktop background. If you want to share the wallpaper slideshow with friends you will have to edit the xml manually so I would suggest just sending them the pictures and allowing them to recreate the theme on their system.

The manual way

If GUI’s just aren’t your thing, you can also create a wallpaper slideshow using a text editor. All you need to do is create an XML file with the following sections:

<background>
  <starttime>
    <year></year>
    <month></month>
    <day></day>
    <hour></hour>
    <minute></minute>
    <second></second>
  </starttime>
  <static>
    <duration></duration>
    <file></file>
  </static>
  <transition>
    <duration></duration>
    <from></from>
    <to></to>
  </transition>
</background>

The <starttime> section is just to say when the slideshow is to start. You can either have it start in the future or just set it to a past date and it will start instantly.

You can add as many <static> and <transition> sections as you’d like.  The <static> sections point to the actual wallpaper files and how long to show each image. The <transition> sections specify how much time to use to fade from one static image to the next. Unfortunately, you can’t set the images to be displayed randomly. Save your xml file in /usr/share/backgrounds/ to make it available for all users on the system.

Conclusion

It isn’t hard to create your own wallpaper slideshow in any Linux distribution running the GNOME desktop environment with this simple XML layout and a folder full of images. Enjoy this handy trick to customize your install.

CreBS

Justin is a Linux and HTPC enthusiast who loves to try new projects. He isn't scared of bricking a cell phone in the name of freedom.

  • Published 08/16/10

Comments (15)

  1. George

    I tried creating my own slideshow wallpaper before when Ubuntu 9.10 was released. I used gedit and modified the Cosmos file but for some reason the wallpaper would not switch at the scheduled times. I installed Desktop Drapes but that also seems to have some issues. Hopefully this will work on a PC with a NVIDIA card.

  2. Dennis

    I installed Desktop Drapes in Ubuntu 10.04 and it works fine for me. The only one issue that i have is when i try to set it up to start when the system boot, simply doesn’t, and i have to started it manually :(

  3. George

    Dennis,

    I read a post somewhere that fixes that problem, but I don’t remember where off the top of my head. I might have it at home. If so I will post the link.

    You might want to do Create background Slideshow instead. This worked on my Sager NP8690 with Ubuntu 10.04 x64 with a Nvidia card. I selected 20 images and created a slideshow wallpaper. I changed the default time so I didn’t have to wait 15 minutes. All knight it changed as it should.

    Thank you Justin for this great tip!

  4. Bogdan

    Here’s a Bash script that does configure any wanted pictures folder for slideshow (and will be available automatically in the background settings as a slideshow). This works great for many many pictures, the script automatically configures all the pictures without lots of clicks.

    #!/bin/bash

    if [ $# -ne 1 ]; then
    echo “Usage: $0 ”
    exit 1
    fi

    if [ "`id -u`" != "0" ]; then
    echo “You must have root privileges to execute this script!”
    exit 1
    fi

    if [ ! -d "$1" ]; then
    echo “The argument should be a folder!”
    exit 1
    fi

    DIR_NAME=”`basename $1`”
    BACKGROUNDS=”/usr/share/backgrounds/”
    DIR=”$BACKGROUNDS$DIR_NAME”

    if [ -d "$DIR" ]; then
    echo “The folder \”$DIR\” already exists, do you want to continue overwriting it? [Y/N]”
    read cont
    if [ -n "$cont" -a "$cont" != "Y" -a "$cont" != "y" ]; then
    exit 0
    fi
    fi
    echo “Copying \”$1\” to \”$BACKGROUNDS\”…”
    cp -rf “$1″ “$BACKGROUNDS”

    PROP_DIR=”/usr/share/gnome-background-properties”
    PROP=”$PROP_DIR/$DIR_NAME.xml”
    SLIDES=”/usr/share/backgrounds/$DIR_NAME/background-1.xml”

    echo “Writting \”$PROP\”…”
    echo -e “\n\n\
    \t\n\t\t$DIR_NAME\n\t\t$SLIDES\n\t\n” > “$PROP”

    echo “Writting \”$SLIDES\”…”
    echo -e “\n\t\n\t\t2010\n\t\t11\n\t\t18\n\t\t00\n\
    \t\t00\n\t\t00\n\t” > “$SLIDES”

    find $DIR -maxdepth 1 -type f -iname “*.jpg” -o -iname “*.jpeg” -o -iname “*.png” | while read IMG; do basename $IMG; done | \
    while read NEXT; do if [ -n "$PREV" ]; then echo -e “\t\n\t\t5.0\n\t\t$DIR/$PREV\n\t\t$DIR/$NEXT\n\t”; fi;\
    echo -e “\t\n\t\t1795.0\n\t\t$DIR/$NEXT\n\t”; PREV=$NEXT; done >> “$SLIDES”

    echo “” >> “$SLIDES”

    echo “Done.”

  5. daffydd

    Thanks for the Crebs link. I faffed around for hours, copying the “cosmos” xml file and replacing their pictures with mine (with the correct addresses to my own folder in /usr/share/backgrounds) but when I added the xml to Appearance Preferences all I got was a black screen. How long will I remain a newbie?

  6. Will

    Might want to check out https://help.ubuntu.com/community/Cortina as it monitors the directories that you select and automatically adds new images to the desktop wallpaper slideshow.

  7. RandomPersonFromZeInternet

    Here’s an example for the real newbies (like me):

    2009
    12
    12
    15
    30
    12
    ———- Just a random date

    900
    PUT PICTURE PATH HERE
    ———- 900 duration is in seconds the path of the pic is where it is

    5
    PUT PATH OF PIC USED FIRST HERE
    PUT PATH TO NEXT PIC HERE
    ———— 5 second duration in other words it changes from one
    ———— background to the other in 5 seconds

    900
    PUT PIC PATH HERE OF THE NEXT PIC
    ————- same story as first

    5
    PUT PATH OF SECOND PIC USED HERE
    PUT PATH TO THIRD PIC HERE
    ———- same story again

    900
    PUT PATH TO THIRD PIC HERE
    ———– after your final pic theres no need to add another transition

    now save it as xml and drag/drop it into your background tab of appearance preferences and your good to go. remember that you can switch the durations in whatever ones you like.

    hope this helped.

    P.S. DO NOT add the ——–(text) lines in your script. remove them first!!

  8. Dezt

    The hard way takes too much time, I’ve did it with 20 pictures. :\

    Now, thank god I’ve encountered your post, thanks alot it worked like a charm. :)

  9. Ph-

    I found that it is possible to modify a preexistent .xml file -like for example the one that you got installing the “day of ubuntu” theme- and creating as root (i.e. using nautilus) your folder in usr/share/backgrounds; you just need to change the names in the original .xml file and that’s it.
    Of course you can change any other parameter.

    I hope it can be useful to someone :)

  10. dara jihan

    thanks man it’s worked for me(ubuntu 11.04)

  11. fabfc

    Thanks dude, it works great on ubuntu 10.10 x64

  12. jimh

    This works perfectly on karmic and is pretty straightforward
    code:
    #!/bin/bash
    # This simple code works like a champ in karmic. It cycles through everything in
    # Cruise/jpg-links. The best gconf option # for this is “scale”. The code randomizes a
    # dir of image names and feeds the top result to gconftiool. Look at gconf-editor to set the
    # scale option.

    while [[ 1 ]] ; do
    ls /home/me/Cruise/jpg-links/*.jpg | shuf | \
    { read a b ; \
    gconftool-2 -t str -s /desktop/gnome/background/picture_filename “$a” ; }
    sleep 10
    done

  13. jimh

    OOPS. this might be better …… I forgot ls is not what I wanted ….. you may need other tweaks but this gives the essentials and I am running this exact code now

    while [[ 1 ]] ; do
    find /home/me/Cruise/jpg-links/*.jpg | shuf | \
    { read a ; echo $a ; \
    gconftool-2 -t str -s /desktop/gnome/background/picture_filename “$a” ;}
    sleep 10
    done

  14. judson

    thanks for the info !

  15. hexatex

    Nice post thnx

Enter Your Email Here to Get Access for Free:

Go check your email!