Weather Wallpaper on Ubuntu

You can set up a cool desktop wallpaper in Ubuntu which updates a satellite image of the weather. I found this method in a couple of other sites, and I had to modify it a bit.

1. Save this piece of code in a file named “wallpaper.sh” in your home folder

#!/bin/bash

cd ~/.gnome2/
while true
do
COUNTER=0
while [ $COUNTER -lt 30 ]; do
wget http://images.intellicast.com/WxImages/Satellite/hiusa.gif -O world.gif
temp=$(stat -c%s world.gif)
if [ $temp > 200 ]
then rm world_sunlight_Wallpaper.gif
mv world.gif world_sunlight_Wallpaper.gif
break
fi
sleep 5
let COUNTER=COUNTER+1
done
sleep 3600
done

2. In a terminal, execute

chmod +777 wallpaper.sh

3. In the menu item “Startup Applications”, add the following

Name: wallpaper

Command: sh ~/wallpaper.sh

Comment: sweet

4. Logout and Login in Ubuntu

5. Go to home folder and view hidden folders (CTRL+H), and open .gnome2

6. Change desktop background by left clicking your desktop. Drag and drop the file “world_sunlight_Wallpaper.gif” in to your bakground.

tada!

p.s. you can modify this simple script to use images from opentopia.com or other websites.

Advertisements