Get a Dynamic Interplanetary Background with Xplanet
This tutorial will show you how to setup a cool, dynamic wallpaper for your computer based upon XPlanet. The image to left is the final result of this how-to; notice the cloud map and the daylight, which are both periodically updated to match real-time cloud data and sunlight. You can chose to do the same thing with your background, or to customize the settings to your individual taste. This article will show you how to configure xplanet to be your desktop background in Gnome, so it will work in either Ubuntu or Fedora. With a little tweaking to this desktop modification, you should be able to get it to work under most environments and distributions.
- Installing xplanet
- Running from the command line
- Setting the background
- Getting the clouds
- Download a static cloud map
- Periodically download an updated cloud map automatically
- Setup the script to download the cloudmap automatically
- Run the script once to generate the cloudmap
- Creating the configuration
- Putting it all together – cronjob and login trigger
- Now let everyone see!
The first thing you’ll need to do is install xplanet. This can be done quickly and easily from the command line:
Ubuntu: sudo apt-get install xplanet
Fedora: sudo yum install xplanet
Xplanet has lots of options, which you can see in its man page if you run ‘man xplanet’. I did find that the manual isn’t entirely up to date, however – it doesn’t list all the map types that xplanet actually supports with the -projections flag. Nevertheless, the manual is still a good place to start if you’re looking to explore xplanet’s featureset.
You can run xplanet from the command line to get an idea of what kind of map you want to generate, how large it should be, and what options you want to use. For example, you’ll probably want to generate an image that fits your screen resolution. Use the -geometry option to specify the size you want, in pixels. You can use the -window option while you experiment, until you get the map exactly how you want it:
The above are the options that I use, but of course you should play with it until you find something you like. One thing you’ll probably want to tweak is the -projection option, which determines what kind of map you want to generate. Also check out the -latitude and -longitude options to tell xplanet where to center the map; you can set it so your location is at the center of the image, if you want. Check out the man page for all the details (there are many!). To help get you started, here are a couple of fun projections and the commands to generate them:
A zoomed-out globe with New York at its center:
You can view more than just the Earth; here’s a spectacular view of Saturn!

