Changing gnome wallpaper
September 26, 2006 3:18 AM   Subscribe

Linux / Ubuntu / Gnome question - how do I tell Gnome "Hey, the jpg you're using as desktop wallpaper has been updated with a new image. Go reload it and display the new version?" in a Python or Bash script?

I've written a little Python script that runs once a day, and downloads the NASA Astronomy Image Of The Day, and saves it to a local file. Gnome is set up to use this file as my desktop wallpaper. The problem is, while the script downloads the new image every day, Gnome never checks the file to see if it's changed, so my wallpaper remains the same unless I restart the computer, or manually change the wallpaper on the Gnome desktop.

How can I automatically tell Gnome to "reload" the wallpaper jpg?
posted by Jimbob to Computers & Internet (6 answers total) 3 users marked this as a favorite
will (the following is all one command)

gconftool-2 -t string -s /desktop/gnome/background/picture_filename image_filename

posted by blenderfish at 3:24 AM on September 26, 2006

A google search for "gnome change background script" produces number results with sample code that changes the background. The tool you want to use in your script is gconftool-2. Google is your friend.
posted by crypticgeek at 3:27 AM on September 26, 2006

Response by poster: I swear to "Bob" I googled "gnome change background" about three days ago and I got nothing but instructions on how to do it through the GUI. Nonetheless, blenderfish wins. It appears to work.
posted by Jimbob at 3:37 AM on September 26, 2006

Just as a helpful post-answer tip, you left out a key word in your google search..."script"
posted by blind.wombat at 5:28 AM on September 26, 2006

Response by poster: Aah, but even searching for "gnome change background" produces, as the first result, a page from which I am able to discern the command to use. Colour me bemused.
posted by Jimbob at 5:43 AM on September 26, 2006

Response by poster: Okay, having let the script run overnight and do it's thing, this doesn't actually work. If you tell it to set the wallpaper to the same filename as it was, it doesn't actually update the wallpaper. But I guess I can get it to set it to one filename, then another, to "refresh" it. Ugly hack.
posted by Jimbob at 3:57 PM on September 26, 2006

« Older techniques for creating new habits needed   |   mcnulty and kima fistfight in heaven Newer »
This thread is closed to new comments.