Wednesday, July 10, 2013

Display the Moon current phase as wallpaper

I have this working on my second display in xfce4

Place this in your ~/.xinitrc file

########################################################################
##  Start xfce Desktop Environment                                    ##
########################################################################
while true; do xplanet -body moon -geometry 1024x768 -background /home/username/.xplanet/stars/stars_custom.png -glare 0.001 -output /home/username/Wallpaper/moon.xplanet.jpg -num_times 1 && /usr/bin/xfdesktop --reload; sleep 45m; done &

After you paste that, go into your xfce settings manager and tell xfce to use the jpg as a wallpaper (if it does not exist yet, run that command once in a terminal session so it can generate the file.

Note... Set the geometry to your monitor's value.  The background file will not exist on your computer, if you want a background I suggest googling around a bit to find a background image you like (you do not need a background if you prefer no background image then you can remove that section of the code).  Then edit that image so it is exactly the geometry of your display.  The -glare 0.001 option kills the glare render during new moon and full moon.  Trust me, you will want this unless you like seeing a very bright yellow glare for a few hours during full and new moon cycles.

For the moon body to work in xplanet, you will first need to download a moon map.  Xplanet does not ship with moon maps... I have no idea why, it comes with almost every other planet and Sattlite in our solar system.  Google around for the xplanet moon map.  (if anyone finds a Deathstar map please let me know.  I actually want one of the second incomplete deathstar).

(The above command is a single line command, copy paste on this blog may have added some hard returns).
**MAKE SURE YOU REPLACE 'username' WITH YOUR ACTUAL USERNAME**