Random Wallpaper in Gnome December 1, 2005
Posted by Carthik in guides, ubuntu.trackback
I am a wallpaper/background packrat with over a Gigabyte of wallpapers. Now the problem was that there is no in-built mode in Gnome to use a random wallpaper from among the wallpapers in a directory. In looking around, though, I found a few scripts and tools that make this very easy. These tools help you to “rotate” a set of backgrounds, displaying one of many wallpapers at random on your desktop. You can set these to change the wallpaper at various times, or at log-on time.
Here is a summary of the tools and scripts for other folks looking for a random gnome background changer:
Change Wallpaper from Gnome Hacks : This one can use a random image from a folder you specify or download random wallpapers on the fly from the art.gnome.org website and use that, or specify a folder full of images. You can add the script to be run at session startup.
Davyd’s Python Script : Short and sweet python script – picks images from a folder/directory. Needs cronjob.
Richi’s adaptation that uses the .gnome2/backgrounds.xml file: An adaptation of Davyd’s script that changes the wallpaper by editing the .gnome2/backgrounds.xml file. Different strokes for different folks!
Tomasz’ Random Wallpaper Changer: Choice is great! One more variation on the theme.
Gnome Background Changer: It uses the picture list defined in “Change Desktop Background / Desktop Background Preferences” dialog (in ~/.gnome2/backgrounds.xml) or you can specify a directory with pictures in it. You can define how long a picture will be shown before the background is changed. This script is made to run in the background indefinitely (until you log out), so it should be put into the background when started from the shell (gbchange &) or better be started from GNOME’s session management.
You can also use $sudo apt-get install wallpaper-tray to install a wallpaper changer from the command line. This will install wallpaper tray, but be warned it does not work too well with Edgy.
If you need the background changed each time you start a new session (that is, log on, for us non-geek folks), then use a script from above, and add it, after you have edited it to add the right directory etc, and ensuring it works to “System->Preferences->Sessions->Startup Programs”, and you’re all set.
I should think the gnome folks should include a tool to use a random background by default. Maybe it is just that none of the gnome desktop maintainers have are addicted to colorful backgrounds yet 😉
I seem to remember another- it puts a thumbnail of a wallpaper in your panel, and changes the background at some interval – it was called gdswitcher… something like that. Ring any bells?
nevermind, I found it:
http://planetearthworm.com/projects/wp_tray/
Chris, that sounds like a wonderful idea, and very useful tool, but it does not work on Ubuntu. I tried installing from source, and using alien to convert the rpm. Looks like some libboost_filesystem.so file cannot be find, which is causing all the problems.
It would be great if there was a ubuntu .deb for that tool.
How odd, I could swear that’s the one I installed on Mom’s computer. I’ll look again and get back to you.
I does work in Ubuntu, but you need an older version. I think I found a .deb for it somewhere, probably from Debian, or installed the Debian package from the page, or something like that.
However, now I’m trying to compile it on Fedora 4, with no success. Might just have to go for a script instead.
[…] ?о однажды на изве?тном блоге ubuntu.wordpress.com наткнул?? на по?т про ?мену обоев, и решил таки ут?нуть ?ебе один понравивший?? ?криптик. Тот, который оперирует только над обо?ми, выбранными в gnome’ов?кой обойной панельке. […]
Here is another version… I don’t have all my pics in a single dir… so this takes the tree of files and pick a random one for the wall paper…
I put this in a file which is executed by .bash_profile so eveytime I open a new shell I get a new background…
Peter
#
# Created by Peter A. Murray
# pick a random jpg for the desktop background.
#
# choose input tree
#
export BACKGROUND_DIR=~/Desktop/bild/2005
#export BACKGROUND_DIR=~/Desktop/bild/2006/Winter-Jan
# build up the array
array1=( `find “$BACKGROUND_DIR” -name \*.jpg | tr ‘\n’ ‘ ‘`)
element_count=${#array1[*]}
arrayPos=$RANDOM
# get a random number less than length of array
let “arrayPos %= $element_count”
picToUse=${array1[$arrayPos]}
# set the background image
/opt/gnome/bin/gconftool-2 -t str -s /desktop/gnome/background/picture_filename “$picToUse”
My prefered and shortest option is:
1) install randomize-lines
2) add the two line in a script
gconftool-2 -t str –set /desktop/gnome/background/picture_filename “`find /home/thierry/MesDocuments/Mes\ images/Photos -name \*.jpg | rl -c 1`”
gconftool-2 -t str –set /desktop/gnome/background/picture_options “scaled”
3) launch the script via Gnome Session properties (once at each boot), or launch the script via crontab.
You can use apt-get to install wallpaper-tray
Personally I could use pointers on how to install / cron
Otherwinse, excellent
wallpaper-tray in ubuntu is glade-broked, at the moment. use gconf-editor to update the xml file and you’re golden.
this is a great tutorial/script for changing wallpapers:
http://ubuntuguide.org/wiki/Ubuntu:Edgy/TipsAndTricks#How_to_set_up_.28automatic.29_background.2Fwallpaper-changer_application_for_GNOME
recursive folders, options for zooming/filling/tiling/exclusion. good stuff
“Change Wallpaper from Gnome Hacks” is the same link as “Linux Desktop Hacks changer”!!
Peter, thanks for catching that – I fixed it – I suspect it was two different things, but I messed up copying the URL – in any case, there is only one now.
Is there a shell script that would display random desktop backgrounds with a “fade” transition between them, similar to the one that comes with OS X?
Thanks!
Hey thanks!
Out of the ones you listed, I found Richi’s script to be the best for me.
http://richip.dhs.org/change-background.py
I downloaded a Python script long time ago and modified it to make it a bit cleaner and more useful (sorry, original copyright text lost). It can now also show digital camera raw files by creating a ppm on the fly using dcraw in /tmp. NEF’s only for now, but should be really easy to change …
Don’t know anything about Python, so might not be really optimized 🙂
#!/usr/bin/python
#
# wallpaper.py
#
# A script to change your gnome wallpaper to a random background image
#
import gconf
import os
import sys
import random
import mimetypes
import time
sys.path.append(os.environ[“HOME”])
sys.path.append(os.path.join(os.environ[“HOME”],’.wallpaperchanger’))
configdir=os.path.join(os.environ[“HOME”],’.wallpaperchanger’)
# Build a list of all picture files
imageitems=[]
for rootdir,dirlist,filelist in os.walk(sys.argv[1]): # recursive scan for filenames
for file in filelist:
# Check for NEF first
if (file.endswith(‘.nef’) or file.endswith(‘.NEF’)):
imageitems.append(os.path.join(rootdir,file))
else:
mimetype=mimetypes.guess_type(file)[0]
if mimetype and mimetype.split(‘/’)[0]==”image”:
imageitems.append(os.path.join(rootdir,file))
if len(imageitems)”+tempfile)
client.set_background(tempfile)
else:
client.set_background(file)
gconftool-2 -t string -s /desktop/gnome/background/picture_filename $(find /home/knarf/wp -iregex ‘.+\.\(jpe?g\|bmp\|png\|gif\)’ | perl -e ‘@a=;print $a[rand @a];’)
Just replace “/home/knarf/wp” with your wallpaper folder.
After trying all of these approaches, I found “Desktop Drapes” which is installable via apt-get (or the Ubuntu Applications -> Add/Remove menu); it is simple and clean, and rotates my wallpapers. Make sure to select “All available applications” in the Add/Remove dialog, and then search for “drapes” to find it.
Heres another one I just made:
http://www.abcpchelp.com/random_bg/random-background-rotation-php-script.php
stand allow script
I’m with fb webilder is a very good way to get a Webshots type background in Linux.
[…] o WT, odradzał tę aplikację, dla mnie jednak okazała się idealna. Odsyłam zresztą do tej notki – jest napisana zrozumiale i zawiera przydatne wskazówki dla tapetomaniaków. Tutaj jeszcze o […]
There is a program called drapes that will rotate the background for you. You can set the interval and the directory.
Jessi’s suggestion (drapes) was the best solution in my case, as I wanted to use the wallpapers set in the Gnome config panel… Thanks!
[…] webilder wallpaper-tray (package manger වෙතින් ලබා ගන්න) (Gnome Wallpaper මාරු කිරීමට වෙනත් විධි ) […]
Jessi you are the best! Drapes works perfectly in my case! Thank you
[…] most attuned to exactly what I wanted from a wallpaper switching program was the one called “wallpaper-tray” on Ubuntu. Other than that, it’s been a myriad of lame ducks…most programs try […]
NetPix 3.5 was programmed on Ubuntu for Ubuntu. It has much more than Webshots, and can convert Webshots. You can even customize it to look like Webshots. NetPix’s help file also provides links to other software which can convert Webshots. You can download the latest release of NetPix 3.5 at
http://xzcallaway.synthasite.com/
Desktop Drapes
How odd, I could swear that’s the one I installed on Mom’s computer. I’ll look again and get back to you.
You can use apt-get to install wallpaper-tray
Might want to have a look at Cortina, best wallpaper changer I have used so far. https://help.ubuntu.com/community/Cortina
[…] Random Wallpaper in Gnome […]
Массовая рассылка обьявлений на 8 тысяч 795 досок а так же на 43 тысячи закрытых форумов и о ваших сайтах и товарах сразу же узнают сотни тысяч клиентов.- Всего 226 рублей за рассылку. – Качественно.С гарантией..- т. 8-926-685 + 32 – 42 ICQ 568113539 почта: rutop10(собака)mail.ru jm 148
Большая подборка голых девочек на любой вкус.
Hello there! Do you use Twitter? I’d like to follow you if that would be okay. I’m definitely enjoying your blog and look forward to new updates…
I’d like to find out more? I’d want to find
out some additional information.
Wow that was unusual. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up.
Grrrr… well I’m not writing all that over again. Regardless, just wanted to say excellent blog!
you are in reality a excellent webmaster. The website loading
velocity is amazing. It seems that you are doing any unique trick.
Also, The contents are masterwork. you’ve done a wonderful task in this topic!
I always used to read post in news papers but now as I am a user of internet so from now I am using net
for content, thanks to web.
Wow, amazing weblog structure! How long have you been running a blog
for? you make running a blog glance easy. The total glance of
your web site is excellent, as well as the content!
First of all I would like to say excellent blog!
I had a quick question that I’d like to ask if you do not mind.
I was curious to find out how you center yourself
and clear your head before writing. I’ve had trouble clearing my thoughts in getting my
thoughts out there. I truly do enjoy writing however it
just seems like the first 10 to 15 minutes are generally lost just trying to figure out how to begin. Any ideas or tips?
Many thanks!
Hello, the whole thing is going fine here and ofcourse every
one is sharing information, that’s truly excellent,
keep up writing.
always i used to read smaller posts that as well clear their motive, and that is also
happening with this piece of writing which I am reading now.
Wonderful items from you, man. I have take into accout your stuff previous
to and you are just extremely magnificent.
I actually like what you’ve bought right here, really like what you’re stating and the best
way during which you are saying it. You are making it entertaining and you still care for to stay it sensible.
I can’t wait to learn much more from you. That is actually a terrific website.
These can be taken a look at and can be chosen according to an individual’s choices.
Wordpress lets you setup and host your own MLM blog. The
reputation is still wonderful which’s why I feel in time they will certainly
end up being popular.
Link exchange is nothing else except it is simply placing the
other person’s website link on your page at suitable place and other person will also do similar in support of you.
I’m not that much of a internet reader to be honest but your sites really nice,
keep it up! I’ll go ahead and bookmark your website to come back down the road.
All the best
Acer laptops are not cheap and should definitely provide far better quality for that money.
One can take help of Word repair software to recover the inaccessible data from the corrupt.
The Oval Perforated Picnic Table features a durable
thermoplastic coating for its permanent protection against
the elements.
работа в интернете без вложений и обмана на дому
Random Wallpaper in Gnome | Ubuntu Blog
I always spent my half an hour to read this blog’s articles
every day along with a mug of coffee.
Mountain Bikes On Sale At Dicks
Random Wallpaper in Gnome | Ubuntu Blog