Tuesday, August 19, 2008

Automatically Change Wallpapers

Lifehacker recently had a great article on ways to automatically rotate wallpapers including Gnome Wallchanger, Desktop Drapes, and Wallpaper Tray. As for the sunlight map mentioned in the article, I like the approach taken by areopa. The following will update the map as your wallpaper every hour:
1. First download the sunlight map here and change your background to use it as wallpaper (i.e. right click on your desktop and choose "change desktop background"). I will assume that you are downloading it to a folder called /home/user/wallpaper.
2. Then you need to write the following script:
wget -O /home/user/wallpaper/world_sunlight_map_rectangular.jpg http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg
Note: this is all on one line!
3. Next, move the script (I will assume you called it sunlight and saved it to your home directory) to cron.hourly with the following command:
sudo mv /home/user/sunlight /etc/cron.hourly

As a side note, to do this on a mac, follow the directions below:
1. Download the sunlight map from the link above and save it a folder of your liking. However, it must be the only file in that folder.
2. Set the file as your background and choose to have the wallpaper change. This should work because the file is the only one in the folder.
3. Download a program called Lingon and install it.
4. Run Lingon and add a new agent under "my agents."
5. Name it whatever you like such as "com.yourusername.sunlight"
6. In the what section, type the following command replacing "/path/to/world_sunlight_map_rectangular.jpg" to wherever you downloaded the file:
curl -o /path/to/world_sunlight_map_rectangular.jpg http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg
7. Finally, under the third section, "when," tell Lingon you want the command to run every 15 or 30 minutes.
8. Restart your computer and you should have an updating sunlight map as your wallpaper.

Sources:
Lifehacker article
World Sunlight Map
Lingon
cURL manual

No comments: