View previous topic :: View next topic |
Author |
Message |
mridle n00b
Joined: 09 Mar 2005 Posts: 8 Location: denmark
|
Posted: Fri May 19, 2006 11:49 am Post subject: Change desktop picture in Gnome periodically |
|
|
Hi all
I have a little idea, that I would like to implement, but I'm a little unsure of what and how to do it - so I hope that you experts have a good solution...
What I would like to do is to change my desktop picture ("the background") in Gnome periodically, say every second hour or so. The background picture should be taken from this site http://www.dmi.dk/dmi/index/danmark/radar.htm. The picture I'm interested in, is the center big one. This picture does not have a static name though - it changes name with every update.
As I see it, there are two parts to this problem.
1) Get a cron job to get the picture with the everchanging url
2) Get Gnome to change the background picture.
I hope, that you're able to help me out there...
Thanks in advance for any suggestions!
/Andreas _________________ connection reset by beer |
|
Back to top |
|
|
sternklang Veteran
Joined: 10 Sep 2005 Posts: 1641 Location: Somewhere in time and space
|
Posted: Fri May 19, 2006 4:30 pm Post subject: |
|
|
Taking a quick look at the page source, the important line seems to be: Code: | <td width="448" valign="top" class="broedtekst"><p><font class="rubrik">Radar</font></p><p><img src="605191400_4533" width="444" height="333" border="0"></p><p><a href="index/danmark/radar/radar_3.htm"><img src="arrow_forrige.gif" width="21" height="21" alt="Forrige" border="0" width="21" height="21"></a></p> | The URL for the current image is "http://www.dmi.dk/dmi/605191400_4533". So you could use wget to download the page, use perl or gawk or sed to extract the image file name from the above line, then use wget to get the image file ("http://www.dmi.dk/dmi/<current filename>") and save it (with a .jpg extension).
For part 2, take a look at gconftool-2. It's a command line tool that can, among other things, change a key in gconf, which is where the Gnome settings are. I'm not at my home machine so I can't test this out, but you should be able to change the name of the desktop background to the image file you saved in step one and gconfd would change it right away.
You'll need to do a little research on the above commands to get this to work, but this approach should do it.
In fact, now that you've given me the idea I may try this out myself when I get home tonight -- though maybe with something other than Danish weather radar. |
|
Back to top |
|
|
mridle n00b
Joined: 09 Mar 2005 Posts: 8 Location: denmark
|
Posted: Mon May 22, 2006 6:06 am Post subject: |
|
|
Thanks for your help - greatly appreciated. Part of my problem is, that regular expressions and the like are not my strongest side, so extracting just the img src (which change every hour or so) is beyond my capabilities... Any help on this would be great
Great hint about gconftool - I'll look into it when I get home from work.
/Andreas _________________ connection reset by beer |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|