PDA

View Full Version : Better Wallpaper Switcher



dash
March 5th, 2005, 06:45 AM
After downloading so many awesome backgrounds here, I decided I needed to switch between them hourly. I found a shell script to do it on Michel's page (http://mysite.mweb.co.za/residents/clasqm/ubuntu.html) but it gave me errors occasionally and only scanned one directory, so i wrote a new one in Python. I figured someone else might find it useful, so here it is.
(To make it run hourly, run "crontab -e" and put "01 * * * * python /path/to/ranwp.py" on a new line in it, then save)

http://divmod.org/users/washort/ranwp.py

kassetra
March 5th, 2005, 06:51 AM
After downloading so many awesome backgrounds here, I decided I needed to switch between them hourly. I found a shell script to do it on Michel's page (http://mysite.mweb.co.za/residents/clasqm/ubuntu.html) but it gave me errors occasionally and only scanned one directory, so i wrote a new one in Python. I figured someone else might find it useful, so here it is.
(To make it run hourly, run "crontab -e" and put "01 * * * * python /path/to/ranwp.py" on a new line in it, then save)

http://divmod.org/users/washort/ranwp.py

Oh wow! I can't wait to try this! I have tons of great ubuntu wallpapers I want to switch between often! Thank you so much! :)

Zootropo
March 5th, 2005, 02:05 PM
After downloading so many awesome backgrounds here, I decided I needed to switch between them hourly. I found a shell script to do it on Michel's page (http://mysite.mweb.co.za/residents/clasqm/ubuntu.html) but it gave me errors occasionally and only scanned one directory, so i wrote a new one in Python. I figured someone else might find it useful, so here it is.
(To make it run hourly, run "crontab -e" and put "01 * * * * python /path/to/ranwp.py" on a new line in it, then save)

http://divmod.org/users/washort/ranwp.py
quite useful. as kassetra i have a lot of cool wallpapers and i'm unable to choose beetwen them

rickympl
June 16th, 2006, 02:21 AM
hi, is there any way to get this script to work in xfce?

Thanks in advance.

BlackTopBum
March 17th, 2007, 06:41 AM
Sweet work dash - thanks much. Is better than the other scripts found on the forums. I did have to figure out the "no gconf module" error - I put the Ubuntu server edition on board and built up X, etc. from there. All was needed to add is python-gconf and away we go! Thanks again.

davbren
March 23rd, 2007, 02:14 PM
Sorry I'm a n00b how do I use this?

BlackTopBum
March 24th, 2007, 02:05 AM
You should follow the instructions "dash" posted,
"To make it run hourly, run "crontab -e" and put "01 * * * * python /path/to/ranwp.py" on a new line in it, then save".

If there are other questions you have, and I'll guess at some here, please say so.

Here are the steps I undertook to make it work:

1) edited ranwp.py for my system. Read it to see how I changed the path:

#!/usr/bin/env python

BACKGROUND_DIRS = ['/home/cmo/Multimedia/wallpapers/']

2) made a text file I called cron.txt by doing in a terminal

touch cron.txt

vim cron.txt (use your favorite editor)

I entered this to the text file:

# change wallpaper interval
*/10 * * * * python /home/cmo/Multimedia/wallpapers/ranwp.py

and I saved it.

3) I put ranwp.py in /home/cmo/Multimedia/wallpapers/

4) Again in a terminal:

crontab cron.txt

crontab -l (to check it).

5) Found I had to add python-gconf to the system and did so. How did I discover that? I read the local system mail I set up to alert me. That mail listed the error.

6) I continue to enjoy "dash"'s work <g>.

titan3169
March 27th, 2007, 02:58 AM
Hey blacktop would you be able to pm me or msg me on aim at hawks864 and possibly help me out with this?

BlackTopBum
March 28th, 2007, 04:30 AM
titan3169, I'll do PM.

hofa
April 18th, 2008, 09:58 PM
Thanks! This helped a lot!

Dalif
February 12th, 2009, 12:49 AM
Anybody have a mirror or something for the py file? I seem to get a 404 on it.

Krydahl
February 12th, 2009, 12:59 AM
hi, is there any way to get this script to work in xfce?

Thanks in advance.

There's no real need. If you go into the settings manager -> desktop you'll see you can create lists of wallpapers for XFCE to switch between.

Once a file as has been set up, adding the command "DISPLAY=:0.0 /usr/bin/xfdesktop --reload" to your crontab as often as you want the wallpaper to change will do the trick. So, for example, the line:


*/20 * * * * DISPLAY=:0.0 /usr/bin/xfdesktop --reload >/dev/null 2>&1

will select a wallpaper at random from your list every 20 minutes.