Once you’ve picked out the options you want to use for your background, you need to tell xplanet to save it to a file so you can select it as your wallpaper. Simply use the -output and the -num_times 1 options on the command line and xplanet will run, save the generated image to the file specified by -output, and exit. Be sure to set the -num_times 1 option, or xplanet won’t close after generating the image.
Next, you’ll want to set your wallpaper to be the saved image. Do this just like you would normally set your wallpaper; you can go to the System menu in either Ubuntu or Fedora, and under Preferences select Appearance.
Or, you can right-click on the desktop and select Change Desktop Background. Either way, click the “Add” button and add the image you saved with Xplanet. Now that will be your background.
But, there’s more to do!
One of the coolest features of xplanet is that it has the ability to overlay a “cloud map” showing the current cloud coverage on Earth. If you’ll notice in the screenshot at the beginning of this article, my desktop includes a cloud map overlay. There are two choices for setting up the cloud map:
If you don’t care about having the cloud coverage update itself periodically, you can download a single image and use it whenever xplanet renders the Earth. Simply save this file somewhere, and proceed to the next section about “Creating the configuration.” Or, for more fun…
The other option is to setup a script to periodically download an updated cloud map, so that your wallpaper matches the current cloud coverage of the planet. It’s a little tweak, but it’s definitely fun. If you decide it’s worth the effort, here’s what you need to do:
Download this script and decompress it. This script was written by Michal Pasternak and is in the public domain. It is useful because it checks if a new cloud map is available before actually downloading it, which saves a lot of bandwidth.
Once you’ve downloaded the script, make it executable by running the following command in its directory:
Next, run the script so it will download the initial cloud map:
By default, the script saves the map with a filename of clouds_2048.jpg.
Now continue to the next section, which will show you how to setup the configuration file in order to use the cloud map. Keep reading to the “putting it all together” section to create an automated cron job so the cloud map will update itself periodically.
If you’re satisfied with the image you generated previously, that’s fine; you can skip this step. But if you want to add clouds or lights, you’ll need to modify the xplanet configuration file to let it know where to find these added goodies. It’s done in a text editor, but it’s pretty simple.
The easiest way to proceed is to modify the default configuration file, by opening it in either vim or your favorite graphical text editor. On both Ubuntu and Fedora, the default configuration file is located at /usr/share/xplanet/config/default. You’ll need to be root to edit it (optionally, you can copy it to your home directory and then edit it, if you don’t want to make system-wide changes).
Inside /usr/share/xplanet/config/default, search for the line [earth], which specifies the options to use when drawing a picture of Earth. Here’s my [earth] section of the configuration file:
“Earth”
color={28, 82, 110}
cloud_map=/home/jdeprizi/bin/xplanet/clouds.jpg
night_map=/home/jdeprizi/bin/xplanet/night_xplanet1.jpg
#marker_file=earth
min_radius_for_label=0
#satellite_file=iss
While you should certainly check out what happens if you uncomment satellite_file or marker_file, the two things I want to mention are cloud_map and night_map. The cloud_map option should be set to the image you specified in the section above, “Getting the clouds.” This tells xplanet to overlay the cloud map onto the generated image, and yields a result similar to the screenshot at the beginning of this page.
When you specify the night_map option, xplanet will draw city lights in the part of the Earth where there is no sunlight, like so:
Your night map should be located in /usr/share/xplanet/images with a file name night.jpg. In the above example, I copied it into my home directory.
Now that you have your background looking just the way you want, you’ll need to configure a scheduled job to make sure that it updates the daylight and the cloudmap automatically. The easiest way to do this is by scheduling a job using cron and gnome-schedule. Use the command you came up with above, and schedule a job to run as often as you want — I generate a new image every 30 minutes. I also download the cloud map every 12 hours:
You’ll also need to have the map generate when you login, especially if your computer is off for long periods of time. If you don’t do this, the map won’t regenerate until the next cronjob kicks off, and you could be looking at a very outdated image for up to an hour. To have the wallpaper refresh when you first login, simply go to the Startup Applications item under System and then Preferences. Add a new item with the same command as you used above, to generate your background:
Now your wallpaper will automatically refresh whenever you login.
If you’ve followed through to this point, you should have a fully-functional xplanet wallpaper that will automatically refresh itself, following the interval you specified. Awesome! Show off your work by posting a screenshot to the TechThrob Facebook gallery. Also, leave a comment with the options you use to generate your background, so others can see what kind of cool tweaks you’re using!
Like this post?
- Subscribe to the RSS feed to get more like it!
- Share it:
- Leave a comment!
No related posts.









Thank you very much for this fun and informative tutorial. I like that it touches on installing, making scripts executable, configuring xplanet, and scheduling tasks. I learned more than I expected and had fun too!
it’s called “earthview” for windows. i’ve used it for years.
I can not run ./download_clouds.py How to do with it ? Thanks
./download_clouds.py: line 18: maxDownloadFrequencyHours: command not found
./download_clouds.py: line 22: maxRetries: command not found
./download_clouds.py: line 26: defaultOutputFile: command not found
./download_clouds.py: line 29: archiveDir: command not found
./download_clouds.py: line 32: mirrors: command not found
./download_clouds.py: line 33: ftp://ftp.iastate.edu/pub/xplanet/clouds_2048.jpg,: No such file or directory
./download_clouds.py: line 34: http://home.megapass.co.kr/~gitto88/cloud_data/clouds_2048.jpg,: No such file or directory
./download_clouds.py: line 35: http://home.megapass.co.kr/~holywatr/cloud_data/clouds_2048.jpg,: No such file or directory
./download_clouds.py: line 36: http://www.wizabit.eclipse.co.uk/xplanet/files/mirror/clouds_2048.jpg,: No such file or directory
./download_clouds.py: line 37: http://xplanet.explore-the-world.net/clouds_2048.jpg: No such file or directory
Those error messages are because the shell (bash) is trying to execute the script. The script is a python script so you need to make sure that python executing the script. Try adding this to your command:
python ./download_clouds.py
That should fix your problem.
Instead of using ./download_clouds.py, use python download_clouds.py