Friday, January 01, 2010

Create wallpaper slideshow in Ubuntu 9.10

First of all, happy new year! Nothing like the morning of a new year to be messing around with Linux and Python!

One of the new things in Ubuntu 9.10 is that you can now use a wallpaper slideshow for your desktop, which will cycle your desktop wallpaper at regular intervals from a selected pool of wallpapers. The default Ubuntu 9.10 comes with a space-themed wallpaper slideshow, but there is apparently no option to create your own ones. However, the configuration is stored in plaintext XML files, one in /usr/share/gnome-background-properties and the other in the corresponding directory where the images are stored, in /usr/share/backgrounds.

The following Python script will automatically create these two XML files so that you can set a wallpaper slideshow with the images of your preferences.

Slideshow Builder script
(Right-click and select "Save Link As..", or the equivalent in your browser).

Here's the instructions. You will need root access since the directory where you're doing the operations, /usr/share/, is owned by root. Simply use sudo (or sudo -i if you're lazy).

1) Create a directory in /usr/share/backgrounds with the name of your slideshow. For instance, if the desired name is 'space', the dir should be called '/usr/share/backgrounds/space/'.

2) Copy all the wallpaper images to that folder. The supported formats are jpg, png, gif and bmp.

3) Run the Python script in the images directory. This will automatically create two xml files: one in the (current) images directory, and another one in /usr/share/gnome-background-properties.

4) That's all! You can now select the slideshow in the Gnome wallpaper selection interface.

A sample usage of the script is shown in the following image:


And the slideshow now appears in the desktop Background selection screen:


Update: I've fixed the dead link to the script.

69 comments:

Luis Sanchez said...

Very nice, as a matter of fact I am just playing with my new wallpaper slideshow ;)

Santa said...

Great Script!!!!

Thank you very much...

If you let me, I can translate the post into Catalan and post it in my blog so my friends and Catalan community have access to it...

Of course I'd say it not mine the script and I'll post your blog as the original post...

Do you let me?

Thank you very much!

Luis Sanchez said...

As far as I concern, go ahead and translate it. I dont think Claudio will have any objection with it :)

zami said...

Wonderful, thank you for sharing your efforts!

mnthomp said...

Great work on the script! Yours is definitely the cleanest and most straight forward approach to creating wallpaper slidshows that I have found. Thanks!

Ghost|BTFH said...

Just an FYI: All that work is not necessary. You can create an xml file and keep it in a local directory (only 1 xml file is necessary) and you can have rotating wallpaper from it.

The format is the same as the cosmos.xml



2010
01
01
00
00
00



300.0
/home/yourlogin/location_of_image/image.png


5.0
/home/yourlogin/location_of_image/image.png
/home/yourlogin/location_of_image/image.png


300.0
/home/yourlogin/location_of_image/image.png


5.0
/home/yourlogin/location_of_image/image.png
/home/yourlogin/location_of_image/image.png



is how long to display the image (in seconds)


is how long it takes for one image to replace another.

Just remember to set a transition back to the first file so it'll keep rotating forever.

Cheers,
Ghost|BTFH

Ghost|BTFH said...

Sorry, this stupid thing wants to believe everyone naturally types in < > brackets for the sake of html.

That should show:

(background)
(starttime)
(year)2010(/year)
(month)01(/month)
(day)01(/day)
(hour)00(/hour)
(minute)00(/minute)
(second)00(/second)
(/starttime)

(static)
(duration)300.0(/duration)
(file)/home/yourlogin/location_of_image/image.png(/file)
(/static)
(transition)
(duration)5.0(/duration)
(from)/home/yourlogin/location_of_image/image.png(/from)
(to)/home/yourlogin/location_of_image/image.png(/to)
(/transition)
(/background)

(duration)300.0(/duration) is the time to display in seconds.

(transition)
(duration)5.0(/duration) shows the transition time in seconds.

Just remember to set a transition back to the first file so it'll keep rotating forever.

