[xplanet] config files and scripts for clouds and background

This commit is contained in:
Mathieu Maret 2009-12-01 13:33:25 +01:00
parent 83458e57b9
commit 4793394df6
5 changed files with 398 additions and 0 deletions

View File

@ -5,4 +5,5 @@ pidgin &
evolution &
conky &
/usr/lib/gnome-volume-manager/gnome-volume-manager --sm-disable &
xplanet &
#nm-applet --sm-disable &

View File

@ -28,3 +28,5 @@ ln -s $NOWHERE/gmrunrc $HOME/.gmrunrc
#install GSM-openboxTheme.obt dans openbox
aptitude install network-manager-gnome
aptitude install xplanet

105
clouds.pl Normal file
View File

@ -0,0 +1,105 @@
#!/usr/bin/perli
#
# A ajouter dans /etc/crontab
# 49 2,5,8,11,14,17,20,23 * * * perl /usr/local/bin/clouds.pl
# ------------------------------------------------------------------------------------
# Program for downloading XPlanet cloud images from a random mirror
#
# Copyright (c) 2003, cueSim Ltd. http://www.cueSim.com, Bedford, UK
#
# ------------------------------------------------------------------------------------
#
# Redistribution and use, with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Neither the cueSim name nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
# SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# (2005-06) hacked by mose at nguild.org for personal use on a debian SID
# (2008-08) hacked by benhaim_jerome at yahoo.fr for personal use on a ubuntu Hardy
use LWP::Simple;
# Options:
# - ou sauvegarder l'image des nuages (par defaut le répertoire courant)
#
my $Filename = "/home/mathieu/.xplanet/images/clouds.jpg";
# - fréquences de mise à jour de l'image sur le serveur
my $MaxDownloadFrequencyHours = 2;
# - Combien d'essais, si le serveur ne répond pas
my $MaxRetries = 3;
## Note: excessive requests to a single image server is discouraged.
## This script limits max retries, does not download more frequently
## than every two hours (the file is generated every 3 hours). and
## picks a random mirror location for every download.
##
## Changer les paramètres risque de vous exclure (blacklisted)
## des serveurs d'images
if(-f $Filename) {
my @Stats = stat($Filename);
my $FileAge = (time() - $Stats[9]);
my $FileSize = $Stats[7];
if($FileAge < 60 * 60 * $MaxDownloadFrequencyHours && $FileSize > 400000) {
print "File is already up to date\n";
exit(1);
}
}
for(1..$MaxRetries) {
my $MirrorURL = GetRandomMirror();
print "Using $MirrorURL\nDownloading...\n";
my $Response = getstore($MirrorURL, $Filename);
if( IndicatesSuccess($Response)) {
print "Finished: file successfully downloaded to $Filename\n";
exit(0);
}
print "Download not available, trying another website\n\n";
}
print "ERROR: Tried to download the file $MaxRetries times, but no servers could provide the file\n";
exit(2);
sub IndicatesSuccess() {
my $Response = shift();
if($Response =~ /2\d\d/) {
return(1);
} else {
return(0);
}
}
## Liste des serveurs miroir
sub GetRandomMirror() {
my @Mirrors = (
"http://xplanet.arculeo.com/clouds_2048.jpg",
"http://xplanet.sourceforge.net/clouds/clouds_2048.jpg",
"http://www.ruwenzori.net/earth/clouds_2048.jpg",
"http://xplanet.dyndns.org/clouds/clouds_2048.jpg",
"http://userpage.fu-berlin.de/~jml/clouds_2048.jpg",
"http://userpage.fu-berlin.de/~jml/clouds_4096.jpg",
"http://php.nctu.edu.tw/~ijliao/clouds_2048.jpg",
"http://home.megapass.co.kr/~gitto88/cloud_data/clouds_2048.jpg",
"http://home.megapass.co.kr/~holywatr/cloud_data/clouds_2048.jpg",
"ftp://ftp.iastate.edu/pub/xplanet/clouds_2048.jpg",
"http://xplanet.explore-the-world.net/clouds_2048.jpg",
"ftp://mirror.pacific.net.au/xplanet/clouds_2048.jpg",
"http://www.narrabri.atnf.csiro.au/operations/NASA/clouds_2048.jpg",
);
return $Mirrors[rand scalar(@Mirrors)];
}

227
default Normal file
View File

