For anyone that uses ubuntu and wants an automated wallpaper script

Kenneth Adam Miller kennethadammiller at
Mon Jan 11 06:30:48 GMT 2010

ever wanted ubuntu to have that nice ability to change wallpapers every now
and then? I wrote a script just for that and I'm going to tell you about it
so that you can make it do exactly what you want too!
it's easy. just place a command to ubuntu start up the script to start up
the script in the background. Ubuntu's script that you can
edit that's executed every time you log in is ~/.profile
(I've tried using ~/.bash_profile and i haven't been able to get it to
execute. if you find that you can make an alternative to ~/.profile like
~/.bash_profile or something and get it to execute on start up, let me

anyway, save the script that I have included and place this in the

if [ -f <locationofscript>/ ];
<location of script>/ -t TIME -s SETTING

this will check to make sure that the file exists, and then it
will execute it in the background. you can add as many locations as you
want, make sure to quote them correctly. if you don't specify TIME it will
default to 300. TIME is the argument that tells the script how many seconds
to wait between changing wallpapers. so 300 means 5 mins of course. To
quickly check that it works use -t 1 so that it changes every second.

the -s option is for setting. it is applied in the command that sets the
current picture that it's on within the folder(s) you specified to be the
desktop background. There are 4 options:
stretched, centered, scaled, and wallpaper. to understand this, just go to
set your background using the usual themes gui and look at the bottom left.
you'll see a little drop bar with these four options. that's what they have
to do with. be sure and SPELL THE SETTING RIGHT when you enter the command
or it will fail.

Any time you need to add a wallpaper to the lineup, just drop it into one of
the directories that you specified in the ~/.profile and it will be used
next time you run the script. you will need to kill the
current running script in order to make the script load

A good option to pass it is /usr/share/backgrounds and
/usr/share/backgrounds/cosmos, which is the location of the default
backgrounds provided with ubuntu. it's really easy, i don't think you could
mess this one up. just make sure you get the quoting right; "location1" "location2" ... on and on :)

remember this about the script and where you specify your wallpapers as the
argument to it;
applied to the desktop, it looks right. so keep all of the

Let me know if you have any trouble, i will try and do what i can to help
you. :)
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/x-sh
Size: 1856 bytes
Desc: not available
Url : 

More information about the Ubuntu-us-tx mailing list