Just remember to replace ( ) with < >

Cheers,
Ghost|BTFH

Anonymous said...

Hi and thannks. This is an easy to follow set of instructions. Works great.

I have no programming background, so please forgive me for these questions.

1) Can I delete the .py script from my desktop after I run it?

2) How do I add more pics to the new folder?

thanks

Anonymous said...

yes

abdominoplasty surgery said...

The default Ubuntu 9.10 comes with a space-themed wallpaper slideshow, but there is apparently no option to create your own ones.

TipsOtto said...

Hi, Thanks for the great post. But SlideshowBuilder.py is not there anymore. I would love to use it. Could you please repost the script or reupload it. Thank you in advance.

Rohan Jain said...

I am unable to download SlideshowBuilder.py from the link you posted

Meithan West said...

Thanks for your feedback everybody!

I've fixed the dead link. It should work now.

I'll look into what Ghost|BTFH said. I could also improve the script to be more interactive and easy to use.

Also, I should've included a license disclaimer in the script (GPLv3 is a good choice); I'll do it on the next update. This is Free Software. Feel free to use, redistribute and modify (which includes translating) the script to your heart's extent :).

Anonymous said...

Here's a BASH script that does the same from and can be ran with any picture folders.

#!/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."

WS said...

Cortina does this and has a FS watcher, so it automatically updates when you add images. https://help.ubuntu.com/community/Cortina

Enio Marconcini said...

great script, works fine! but pay attention: I had trouble to run with image filename that had space, ro I had to use pyrenamer to change spaces to _

Anonymous said...

Is this any reason why this would create the xml file(s) but without the image files within the script? The xml created for me was simply a generic script with the introductory information, start time etc, in.

Any help much appreciated.

Thanks

Anonymous said...

Would you be focused on exchanging links?
My homepage jobs classifieds Niebla

Anonymous said...

Hello.This article was extremely interesting,
especially

because I was searching for thoughts on this subject last

couple of days.
Feel free to surf my site jobs classifieds San Fulgencio

Anonymous said...

I keep listening to the reports

talk about getting free online grant applications
so I have been looking around for

the most excellent site to get one. Could you advise me
please, where could i get

some?
Also visit my blog post : click the up coming web site

Anonymous said...

I keep listening to the reports

talk about getting free online grant applications so
I have been looking around for

the most excellent site to get one. Could you advise me please, where could i get

some?
my website - click the up coming web site

Anonymous said...

Do you have a spam issue on this blog; I also am a blogger, and I was
wanting to

know your situation; we have created some nice practices and we


are looking to trade solutions with others, please shoot
me an email if interested.
Look into my web page ; http://algecirassolar.sosblogs.com/

Anonymous said...

Hello! I know this is kind of off topic

but I was wondering which blog platform are you using for this website?
I'm getting tired of

Wordpress because I've had problems with hackers and I'm looking at alternatives for another platform. I

would be awesome if you could point me in the direction of a good platform.
My webpage : http://direct-waves.blogspot.ru/2007/02/sacher-pelz-venus-velours.html

Anonymous said...

I would like to show my respect for your generosity supporting those people

who actually need help on in this idea. Your very own commitment to getting the solution all over has been surprisingly

productive and have regularly helped many people much like me to achieve their goals.
Your own useful recommendations signifies a lot to me and much more to my office workers.

Thank you; from all of us.
Also see my page :: antsublog.blogspot.co.uk

Anonymous said...

Hello There. I found your blog using msn. This is a very
well written article. I’ll

make sure to bookmark it and come back to read more
of your useful information. Thanks for the

post. I’ll definitely comeback.
Here is my web page :: http://www.showsiteinfo.org/sites/thespainforum.com

Anonymous said...

Hi my family member! I wish to say that this article is amazing,

great written and come with approximately all important
infos. I’d

like to see more posts like this .
Also visit my blog : reoffer

Anonymous said...

