?

Log in

No account? Create an account
Linux Community's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Wednesday, August 6th, 2008

Time Event
10:37p
background script
I picked up this script on the ubuntu forums. It's a great little script that changes your background every 30 minutes using python.

I know dick and squat about python, so I'm hoping someone can help me out.

It's not really that big a deal, but it often changes way more often than every 30 minutes. Like sometimes it changes about every 5 seconds or so for a minute and then stops.

Generally this happens when I'm engaging in mouse activity, but it's not repeatable. I'll be able to get it to do it regularly by clicking the desktop icon or in a firefox window for a while and other times (like now) I get nothing. I'm running up-to-date ubuntu. Just wondering if anyone can tell me why that's happening.

It could be worse and if nobody sees it, whatever, but it would be nice to patch it if possible. Reading it, it could just be that the sleep time is not catching, but I don't really know.

the script:

#!/usr/bin/env python
import os,random,gconf,time

i = 1

# Change this to the folder where your wallpapers are stored
folder= os.path.expandvars("/home/anivair/media/backgrounds")

gconf_path= "/desktop/gnome/background/picture_filename"

while i<=1:
wallpapers= os.listdir(folder)
wallpaper= os.path.join(folder, random.choice(wallpapers))
gconf.client_get_default().set_string(gconf_path, wallpaper)
time.sleep(1800)

<< Previous Day 2008/08/06
[Calendar]
Next Day >>
About LiveJournal.com