Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create an auto-updating desktop image' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create an auto-updating desktop image
Authored by: merlyn on Jul 14, '03 12:11:30PM
This is really an example where Perl is overkill. Just a shell script would have been fine:

#!/bin/sh
while
   curl -O ~/Desktop/Weather/latest.gif http://weather.noaa.gov/radar/images/DS.p19r0/SI.klwx/latest.gif
do
  sleep 300
done


[ Reply to This | # ]
Create an auto-updating desktop image
Authored by: bluehz on Jul 14, '03 12:43:27PM
Why even bother with the sleep. Just create a simple shell script
#!/bin/sh
# Filename: weather-desktop

cd ~/Documents/desktop-pict/
curl http://www.srh.noaa.gov/radar/images/DS.p19r0/SI.ktbw/latest.gif > radar.gif
and set it up as a crontab task...
*/5 * * * * ~/bin/weather-desktop
and if you want to get fancy and have ImageMagick installed you can do all sorts of manipulation before displaying the desktop. A simple example.... the size of downloaded image is way to big for me and sits smack in the center of the desktop... I would like the image reduced and down in teh lower left corner instead....hmmm
#!/bin/sh
# Filename: weather-desktop

# original desktop pict or solid color the same size as desktop
origd=~/Documents/desktop.pict   # change this....
wdir=~/Documents/desktop-pict/   # and this.... location of your download images

# change into working dir where you download images, and point
# Desktop Pref pane too
cd $wdir

# download the image as usual
curl http://www.srh.noaa.gov/radar/images/DS.p19r0/SI.ktbw/latest.gif > radar.gif

# combine the original desktop (in this case mine is a solid blue)
# with the newly downloaded radar image, scaling to a width of
# 300px and locating at position 31px from left and 550px from top
composite -compose over -geometry 300x+31+550 radar.gif $origd latest.gif


[ Reply to This | # ]