Definitely, what a splendid website and informative posts,
I surely will bookmark your site.Best Regards!
Also visit my blog - socialcompact.Org

Anonymous said...

Great - I should certainly pronounce, impressed with
your web site. I had no trouble

navigating through all the tabs and related info ended
up being truly simple to do

to access. I recently found what I hoped for before you know it
at all. Reasonably unusual. Is

likely to appreciate it for those who add forums or something, web
site theme . a tones way for

your client to communicate. Nice task..
Here is my blog ... http://ladywell.blogspot.ru/2010/09/is-it-tesco-co-op-or-just-rumour.html

Anonymous said...

Can I just say what a relief to find someone who

truly is aware of what theyre talking about on the internet.
You definitely know learn how to bring a
difficulty to

mild and make it important. Extra folks need to learn this

and perceive this facet of the story. I cant consider youre no more


widespread because you definitely have the gift.
My site - eluvium

Anonymous said...

Very good blog! Do you have any hints for aspiring writers?
I'm planning to start my own website

soon but I'm a little lost on everything. Would you recommend starting with a free platform like


Wordpress or go for a paid option? There are so many choices out there that I'm completely

overwhelmed .. Any ideas? Thanks a lot!
Here is my blog post : fl.alphastudio.cz

Anonymous said...

Admiring the hard work you put into your

site and in depth information you present. It's good to come

across a blog every once in a while that isn't the same
unwanted rehashed material. Wonderful read! I've bookmarked your site and I'm adding your

RSS feeds to my Google account.
Also visit my page ... gourami

Anonymous said...

You made some decent factors there. I regarded on the web
for the issue and found most people will

associate with along with your website.
Also see my web site > http://guitarvicio.Blogspot.ru/

Anonymous said...

I carry on listening to the news update

speak about receiving boundless online grant applications so I have been looking around for

the top site to get one. Could you tell me please, where could i find

some?
Also see my website - http://www.roomieofficial.com/forum/index.php?action=profile&u=120

Anonymous said...

I have learn some good stuff here. Certainly

value bookmarking for revisiting. I wonder how a lot attempt you set to make one of these excellent informative website.
Visit my site :: quartets

Anonymous said...

You could definitely see your skills in the work you write.
The world hopes for

more passionate writers like you who aren't afraid to say how they believe. Always go after

your heart.
Also see my site :: funyo.Com

Anonymous said...

Well I truly liked studying it. This information offered by you is very useful for
proper planning.
Also visit my webpage :: transinoise.blogspot.fr

Anonymous said...

It is appropriate time to make a few plans for the
longer term

and it is time to be happy. I've learn this post and if I may I want to counsel you few fascinating issues or suggestions. Maybe you could write next articles

referring to this article. I wish to read more things approximately it!
My blog post ; Click The Following Internet Site

Anonymous said...

It is actually a great and helpful piece of

info. I’m glad that you simply shared this useful

information with us. Please stay us informed
like this. Thank you for sharing.
Also visit my website ; http://www.airgunsinspain.com/

Anonymous said...

Hello, i read your blog occasionally and i own a similar one and i was just

wondering if you get a lot of spam remarks? If so how do you stop it, any plugin
or anything you can suggest? I get so much lately it's driving me

insane so any assistance is very much appreciated.
my page: http://liens.mediaslibres.lautre.net

Anonymous said...

I’ve learn a few good stuff here. Definitely price bookmarking for revisiting.
I wonder how so much attempt you

place to make such a great informative site.
Also visit my web page wiki.mulheresnatecnologia.org

Anonymous said...

Just wish to say your article is as astonishing.
The

clearness in your post is just great and i can assume you

are an expert on this subject. Well with your permission let me to grab your feed to keep


up to date with forthcoming post. Thanks a million and please carry on the
enjoyable work.
Here is my blog ; listadeverboseningles.com

Anonymous said...

We're a group of volunteers and opening a brand new scheme in our community.

