Introduction
Gnome (both Gnome-Shell and Unity) can display slideshow wallpapers without any additional software. All that's needed is a collection of images and two XML files to configure the slideshow. The first XML file informs Gnome of the slideshow's existence so that it can be selected in System Settings; the second configures the ordering and timing of the slideshow.
Background Properties XML File
First of all, create the directory hierarchy that will hold your first XML file:
mkdir -p ~/.local/share/gnome-background-properties
Next, create the actual XML file that will inform the system that you have a new wallpaper:
gedit ~/.local/share/gnome-background-properties/MyFirstSlideshowCollection.xml
The XML filename is arbitrary as long as it ends in '.xml' as all files in this directory will be read by Gnome.
For example:-
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd"> <wallpapers> <wallpaper> <name>My 1st Wallpapers</name> <filename>.local/share/backgrounds/wallpaper1/My1stSlideshow.xml</filename> <options>zoom</options> <pcolor>#2c001e</pcolor> <scolor>#2c001e</scolor> <shade_type>solid</shade_type> </wallpaper> </wallpapers>
Warning: By default gedit it will create a backup of your file by appending a tilde ('~') to the filename. Gnome will read this as an additional XML file and display your slideshow twice in System Settings. To avoid this, disable the creation of backups in gedit settings, or alternatively, remember to delete the backup file afterwards.
This file contains a <filename> tag that points to the second XML file that describes your slideshow. The XML file that describes the new slideshow is therefore:
.local/share/backgrounds/wallpaper1/My1stSlideshow.xml
but it could be located anywhere and named anything as longs as the <filename> tag above points to it. Note the following though:
The <name> tag is the 'pretty' name of the slideshow, as displayed in System Settings
The <options>, <pcolor>, <scolor> and <shade_type> tags are optional. If they are not supplied, System Settings will give you the option to select them.
Slideshow XML File
Next, create and edit this slideshow XML file to configure the actual images used:
mkdir -p ~/.local/share/backgrounds/wallpaper1 gedit ~/.local/share/backgrounds/wallpaper1/My1stSlideshow.xml
This file will contain the filename, paths and timings for the slideshow.
For example:-
<background> <starttime> <year>2012</year> <month>01</month> <day>01</day> <hour>00</hour> <minute>00</minute> <second>00</second> </starttime> <static> <duration>300.0</duration> <file>.local/share/backgrounds/wallpaper1/Beautiful-Nature.jpg</file> </static> <transition> <duration>5.0</duration> <from>.local/share/backgrounds/wallpaper1/Beautiful-Nature.jpg</from> <to>.local/share/backgrounds/wallpaper1/Ubuntu.jpg</to> </transition> <static> <duration>300.0</duration> <file>.local/share/backgrounds/wallpaper1/Ubuntu.jpg</file> </static> <transition> <duration>5.0</duration> <from>.local/share/backgrounds/wallpaper1/Ubuntu.jpg</from> <to>.local/share/backgrounds/wallpaper1/Beautiful-Nature.jpg</to> </transition> </background>
Save the file. Most of this is quite self-explanatory, but just in-case:
- The file paths and filenames will need to be adjusted to suit your wallpaper images. In this example, they stored in the same place as the XML file, but they doesn't have to be.
- The start time will need to be in the past for you to see the slideshow working.
- Duration is in seconds.
- The above displays a static image for 5 min (300 sec) and then takes 5 seconds to transition to the next image.
- You can have as many files as you want - this is two images so that it isn't too long.
To make life easier, there are tools and scripts available that will create this XML file for you. Google is your friend here!
If all goes well, you should be able to see the new slideshow in System Settings -> Appearance.
Some people have reported that their systems crash if these files are incorrectly configured or point to non-existent files. Therefore, save all important work beforehand.
Sharing Your Slideshow
To share your new slideshow, simply tar it up and share!
cd tar -czf My1stSlideshow.tgz .local/share/gnome-background-properties/MyFirstSlideshowCollection.xml .local/share/backgrounds/wallpaper1
Your recipients merely need to extract the tar to use it:-
cd tar -xvzf My1stSlideshow.tgz
It should now be visible in their System Settings -> Appearance.
System Wide Slideshow
As configured, the slideshow is only available to you as it resides in your home directory. To make it available to all users it will need to be moved to a system wide shared area and filepaths adjusted accordingly.
Warning: Due to the issues reported of systems crashing when slideshow files are missing or moved it is highly recommended that you change the background to a static image (or colour) while you carry out the next procedure as it will involve moving your slideshow files.
Ubuntu places shared backgrounds in '/usr/share/backgrounds'. Create a sub-directory to store your slideshow. For example:-
sudo mkdir -p /usr/share/backgrounds/wallpaper1
Next edit your Slideshow XML file to reflect the changed paths to your images.
gedit ~/.local/share/backgrounds/wallpaper1/My1stSlideshow.xml
Change all instances of '~/.local' to '/usr'. Gedit's Find and Replace may be useful here.
Save the changes and move the images and XML file to the system wide shared area:-
sudo mv .local/share/backgrounds/wallpaper1/* /usr/share/backgrounds/wallpaper1
Next edit the Background Properties XML file to point it to the new Slideshow XML location:-
gedit ~/.local/share/gnome-background-properties/MyFirstSlideshowCollection.xml
Change the <filename> tag to point to the new location. For example, to:-
<filename>/usr/share/backgrounds/wallpaper1/My1stSlideshow.xml</filename>
Finally, move the Background Properties XML File as follows:-
sudo mv ~/.local/share/gnome-background-properties/MyFirstSlideshowCollection.xml /usr/share/gnome-background-properties/
Note that there may be other XML files in the target directory already, so make sure that your filename is unique before you carry out the command above. Names like ' precise-wallpapers.xml' and 'ubuntu-wallpapers.xml' should be avoided.
The slideshow should now be visible in System Settings -> Appearance for you and all other users.
Originally posted The Ubuntu Forums (ubuntuforums.org)