@padawarno
Voici :
xplanet-bg à placer en root dans usr/local/bin/ :
#!/bin/bash
# xplanet-bg shell script v0.3 (pour Ubuntu 9.10 (karmic) & versions suivantes)
# Montre la Terre sur le bureau Gnome avec les conditions courantes d'éclairage (le jour et la nuit)
# avec la vue centrée sur votre ville, ou bien centrée à la verticale du Soleil (pour plus de dépaysement).
# Répertoire racine de xplanet, qui doit contenir le fichier xplanet.xml, et un dossier contenant
# les images earth.jpg et night.jpg qui seront copiées de /usr/share/xplanet/images
PREFIX=~/.xplanet/
# Non du fichier images créer
OUTPUT=xplanet.png
# ORIGINE et LOOK_AT ne peuvent être les mêmes :
# modifier ORIGINE pour indiquer la planète d'où vous regardez ;
# modifier LOOK_AT pour indiquer la planète que vous regardez.
ORIGINE=moon
LOOK_AT=earth
# Géométrie de l'image à régler suivant la résolution du bureau
GEOMETRY=1920x1080
# 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
# ou bien cherchez dans WikiPedia (par exemple) le nom de votre ville
# ou encore utilisez un GPS (Guide pour Paumé Solitaire :)
# Nice L = 43.700° 43° 42'N; H = 7.266274° 7° 15′E
# Pernes-les-Fontaines :
# Latitude : 47° 15′ 3.74″ N 47.251038°
# Longitude : 8° 37′ 32.29″ E 8.625637°
#
LONGITUDE=8
LATITUDE=47
# Par rapport au Soleil, la Terre fait une rotation complète (360°) en 24 heures, soit 1° toutes les 4 minutes.
# Calculons quelle longitude est face au Soleil (LONGITUDE2)
declare -i HEURES=`date -u "+%X" | awk -F ":" '{print $1}' | sed s/"^0"/""/`
declare -i MINUTES=`date -u "+%X" | awk -F ":" '{print $2}' | sed s/"^0"/""/`
declare -i SECONDES=`date -u "+%X" | awk -F ":" '{print $3}' | sed s/"^0"/""/`
declare -i SEC=$((${HEURES}*3600+${MINUTES}*60+${SECONDES}))
declare -i LONGITUDE2=$(((43200-${SEC})*360/86400+$LONGITUDE))
# Par defaut il n'y a pas de projection. Rendre un globe avec la projection rectangulaire en fait une carte à plat. vous pouvez aussi essayer : ancient, azimuthal, mercator,..
#PROJECTION=mercator
APPEND=2
# ***** Devenu obsolète à partir de karmic : *****
# Renome l'image de fond ainsi Gnome réalise que l'image as changé - thx to dmbasso
#if [ -e "$PREFIX$OUTPUT" ]; then
# rm -f "$PREFIX$OUTPUT"
# OUTPUT="$APPEND$OUTPUT"
#else
# rm -f "$PREFIX$APPEND$OUTPUT"
#fi
# ************************************************
# Dans les lignes comprises entre "if" et "fi" ci-après, vous pouvez modifier le paramètre -longitude :
# mettez ${LONGITUDE} si vous désirez avoir une vue de la Terre centrée chez vous ;
# mettez ${LONGITUDE2} si vous désirez avoir une vue de la Terre centrée sur la longitude du zénith (Soleil), et votre latitude.
if [ -z $PROJECTION ]; then
xplanet -num_times 1 -output "$PREFIX$OUTPUT" -geometry $GEOMETRY -origin $ORIGINE -body $LOOK_AT -longitude ${LONGITUDE2} -latitude $LATITUDE
else
xplanet -num_times 1 -output "$PREFIX$OUTPUT" -geometry $GEOMETRY -origin $ORIGINE -body $LOOK_AT -longitude ${LONGITUDE2} -latitude $LATITUDE -projection $PROJECTION
fi
# ***** Nécessaire pour une bonne transition, à partir de karmic : *****
cp ${PREFIX}${OUTPUT} ${PREFIX}${APPEND}${OUTPUT}
# **********************************************************************
# ***** Devenu obsolète à partir de karmic : *****
# met à jour le fond d'écran de Gnome
gconftool -t str -s /desktop/gnome/background/picture_filename "$PREFIX$OUTPUT"
# délai de mise à jour en minutes
DELAY=10m
sleep $DELAY
exec $0
# ************************************************
clouds.pl :
#!/usr/bin/perl
# ------------------------------------------------------------------------------------
# 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
use LWP::Simple;
# Set options:
# - where to save the downloaded file (default is current directory)
my $Filename = "/home/ragamatrix/.xplanet/images/clouds.jpg";
# - how often the image is updated on the server
my $MaxDownloadFrequencyHours = 2;
# - how many times to retry, if the server doesn't respond
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.
##
## Change these settings at the risk of being blacklisted from the
## image servers.
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);
}
}
sub GetRandomMirror() {
my @Mirrors = (
#"http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud_combined_2048.jpg"
#"ftp://mirror.pacific.net.au/pub2/xplanet/clouds_2048.jpg",
#"http://spierepf.dyndns.org/~peter/clouds_2048.jpg",
#"http://liotierj.free.fr/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://rcswww.urz.tu-dresden.de/~es179238/clouds_2048.jpg",
#"http://home.megapass.co.kr/~jhkim1101/cloud_data/clouds_2048.jpg",
"http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg",
"http://home.megapass.co.kr/~gitto88/cloud_data/clouds_2048.jpg",
#"http://myhome.hanafos.com/~hyoungkee/cloud_data/clouds_2048.jpg",
"http://php.nctu.edu.tw/~ijliao/clouds_2048.jpg",
"ftp://ftp.iastate.edu/pub/xplanet/clouds_2048.jpg",);
#"http://www.nmt.edu/~houdini/clouds_2048.jpg",
#"http://enekoalonso.com/projects/xplanet/clouds_2048.php",
return $Mirrors[rand scalar(@Mirrors)];
}
voila, tu peux prendre des images plus récentes dispo su le site de la nasa ou autre...bon xplanet 😉