Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How do I create a desktop wallpaper slideshow?

With cyclic wallpaper I mean the one that changes automatically image every tot seconds/minutes. There's only one by default in ubuntu 11.10 (you can see a white clock on the thumbnail), but I can't figure out how to add a new one with my images.

share|improve this question

marked as duplicate by jrg Mar 1 '12 at 22:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
Possible duplicate: askubuntu.com/q/134/18612 –  Christopher Kyle Horton Dec 5 '11 at 14:07

5 Answers 5

I believe you would have to script it...I looked at the /usr/share/backgrounds folder, which is the folder for the default backgrounds and it has a folder in it called contest.

In it there is an xml file (open in gedit to view or edit it). It seems to contain information on how long a picture will be shown and what picture it will transition to.

So I'm pretty sure you could just swap the filenames and paths in the xml file and tweak the duration and that should do it. Never tried it myself though.

The precise location of the xml file is /usr/share/backgrounds/contest/background-1.xml

EDIT: WHOOPS just looked at the other article posted as duplicate and it seems to have the answers you need How do I create a desktop wallpaper slideshow?

share|improve this answer

I use DesktopNova. It i very easy to configure and use. You can find it in the Software Center.

share|improve this answer

Yes, Daniel's answer (on top) is accurate in the sense that there are applications out there such as CreBS and WallCH to do the job of creating the XML script. Once you got the right syntax, you can even do it manually. His links lead to the process of installing those.

The problem is, at least in my case, the CreBS, for instance didn't work because there were some type of permission violation, leading to messages of "file not found" for the downloaded package.

Daniel's suggestion of using the original directory 'contest' and the original script file background-1.xml is the only way I could make it work when customizing the Ubuntu 11.10 Live CD.

My guess here is that if you have a install USB you may b e able to install the CreBS, Wallch, etc, but if you want to customize the install CD or USB, you will have to customize the *.img' (PC) or *.dmg' (Mac) image using the directions such as in https://help.ubuntu.com/community/LiveCDCustomization.

This last process may allow you to create additional directories such as 'contest' and may allow you to use a name other than background-1.xml in that directory.

share|improve this answer

I made a script for it, There is probably a better way, but I kinda want to publish it:

#! /bin/bash


#Directory where Pictures are stored
PicturesDir="$HOME/Pictures"

#Time in seconds to wait between background switches
WaitTime=20

#list of files
database="$PicturesDir/list.dat"

#because it is a very low priority job sleep for two minutes at startup
#sleep 120

#reload database of pictures
touch $database
rm $database
find $HOME/Pictures -iregex '.*\(.jpg\|.gif\|.png\|.jpeg\)' > $database

while [ true ]
do
    #get a random line number
    lineNum=$RANDOM
    let "lineNum %= $(cat $database | wc -l ) "

    #get a random picture from the list
    Pic=`sed $lineNum'q;d' $database`
    echo $Pic
    gsettings set org.gnome.desktop.background picture-uri "file://$Pic"
    sleep $WaitTime
done
share|improve this answer

I have researched this but never got around to try it. In 10.10 and 11.04 we could choose one of two background slide shows. This is how it was done and you can copy the method.

Go to /usr/share/backgrounds and there you will find the 11.10 background images and a folder called contest. In the folder called contest is a document called background-1.xml. That is the script that runs the background slide show. Here is a sample of what it looks like:

<!-- This animation will start at midnight. -->
  <static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Stalking_Ocelot_by_Sayantan_Chaudhuri.jpg</file>
  </static>
  <transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Stalking_Ocelot_by_Sayantan_Chaudhuri.jpg</from>
<to>/usr/share/backgrounds/Small_flowers_by_Dariusz_Duma.jpg</to>
  </transition>
  <static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Small_flowers_by_Dariusz_Duma.jpg</file>
  </static>
  <transition>

The rest of the script is a repeat of these lines but point to and from the different images in the backgrounds folder.

You now need to

1) create another folder with a name of your own choosing in the backgrounds folder.

2) copy your chosen background images into the new folder.

3) copy the document background-1.xml in that new folder.

4) edit/modify the background-1.xml document to point to your background images which should be in this same new folder. so, the paths to the images will be different. Instead of

/usr/share/backgrounds/imagename.jpg

It will be

/usr/share/backgrounds/newfoldername/imagename.jpg

Then you should get another background slide show option in the Appearance utility.

I have saved the backgrounds and the scripts from 10.10, and 11.04, so I know that this is the way it is officially done.

You will need administrator privileges to copy and edit these scripts. So, you need to run

gksudo gedit /usr/share/backgrounds/contest/background-1.xml

That will open the document in Gedit with administration privileges which will let you edit it and save it in the new folder. And

gksudo nautilus

To give the file manager administration privileges so that you can create the new folder.

EDIT: Further research shows that there is another script involved. It is found at /usr/share/gnome-background-properties, and it is called ubuntu-wallpapers.xml. This is the script that tells the Appearance utility what images to put in its left panel and which folder to look in for the script background-1.xml to use as a slide show. The script needs to be edited following the pattern.

You may find as I did that the left panel ends up with duplicate images or folders. This is because a duplicate ubuntu-wallpapers.xml document is created when you edit the original one. Just move the duplicate ubuntu-wallpapers.xml document from the gnome-background-properties folder to the rubbish bin.

Regards.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.