@ -0,0 +1,227 @@
# This file contains options you might want to customize for each
# body. It's best to leave this file alone and modify a copy. Use the
# -config option to tell xplanet to read your copy.
[default] # Values in this section apply to all
# bodies unless overridden below.
arc_color=white
#arc_file=
#bump_map=
bump_scale=1
cloud_gamma=1
#cloud_map=
cloud_ssec=false # true if the cloud map is from the
# University of Wisconsin Space
# Science and Engineering Center
cloud_threshold=90
color={255,255,255} # fallback color in case an image map
# isn't found
draw_orbit=false # if true, draw this body's orbit
# about its primary
grid=false
grid1=6
grid2=15
#image=
magnify=40 # draw the body as if its radius were
# magnified by this factor
marker_color=red
#marker_file=
#marker_font=
max_radius_for_label=3 # don't draw a label if the body's
# radius in pixels is more than this
min_radius_for_label=.01 # don't draw a label if the body's
# radius in pixels is less than this
min_radius_for_markers=40 # don't draw markers if the body's
# radius in pixels is less than this
#night_map=
orbit={-.5,.5,2} # extent of orbit to draw,
# {start, end, delta}, where
# start and end are in units of period
# of revolution and delta is angular
# increment in degrees to evaluate
# position
orbit_color={255,255,255} # color for the orbit
random_origin=true # Can this body be considered if
# -origin random is used?
random_target=true # Can this body be considered if
# -target random is used?
#satellite_file=
shade=30 # 0 = black, 100 = same as dayside
#specular_map=
text_color={255,0,0} # color for text (markers & body label)
twilight=6 # blend the day and night images for
# pixels within this many degrees of
# the terminator
[sun]
"Sun"
color={255,255,166}
max_radius_for_label=0 # never draw a label for the sun
shade=100 # No night side!
[mercury]
"Mercury"
color={100, 100, 100}
min_radius_for_label=0 # always draw a label
[venus]
"Venus"
color={161, 129, 70}
min_radius_for_label=0
[earth]
"Earth"
color={28, 82, 110}
cloud_map=clouds.jpg
# I have day and night maps of Australia centered on Alice Springs,
# which are cropped from higher resolution maps.
#map=alice_springs.png
#night_map=alice_springs_night.png
#mapbounds={-1.2,98.7107,-46.2,169.023} # lat1, lon1, lat2, lon2
#marker_file=earth
min_radius_for_label=0
#satellite_file=iss
[moon]
"Moon"
color={100, 100, 100}
[mars]
"Mars"
color={172, 123, 67}
min_radius_for_label=0
[phobos]
"Phobos"
[deimos]
"Deimos"
[jupiter]
"Jupiter"
color={204, 163, 133}
min_radius_for_label=0
[io]
"Io"
color={212, 182, 52}
[europa]
"Europa"
color={140, 140, 140}
[ganymede]
"Ganymede"
color={150, 150, 150}
[callisto]
"Callisto"
color={70, 70, 70}
[saturn]
"Saturn"
color={244, 199, 134}
min_radius_for_label=0
[mimas]
"Mimas"
[enceladus]
"Enceladus"
[tethys]
"Tethys"
[dione]
"Dione"
[rhea]
"Rhea"
[titan]
"Titan"
color={252,94,7}
[hyperion]
"Hyperion"
[iapetus]
"Iapetus"
[phoebe]
"Phoebe"
[uranus]
"Uranus"
color={105, 197, 238}
min_radius_for_label=0
[miranda]
"Miranda"
[ariel]
"Ariel"
[umbriel]
"Umbriel"
[titania]
"Titania"
[oberon]
"Oberon"
[neptune]
"Neptune"
color={95, 133, 232}
min_radius_for_label=0
[triton]
"Triton"
[nereid]
"Nereid"
[pluto]
"Pluto"
color={206, 180, 153}
min_radius_for_label=0
[charon]
"Charon"

63
xplanet-bg Executable file
View File

@ -0,0 +1,63 @@
#!/bin/bash
# xplanet-gnome.sh shell script v0.2
# Montre la Terre sur le bureau Gnome avec les condition courante d'éclairage,ex: le jour et la nuit
# délai de mise à jour en minutes
DELAY=10
# Répertoire racine de xplanet
PREFIX=~/.xplanet/
# Non du fichier images créer
OUTPUT=xplanet.png
# origine et look_at ne peuvent etre les mêmes
# modifier ORIGINE pour donner la planete d'où vous regardez
# modifier LOOK_AT pour changer la planete que vous regardez
ORIGINE=moon
LOOK_AT=earth
APPEND=2
# Géométrie de l'image à régler suivant la résolution du bureau
GEOMETRY=1280x1024
# Si vous utilisez un dock pour votre portable (et avez donc plusieurs résolutions
# d'écran suivant si vous êtes en vadrouille ou au bureau), commentez la ligne
# précédente et décommentez les trois suivantes
#XXX=`xdpyinfo|awk '$0~"dimensions"{print substr($0,match($0,/[[:digit:]]/),match($0,"x")-match($0,/[[:digit:]]/))}'`
#YYY=`xdpyinfo|awk '$0~"dimensions"{print substr($0,match($0,"x")+1,match($0,"pixel")-match($0,"x")-1)}'`
#GEOMETRY=${XXX}x${YYY}
# Position depuis où vous voulez regarder.
# Pour trouver la valeurs regarder dans les liens en fin de la page
# http://doc.ubuntu-fr.org/xplanet#Voir_aussi
# Nice L = 43.700° 43° 42'N; H = 7.266274° 7° 15E
LONGITUDE=7
LATITUDE=43
# Par defaut il n'y as pas de projection. Rendre un globe avec la projection rectangulaire en fait une carte à plat. vous pouvez aussi essayer : ancient, azimuthal, mercator,..
#PROJECTION=rectangular
# Renome l'image de fond ainsi Gnome réalise que l'image as changé - thx to dmbasso
if [ -e "$PREFIX$OUTPUT" ]; then
rm "$PREFIX$OUTPUT"
OUTPUT="$APPEND$OUTPUT"
else
rm "$PREFIX$APPEND$OUTPUT"
fi
if [ -z $PROJECTION ]; then
xplanet -num_times 1 -geometry $GEOMETRY -origin $ORIGINE -body $LOOK_AT -longitude $LONGITUDE -latitude $LATITUDE
else
xplanet -num_times 1 -geometry $GEOMETRY -origin $ORIGINE -body $LOOK_AT -longitude $LONGITUDE -latitude $LATITUDE -projection $PROJECTION
fi
# met à jour le fond d'écran de Gnome
#gconftool -t str -s /desktop/gnome/background/picture_filename "$PREFIX$OUTPUT"
sleep $DELAY
exec $0