Home page of this blog

Sunday, July 18, 2010

Setting changing wallpapers as background in Ubuntu Lucid

I have often wondered how easy it is to set a group of wallpapers in Windows 7 with a time duration. It is time I did the same in Ubuntu and know it is already there.


I know there are two software which do the task of rotating wallpapers available from synaptic. They are drapes and wally


drapes has dependency on mono (which some will not want to)
wally pulls the entire kdebase-runtime as its dependency  (which I obviously does not want)

The following method uses gnome feature to accept xml file to change/rotate images without installing any of the above packages.

Here is a small howto of what I did to change the backgrounds based on interval step by step

Step 1: Create a directory and copy your images

Step 2: Goto terminal

Step 3: Change to the directory which contains your group of images which needs to be rotated based on interval. Change following script line INTERVAL=20 to desired interval (interval value in seconds) and paste it. If you just paste it, it will create a xml file called bg.xml with 20 seconds as interval between switching to next image



INTERVAL=20; echo "<background>" > bg.xml; for i in *.jpg; do echo "<static><duration>$INTERVAL</duration><file>`pwd`/$i</file></static>" >> bg.xml; done; echo "</background>" >> bg.xml




Step 4: Goto desktop. Right click desktop and invoke Change Desktop Background
(or System --> Preferences --> Appearance --> Background)

press Add... button and change Images to All files from the combo box, then choose bg.xml which we created now






This  will rotate images in Ubuntu Lucid or any gnome environment. The below video shows a background rotation on my desktop with 4 seconds interval.

6 comments:

  1. Hi, I am the owner of the blog of photography http://photographymc.blogspot.com/

    I have added in the favorite, your blog is really beautiful and useful compliments ;-)

    I would like an exchange links with you.

    In my photography blog articles on photographic techniques, Photoshop tutorials, digital cameras and photomontage.

    Tell me what do you think.

    ReplyDelete
  2. Thanks for your compliments and blog link :)

    I will look at your blog, though I am not good in photoshop/gimp

    ReplyDelete
  3. OK, need a little help here. I have three Lucid machines, two generic builds that are 64-bit and a dell inspiron e1505 running 32-bit.

    I have saved my background images and the bg.xml to my Ubuntu One folder so that it's accessible from all three pc's. The two PC's I built are using the same bg.xml and the same images for their separate rotating wallpapers.

    Problem is it wouldn't work on the 32-bit.

    I had all the image files as both jpg and png, the latter in a separate folder. I cd'd to the PNG folder, edited the above script, replacing "*.jpg" with "*.png." Works fine on the dell, now.

    I love this.

    Ta.

    --Joseph Horgan, Jobuntu | Tech Support for Humans

    ReplyDelete
  4. I wanted to thank you for this excellent read!! I definitely enjoyed every little bit of it. I have you bookmarked your site to check out the new stuff you post. Thank you for sharing this with us! More power to you and to your site! DownloadFreeWallpapers.

    ReplyDelete
  5. Shell script to rotate along with transition


    INTERVAL=60
    echo "<background>" > bg.xml
    oldfile=""
    for cfile in *.jpg
    do
    if [ "$oldfile" != "" ]
    then
    echo "<static><duration>$INTERVAL</duration><file>`pwd`/$oldfile</file></static>" >> bg.xml
    echo "<transition><duration>5.0</duration><from>`pwd`/$oldfile</from><to>`pwd`/$cfile</to></transition>" >> bg.xml
    fi
    oldfile=$cfile
    done
    echo "</background>" >> bg.xml

    ReplyDelete