Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48

Thread: HowTo: Create a background slideshow.

  1. #1
    Join Date
    Oct 2007
    Location
    Australia
    Beans
    1,715
    Distro
    Ubuntu Development Release

    HowTo: Create a background slideshow using what is already installed on your machine.

    HowTo: Create a background slideshow using what is already installed on your machine.

    What's the point of this tutorial?

    This tutorial is it is here for those who wish to work with what is already installed on their system and wish to have a screen background that changes at predetermined intervals. It is for those who want to understand the already natively available AND installed system. It has been tested on Ubuntu 10.04 Lucid Lynx which is the current LTS. I will not, because I don't have any earlier versions installed anymore, be testing this on anything prior to Ubuntu 10.04. As each new version is released I will test it and report any difficulties found. If you have difficulties please feel free to let me know what they are and we can work through them together. It is based on the script and setup for the background named "Cosmos" which comes pre-installed in Ubuntu 10.04.

    Please note: This is just 1 way of doing this, there are many more ways and formats possible. Choose what is the best for you. This tutorial isn't here to dictate to anyone what is the best method for you to use. Instead, as has already been stated, it is here for those who wish to work with what is already installed on their system. If you find something others can use you could create a Tutorial on it to help others. Please do not turn this tutorial into a "my way is the best way" discussion, instead treat it like the technical tutorial it is and leave discussion about other methods to other threads.

    Note: I do not know if this will work in Kubuntu, Xubuntu, or any other variant other than Ubuntu. IF you try this in anything other than Ubuntu 10.04 and it works please let us know so we can add the information to this thread and give you the credit for your hard work in testing this in an untested variant.

    TheSqueak has explained how to get this working in Kubuntu. Thanks TheSqueak

    Punkphysicist reports that it works in 10.10 (Maverick). Thanks Punkphysicist.

    Lets start

    1. What do we need to make a changing background?

    You will need a Folder for your background, an XML file that tells your computer what pictures to use in what order and how long to use them for (it is below so feel free to copy and past this into a new Gedit file and sav it with a descriptive name like lotr.xml, you must put .xml after the name). You will also need at least 2 pictures (I use jpg format pictures because I know they work) preferably of a decent size so the image is crisp and clear on your screen.

    2. Create a Folder.

    Now that you have the generic XML file from this thread and have chosen the pictures you want to use we need to create a folder to put everything in.

    To do this go to Places > Home Folder and open your Home folder. When your Home folder opens go to File > Create Folder and click Create Folder. This will create a folder called "Untitled Folder" which you can call anything you want. I created my folder and called it lotr (i.e. Lord Of The Rings).

    3. Setting up the folder.

    OK, now we have our folder we need to copy everything into it. Now you can either cut and paste or copy and paste. If you cut and paste you will actually move the files from where they are now to your new folder. If you copy and paste you will still have your original files PLUS a copy in your new folder.

    4. Setting up the Generic XML file.

    So far we have all the things we need and have them placed in their own folder but nothing will happen until we tell the Computer what to do with it. This is when we start doing this.

    Open the Generic XML file with Gedit so we can modify it to suit our purpose.

    The generic XML looks like this

    Code:
    <background>
    −
    <starttime>
    <year>2009</year>
    <month>08</month>
    <day>04</day>
    <hour>00</hour>
    <minute>00</minute>
    <second>00</second>
    </starttime>
    <!-- This animation will start at midnight. -->
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/yourfoldername/yourpicturename1.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/yourfoldername/yourpicturename1.jpg</from>
    <to>/usr/share/backgrounds/yourfoldername/yourpicturename2.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/yourfoldername/yourpicturename2.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/yourfoldername/yourpicturename2.jpg</from>
    <to>/usr/share/backgrounds/yourfoldername/yourpicturename3.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/yourfoldername/yourpicturename3.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/yourfoldername/yourpicturename3.jpg</from>
    <to>/usr/share/backgrounds/yourfoldername/yourpicturename4.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/yourfoldername/yourpicturename4.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/yourfoldername/yourpicturename4.jpg</from>
    <to>/usr/share/backgrounds/yourfoldername/yourpicturename5.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/yourfoldername/yourpicturename5.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/yourfoldername/yourpicturename5.jpg</from>
    <to>/usr/share/backgrounds/yourfoldername/yourpicturename6.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/yourfoldername/yourpicturename6.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/yourfoldername/yourpicturename6.jpg</from>
    <to>/usr/share/backgrounds/yourfoldername/yourpicturename1.jpg</to>
    </transition>
    </background>
    Note: I have highlighted "yourfoldername" in Red and "yourpicturename1" in YellowGreen with each successive "yourpicturename(2-3-4-5-6)" in different colour for each number. There is an easy way in Gedit to change bulk entries to something else. So while you have it open in Gedit go to Search > Replace and click Replace, when the dialogue box comes up type in "yourfoldername" without the quotes in the Search for: entry box and then type the name of your own folder (in my case it was "lotr") in the Replace with: dialogue box. Now click "Replace All" and every instance of "yourfoldername" will be changed with the name of your folder (e.g. "lotr").

    Now the next bit isn't as easy, sorry . You will have to manually change each "yourpicturename" to the name of your chosen pictures. Why? did I hear you ask? Well basically because you will only have 3 entries with each name. Please take a look at my own "lotr.xml" to see what I mean.

    Edit: I have made a slight change to make it a little easier with bulk changing the yourpicturename title. Instead of changing each one individually you can now use a bulk change to do 3 at a time. So in Gedit choose Search > Replace and type in yourpicturename1 and change it to the picture you want to start with, then go Search > Replace and type in yourpicturename2 and type in the name of the 2nd picture. Just keep doing this till you are finished.

    Code:
    <background>
    −
    <starttime>
    <year>2009</year>
    <month>08</month>
    <day>04</day>
    <hour>00</hour>
    <minute>00</minute>
    <second>00</second>
    </starttime>
    <!-- This animation will start at midnight. -->
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/lotr/Aragorn_1024x768.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/lotr/Aragorn_1024x768.jpg</from>
    <to>/usr/share/backgrounds/lotr/Arwen_1024x768.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/lotr/Arwen_1024x768.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/lotr/Arwen_1024x768.jpg</from>
    <to>/usr/share/backgrounds/lotr/Epic_1024x768.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/lotr/Epic_1024x768.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/lotr/Epic_1024x768.jpg</from>
    <to>/usr/share/backgrounds/lotr/Frodo_1024x768.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/lotr/Frodo_1024x768.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/lotr/Frodo_1024x768.jpg</from>
    <to>/usr/share/backgrounds/lotr/Gandalf_1024x768.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/lotr/Gandalf_1024x768.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/lotr/Gandalf_1024x768.jpg</from>
    <to>/usr/share/backgrounds/lotr/Sam_1024x768.jpg</to>
    </transition>
    −
    <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/lotr/Sam_1024x768.jpg</file>
    </static>
    −
    <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/lotr/Sam_1024x768.jpg</from>
    <to>/usr/share/backgrounds/lotr/Aragorn_1024x768.jpg</to>
    </transition>
    </background>
    Please make sure you note that Aragorn is the first 2 and the the last entry. The rest are all consecutive and replace 3 "yourpicturename" entries. You must do it this way so that the background cycles through the pictures.

    EDIT:yaaarrrgg has come up with script to create the xml file.

    EDIT: bebopiiam has also developed a script to do much of the work for you.

    Now you have 3 methods to do it the Ubuntu way.

    5. What does all the code mean?

    For our purposes we only need to worry about the bits that actually deal with the pictures so in order of occurrence we have
    <static> Means the picture that is currently on the screen,
    <duration>1795.0</duration> How long will it stay for. This is in seconds so 1795.0 seconds is approximately 30 minutes. If you want a shorter "static" period just change it to the number of seconds you would like (e.g. 600 seconds is 10 minutes).
    <file>/usr/share/backgrounds/lotr/Aragorn_1024x768.jpg</file> The location and name of the picture file.
    </static> The picture currently on the screen.

    <transition> This is when the pictures change.
    <duration>5.0</duration> How long does the change take. I find it is best to leave this alone.
    <from>/usr/share/backgrounds/lotr/Aragorn_1024x768.jpg</from> The location and name of the picture that was on the screen
    <to>/usr/share/backgrounds/lotr/Arwen_1024x768.jpg</to> The location and nam of the picture that will be on the screen
    </transition> End of transition cycle.

    <static> The new picture on the screen
    <duration>1795.0</duration> How long it will be there for.
    <file>/usr/share/backgrounds/lotr/Arwen_1024x768.jpg</file> Name and location of the picture.
    </static> The picture on the screen.


    6. Finishing the setup


    Now that we have our folder, which includes the pictures and XML file, setup and we have modified the XML file to suit we need to put it in the right place so it can all work.

    My advice is to copy and paste (not cut and paste)the folder and its contents to /usr/share/backgrounds. To do this we need to open a terminal so go to Applications > Accessories > Terminal and copy and paste this in.

    Code:
    sudo cp /home/YOURUSERNAME/PathToYourFolder /usr/share/backgrounds
    changing YOURUSERNAME to your actual user name and PathToYourFolder to the actual folder name you gave when we first started. Tap enter, type in your password, and if everything goes well it should copy your folder over for you.

    Now go to System > Preferences > Appearance and click appearance. When the Appearance Preferences dialogue box open click on the "Background" tab. Now we are in the "Background" tab look at the bottom and click on "Add". This will open another dialogue box. Navigate to the folder you have setup and you should see the picture files listed. If you don't see the XML file listed you will need to go to the bottom of the dialogue box and where it has "Images" and a drop down arrow change that to "All Files". You should now be able to select your XML file. Once you have done that you can select your new background image selection in the System > Preferences > Appearance dialogue.

    Test it out and let us know how you go.

    If you have any hints or suggestions regarding this format please feel free to make them and I will adjust this post accordingly.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	CreateFolder.png 
