Live Earth Wallpaper on Linux

Hey all! Sorry for the long time, but I’ve been busy with college, and finals.

It’s time for a different post! This time, we’ll be setting our wallpaper as a self-updating (with cron table) “live” Earth picture, just like bellow:

Earth wallpaper picture

Earth wallpaper

To do this, we’ll be using the widely known World Sunlight Map by die.net. Kudos to them, by making this possible and free to everyone!

The first thing to do, is to make a bash script that downloads the file from die.net and then sets it as the current wallpaper (optional. Usefull if you’re having problems with it). Since we don’t want to waste die.net bandwith, we’ll only update the picture every hour. You can make it 5 minutes if you want, but the server picture is refresh hourly (or 3 in 3 hours, not sure), and you’ll be convincing them to shut the service down. 🙁

#!/bin/sh

wget http://static.die.net/earth/mercator/1600.jpg --user-agent=firefox -O /pathToFile/1600.jpg
 gsettings set org.gnome.desktop.background picture-uri file:///pathToFile/1600.jpg

So, write this on a new file (or download here) and chmod +x it. The next thing to do is to get it on the crontable:

  • Open a terminal and write ‘crontab -e
  • This will open your text editor, like nano or vi, or something like that. Just scroll to the end and paste this: ‘0 */01 * * * /pathToBashFile/update_earth‘, without the ”. Change the update_earth name, if you changed the name of the bash file.

Save the file and it’s done! What this does is run the bash file every hour. That simple. To make sure the crontable is setup correctly, just run a ‘crontab -l‘, and make sure that the line you entered is there. You can also run the bash file yourself for the first time, to make sure it does what you want. Just run ‘./update_earth‘.

Enjoy your new wallpaper weather forecast. 😉

This entry was posted in Linux and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.