Your website provided us with helpful information to work

on. You have performed a formidable activity and our whole

community shall be grateful to

you.
Feel free to surf my blog post http://mascultura.pe/

Anonymous said...

Hi there, I found your site by way of Google

at the same time as searching for a similar matter, your
site came up, it appears to be like

great. I've bookmarked it in my google bookmarks.
Also visit my blog post - http://wiki.tycoononline.nu

Anonymous said...

Definitely believe that which you said. Your favorite reason appeared


to be on the net the simplest thing to be aware of.
I say to you, I definitely get annoyed while people consider worries that they
just do not know

about. You managed to hit the nail upon the top as well as defined out
the whole thing without having side

effect , people can take a signal. Will
probably be back to get more. Thanks
Feel free to visit my webpage happy2be.eztcp.com

Anonymous said...

Excellent site. A lot of helpful info here. I'm sending it to several friends ans also sharing in delicious. And of course, thank you to your sweat!

Here is my web blog ... Rosemary Gidget

Anonymous said...

certainly like your web-site but you need to check the spelling
on several of your posts. A number of them are rife
with spelling problems and I find it very bothersome to tell the truth
however I will surely come back again.

Here is my website: Etsuko Jolene

Anonymous said...

Do you have a spam issue on this blog; I also am
a blogger, and I was wanting to

know your situation; many of us have developed some nice
methods and we

are looking to trade solutions with others, please shoot me an e-mail if
interested.

my web-site: http://er-jay.blogspot.com

Anonymous said...

Hmm is anyone else encountering problems with the pictures on this blog loading?
I'm trying

to determine if its a problem on my end or if it's the blog.
Any responses would be greatly appreciated.
Check out my blog ; org.uk

Anonymous said...

My programmer is trying to persuade me to move to
.net from PHP. I have always disliked the

idea because of the expenses. But he's tryiong none the less. I've been using WordPress on various websites for about a year and am anxious about


switching to another platform. I have heard very good
things about blogengine.net. Is

there a way I can transfer all my wordpress content into it?
Any kind of help would be

greatly appreciated!
Feel free to visit my homepage ; altervista.org

Anonymous said...

You made some good points there. I did a search on
the issue and found most people will approve with

your blog.
Take a look at my blog : entenduabordeaux.hautetfort.com

Anonymous said...

Nice post. I learn something new and challenging on websites I stumbleupon every day.
It's always helpful to read content from other authors and use a little something from other sites.

Here is my web site ... vitamine a

Anonymous said...

What's up i am kavin, its my first time to commenting anyplace, when i read this paragraph i thought i could also make comment due to this sensible piece of writing.

Also visit my page :: florida villas

Anonymous said...

When I initially commented I clicked the "Notify me when new comments are added"
checkbox and now each time a

comment is added I get four emails with the same comment.
Is there any way you can remove me from that service?

Thanks!
Feel free to surf my web-site :: http://ceg-kurukshetra.blogspot.ru

Anonymous said...

Hello, I do think your web site could be having web browser compatibility problems.
Whenever I take a look at your website in Safari, it looks fine however when
opening in IE, it's got some overlapping issues. I simply wanted to give you a quick heads up! Besides that, excellent website!

Feel free to surf to my web-site: cruise vacation

Anonymous said...

I am sure this post has touched all the internet visitors, its really really good paragraph
on building up new blog.

my homepage; resorts caribbean area

Anonymous said...

hello there and thanks for your info - I’ve

definitely picked up something new from proper here.
I did however expertise several technical points the use of

this web site, as I skilled to reload the web site lots

of instances previous to I may get it to load properly. I

have been thinking about if your web hosting is OK? No longer
that I am complaining, but sluggish loading circumstances occasions will often impact your
placement in google and could damage your high quality ranking if advertising and ***********
Feel free to visit my blog post ; http://www.seolinkads.com/travel/leon-roe-|-activity-streams-|-followup-team

Anonymous said...