Views:	243 
Size:	175.6 KB 
ID:	156270   Click image for larger version. 

Name:	lotr1.png 
Views:	204 
Size:	178.2 KB 
ID:	156271   Click image for larger version. 

Name:	UntitledFolder.png 
Views:	185 
Size:	179.2 KB 
ID:	156272   Click image for larger version. 

Name:	Gedit1.png 
Views:	200 
Size:	163.0 KB 
ID:	156273  
    Last edited by k3lt01; March 17th, 2011 at 09:09 AM.
    Ubuntu User 23142 | Wiki | Laptop | HowTo:Create a background slideshow and Screensaver | Reconditioning pre-loved PCs and installing Ubuntu to give away to good homes.

  2. #2
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: HowTo: Create a background slideshow.

    T&T that is
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |
    [SIGPIC][/SIGPIC]

  3. #3
    Join Date
    Oct 2007
    Location
    Australia
    Beans
    1,715
    Distro
    Ubuntu Development Release

    Re: HowTo: Create a background slideshow.

    Quote Originally Posted by bapoumba View Post
    T&T that is
    Lol.

    I have attached lotr. Note the pictures used are freely available, legal as well, from the original owners. I will add more as I make more, please feel free to share yours if they are suitable for a "family" audience.
    Attached Files Attached Files
    Ubuntu User 23142 | Wiki | Laptop | HowTo:Create a background slideshow and Screensaver | Reconditioning pre-loved PCs and installing Ubuntu to give away to good homes.

  4. #4
    Join Date
    Apr 2009
    Beans
    865

    Re: HowTo: Create a background slideshow.

    I don't have time to try it for myself right but I will be doing in the next few days.
    Just wanted to say that this is one of the clearest and easiest to follow howto's I have ever seen.

    Step by step and everything explained very well (even exactly what each line of the xml means).

    Nice

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: HowTo: Create a background slideshow.

    That's a whole lotta script you got there;
    This is the script I'm using for changing the background.



    f.e I have a map called bcground located on my Desktop.
    as you can see in the script.

    Save the script as any .sh you like to name it.
    Do a chmod a+x on the file, and run it with ./whateveryounamedthescript
    .Or add it to startup applications,.if you want it to be started at boot.

    changing the sleep interval number at the bottom of the script will determine how long a background-picture is displayed

    note; I am not fully the creator of this script, a friend of mine just wanted to have a changing background, we downloaded multiple scripts, adjusted and mangled some code from other scripts we've found on the internet.


    Code:
    #!/bin/bash
    until [ 1 -eq 2 ]; do
    
    # Script to randomly set Background from files in a directory
    
    # Directory Containing Pictures
    DIR="/home/mhgsys/Desktop/bcground/"
    
    # Command to Select a random jpg file from directory
    # Delete the *.jpg to select any file but it may return a folder
    PIC=$(ls $DIR/*.jpg | shuf -n1)
    
    # Command to set Background Image
    gconftool -t string -s /desktop/gnome/background/picture_filename $PIC
    
    sleep 8s
    done
    When your thread it solved: go to thread tools > Mark this thread as solved
    for SIS 771/671 use xcompmgr to have transparent terminals. just load it at startup.

    And then they asked: what's a pbkac error?

  6. #6
    Join Date
    Oct 2005
    Beans
    87
    Distro
    Kubuntu 13.04 Raring Ringtail

    Re: HowTo: Create a background slideshow.

    Quote Originally Posted by k3lt01 View Post
    N.b. I do not know if this will work in Kubuntu, Xubuntu, or any othr variant other than Ubuntu.
    For reference, the way to do this in Kubuntu is

    • Right Click on the Desktop
    • Select "Desktop Activity Settings"
    • Change the "Type" dropdown to read "Slideshow"
    • Select the Image folders you want to scan, and the time delay you want
    • That's it

  7. #7
    Join Date
    Oct 2007
    Location
    Australia
    Beans
    1,715
    Distro
    Ubuntu Development Release

    Re: HowTo: Create a background slideshow.

    Quote Originally Posted by mhgsys View Post
    That's a whole lotta script you got there;
    I used and modified it to suit as it is the native script already used for Cosmos. I appreciate people trying different things and your script suits you (thanks for sharing btw )but I like being able to work with native material first before I go further as I often find the native material is better suited to my purposes.
    Ubuntu User 23142 | Wiki | Laptop | HowTo:Create a background slideshow and Screensaver | Reconditioning pre-loved PCs and installing Ubuntu to give away to good homes.

  8. #8
    Join Date
    Dec 2008
    Location
    Outer Shpongolia
    Beans
    Hidden!

    Re: HowTo: Create a background slideshow.

    a program could be easily made to make the xml files with a gui so users could just select the files and set the time and dynamically create the xml . Im currently doing exams at the minute but I could have a stab at it in java or something when im finished them
    What arrests my attention...
    is the fact, that this space is inhabited.

  9. #9
    Join Date
    Oct 2007
    Location
    Australia
    Beans
    1,715
    Distro
    Ubuntu Development Release

    Re: HowTo: Create a background slideshow.

    Quote Originally Posted by Shpongle View Post
    a program could be easily made to make the xml files with a gui so users could just select the files and set the time and dynamically create the xml . Im currently doing exams at the minute but I could have a stab at it in java or something when im finished them
    Or you could just save yourself the time and download 1 of the handful that are already available. You have, unfortunately, missed the point. If you want a GUI download 1 if you want to use a script off the net download 1, if you want to us the native setup and modify it for yourself and understand what the code means then feel free to use this. It is about choice after all.

    btw, why are you posting in Ubuntu forums when you are "currently doing exams at the minute"?
    Last edited by k3lt01; May 12th, 2010 at 08:49 PM.
    Ubuntu User 23142 | Wiki | Laptop | HowTo:Create a background slideshow and Screensaver | Reconditioning pre-loved PCs and installing Ubuntu to give away to good homes.

  10. #10
    Join Date
    Feb 2008
    Location
    Exeter, UK
    Beans
    108

    Re: HowTo: Create a background slideshow.

    Desktop Drapes is still around for this sort of thing. No longer under development, but it's still around, and available in the repos.

Page 1 of 5 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •