Tuesday, February 06, 2007

How to customize xplanet-gnome

Ok, now you have xplanet-gnome set up. Here's how you can customize it by editing the script. We'll go through the script line by line and examine what all of the parts do. So, let's get to it.

#xplanet-gnome.sh shell script v0.2
#shows Earth on your Gnome desktop with current lighting conditions,i.e. day and night

These are comments about the program. It basically says you need bash shell and tells you what version and what this script does. These don't have any significance to the actual program, so we'll skip this.


This is the update interval for the script. Every 30 minutes, your desktop will be updated to the current view of the Earth. To me, this is a long time, so I decreased it to 1 minute. Just change the 30 to a 1. If you want your delay on the order of seconds or hours, just change the m to a "s" or a "h", respectively, no quotes.


These I covered in the previous guide, so I don't think I need to go over it again.

#default is no projection,i.e. render a globe
#rectangular is the flat world map. also try ancient, azimuthal, mercator,..

The geometry should be your screen resolution. It is basically how big your image will be. The next two lines should be the longitude and latitude of your location. Currently, it's centered at good ol' Los Angeles, California. As the next two lines explain, the last line is the projection. There are several different options for this. I've only tried the ones on the script, but all of the options are ancient, azimuthal, bonne, gnomonic, hemisphere, lambert, mercator, mollweide, orthographic, peters, polyconic, rectangular, and tsc. Have fun with all of these.

if [ -e "$PREFIX$OUTPUT" ]; then

I'm not too sure about these. I think they basically say, if the spare file exists, then remove it and put the recommended file on it. If anyone else has an idea what this means, please speak up.

if [ -z $PROJECTION ]; then
xplanet -num_times 1 -output "$PREFIX$OUTPUT" -geometry $GEOMETRY -longitude $LONGITUDE -latitude $LATITUDE
xplanet -num_times 1 -output "$PREFIX$OUTPUT" -geometry $GEOMETRY -longitude $LONGITUDE -latitude $LATITUDE -projection $PROJECTION

These are the lines that actually do something. The first line checks to see if you specified a projection. If you didn't, it calls xplanet without the projection parameter. Now, we're going to study the line after the else statement. The "xplanet" means it's going to run xplanet. The "-num_times" tells xplanet to only run once, and not continue on running. The "-output" tells xplanet to display to a file instead of opening a window; this file is the one you will make as your desktop. The "-geometry" gives the size of the file. Which, in this case, is your resolution which you specified above. The "-longitude" and "-latitude" are pretty self-explanatory; they tell xplanet where to center the image. Lastly is the "-projection" parameter, which tells xplanet what projection to use. These lines are the most important lines in the script.

#update Gnome backgound
gconftool -t str -s /apps/nautilus/preferences/background_filename "$PREFIX$OUTPUT"
sleep $DELAY
exec $0

The line starting with gconftool basically stores the image in memory so that GNOME knows about it (I think). The sleep line tells the script how long to wait. And the exec line tells it to start up again.


tnnd168 said...

Hello! Mozilla Firefox web browser has updated,Please visit my blog,Free download Quickly

cactaur said...

Dude, I use LINUX! My Mozilla Firefox is already updated past

Larry said...

You have no life,you were sick yesterday ,or when this was written ..the 6th of February. Nah I'm just joshin' ya. Anyways I thought I might put an honorable mention on your blog,and here it is

Aww no HTML can be accepted on blogspot comments....pity...

anyways here is the picture ,i could used img src tag


Science Thinker said...

that first guy who posted is an idiot

cactaur said...

No, I'm pretty sure he's just a spammer. But, robots are still idiots, so you're right.

Anonymous said...

Sadly, this hack seems to be necessary as nautilus is broken. There is a way to stop nautilus managing (mangling) the desktop window, but then you don't get nautilus' desktop icons.

Also, this script doesn't let you show computer games or videos on your desktop, if you were so inclined.

Rena said...

This is great info to know.