I have to express my appreciation to the writer just for rescuing me from this

dilemma. Right after

looking out throughout the the net and meeting

techniques which were not powerful, I figured my entire life was

gone. Existing without the

strategies to the problems you have

resolved as a result of your entire write-up is
a critical case, as well as those that would have in a negative way

affected my entire career if I hadn't discovered the blog. That natural talent and kindness in controlling the whole thing was important. I'm not sure what I

would have done if I had not come across such a step like this.
I'm able to at this point look forward to my future. Thanks for your time so

much for the expert and

result oriented guide. I won't

think twice to refer the blog to any person who needs to have tips

about this subject matter.

Feel free to visit my blog post ... www.imaginalmission.net

Anonymous said...

excellent post, very informative. I

ponder why the other experts of this sector do not understand this.



You should continue your writing. I'm sure, you have a great readers'


base already!

my web-site - http://Citrusconnect.com/

Anonymous said...

Hey there would you mind letting me know which webhost you're

using? I've loaded your blog in 3 completely different web

browsers and I must say this blog loads a lot faster then
most. Can you recommend a good

web hosting provider at a fair price? Thanks, I appreciate it!


Also visit my site www.walmat.altervista.org

Anonymous said...

Lovely website! I am loving it!! Will come back again. I am bookmarking your feeds also.


Check out my blog post: piemitalia.altervista.org

Anonymous said...

I was suggested this website through my cousin.


I am not positive whether or not this post is

written through him as nobody else recognize

such particular

approximately my difficulty. You're amazing! Thank you!

Also visit my homepage ... businessmodelsbeyondprofit.com

Anonymous said...

I like the valuable information you provide in your articles.
I’ll bookmark your blog

and check again here regularly. I am quite certain I’ll learn many new stuff right here!
Good luck for the next!

Visit my webpage - www.adfty.net

Anonymous said...

Great blog! I am loving it!! Will come back again.

I am bookmarking your feeds also.

My homepage :: currentaccounts.newamerica.net

Anonymous said...

Hiya, I am really glad I've found this information. Nowadays bloggers publish just

about gossips and web and this is actually frustrating. A good blog with interesting content, that's what I need.
Thank you for

keeping this website, I will be visiting it.
Do you do newsletters? Can not

find it.

Review my homepage ... http://www.public-bookmark.com/tag/fdr

Anonymous said...

Hi! This is my first comment here so I just

wanted to give a quick shout out and tell you I really enjoy reading through your posts.
Can you suggest any other blogs/websites/forums that go over the same

topics? Thank you so much!

Here is my weblog healthmassagechairs.org

Anonymous said...

There is a lot surprise this specific simply just released sorts are listed below:
uggs estimates boots or shoes mayfair " booties " girls java Highkoo Microsof corporation 5450
fight-style exceptional. Buy cheap UGG boots visit: When you
are looking for purchasing these boots, world-wide-web retailers offer these with lower prices compared to those from local sellers.
And reproductions may well appearance just as terrific.



my web blog - コーチ アウトレット

Anonymous said...

There is much surprise this particular simply just released sorts are listed below: uggs estimates shoes
and boots mayfair boot styles girls java Highkoo Microsof corporation 5450 fight-style exceptional.

There are a number of types for babies, but the very
top from the favorites list include:. As an effect
of peculiarity for the physical appearance of boots, a lot of people won't want to put on them ahead of time of.

My web blog: http://hcscenter.mgcc.tw/?q=node/34740

Anonymous said...

Zonele muntoase din acest parc sunt împădurite cu summit-ul de pe Muntele
Meru în creștere de mai sus pădurile pentru a domina în parc .

Dacă selectați un partener , acesta va fi de la un loc de putere ,
mai degrabă decât au nevoie .

my web page :: Rich (boardsync.com)

Anonymous said...

e cigarette forum, best e cigarette, electronic cigarette, e cigarette, best electronic cigarette, electronic cigarette reviews