planetary eyecandy

February 11th, 2007

Eyecandy is somehow nicer when it serves some purpose aside from just looking pretty, wouldn't you say? Then it has the same kind of effect as a great car or fine architecture. "Wow, it's great. And it looks awesome." Otherwise the appearance on its own seems a bit shallow and pointless. Now for the demo, here's my newest wallpaper (click to see the fullsize hosted on deviantart):


If you've ever thought that having one particular image on your desktop gets a bit dull, then this may be something for you. xplanet generates images of the Earth at set intervals (for example every 10 minutes) that shows the Earth roughly at this point in time. In addition, what I have here is cloud cover updated every 3 hours, so it's like a weather map. xplanet is phenomenally flexible, it can render multiple bodies at the same time (for example the Earth and the moon), it renders stars, it renders all the planets in the Solar System (yes, Pluto too) and many more bodies. What I have is a pretty standard configuration. So where to pick up the goodies? First, install xplanet (it's in portage :) ). Then if you run KDE, right click on the desktop and go into the config. On the Background tab, click Advanced Options and xplanet should appear in the list there.


When you click Modify... xplanet will most likely have filled in the blanks for you, but otherwise something like this will do:


The Preview cmd isn't really important, but for Command you could use:

xplanet -config ~/.xplanet.rc -radius 60 -latitude 52 -longitude 5 --geometry %xx%y --num_times 1 --output %f.jpg && mv %f.jpg %f

This will center the view on Utrecht more or less, but you can pick your own coordinates. Since we've supplied a configuration file, we have to create one.

$ echo -e "[earth]\ncloud_map=/tmp/.xplanet/clouds_2048.jpg" > ~/.xplanet.rc

Now we want to rig up a system that will download updates of the cloud map when they are available. We've already declared that they should be written to /tmp/.xplanet/clouds_2048.jpg, so let's create that path now.

$ mkdir -p /tmp/.xplanet

We'll use Michal Pasternak's python script for this. First save the file in /usr/local/bin, make it executable, then open it and edit this line:

defaultOutputFile = "/tmp/.xplanet/clouds_2048.jpg"

And finally we're going to use our friend cron to execute the script every hour:

$ crontab -e

And add this line:

0 * * * * python /usr/local/bin/ &>/dev/null

And that's it. Now you have a totally kickass wallpaper. :cool:


  1. Tomasz Karbownicki's original entry which explains how to do this in Gnome [pl]
  2. Kamil Baćkowski's follow-up entry on using xplanet in KDE [pl]
  3. xplanet website with tons of info and hacks
:: random entries in this category ::

10 Responses to "planetary eyecandy"

  1. Betelgeuse says:

    Would probably be better to write the clouds to somewhere inside /home. Hardcoded paths in /tmp can be a security problem.

  2. Voyageur says:

    Nice, for some reason I still thought that xplanet looked like xearth! It sure looks great on my desktop, thanks for the enticing screenshot

    Btw, for WindowMaker, just add this line to ~/GNUstep/Library/WindowMaker/autostart:
    xplanet -config ~/.xplanet/cloudsrc -radius 50 -latitude 48 -longitude 2 -fork

    and it's set!

    (I use ~/.xplanet for both rc file and downloaded images)

  3. [...] also cloud cover is updated every three hours. Your desktop will serve as your own weather map! Numerodix explains how xplanet is [...]

  4. Paul says:

    I am using Ubuntu 7.10 and Gnome 2.20.1, I install packages xplanet and xplanet-images from Synaptic, but nothing happens when I type command "xplanet" in terminal.

    I am still new to linux, do I miss something? thanks a lot for help!

    $ slocate xplanet

  5. numerodix says:

    What do you mean by "nothing happens"? Running xplanet generates an image that you can then set as your wallpaper. In the simplest case:
    $ xplanet --num_times 1 --output map.jpg
    This creates a file map.jpg. In order to have the spinning effect I described this has to be run repeatedly as per the instructions in the original post. I haven't tried setting this up on Ubuntu, so your mileage may vary. And if you're running Gnome you can't really follow the KDE instructions anyway.

    Btw to get a list of all the files installed by a package:
    $ dpkg -L xplanet

  6. wilberfan says:

    What does it mean when it just shows an entirely grey (cloud-covered?) sphere? (Did I end up with Venus, or something?!)

    I'm running KDE 3.5.9 on Sidux...

  7. numerodix says:

    I don't think I've ever seen that :/

  8. newKbuntu says:

    What do you mean by "Make it executable"? I am new to linux, do i have to compile the code in the file? if so how in linux?

  9. numerodix says:

    Make it executable means changing the permissions of the file so that it can be executed. You do this like so:
    $ chmod +x file

  10. [...] also cloud cover is updated every three hours. Your desktop will serve as your own weather map! Numerodix explains how xplanet is [...]