Ceci est une ancienne révision du document !
Xplanet : Installer Xplanet
Cette page à pour but de vous expliquer comment installer et configurer xplanet.
Ce logiciel permet d'utiliser comme fond d'écran une des planètes du système solaire,
dont la terre avec ses nuages et la limite du jour et de la nuit.
L'images est mise à jour à intervalle régulière
Pré-requis
- Disposer des droits d'administration ;
- Disposer d'une connexion à Internet configurée et activée ;
- Avoir activé l'accès aux dépôts Universe et Multiverse ;
Installation
Il vous suffit, pour cela, d'installer les paquets xplanet xplanet-images
Configuration
Tout d'abord, si il n'existe pas, créer le répertoire de xplanet. Dans une console lancez la commande :
if [ ! -d ~/.xplanet ]; then echo 'Create .xplanet'; mkdir -p ~/.xplanet/images ; fi
Ensuite, récupérer les fichiers xplanet-bg et clouds.pl,
le fichier xplanet-bg contient la configuration de xplanet position, projection, repertoires, …
et clouds.pl la configuration et la recuperation de l'image des nuages.
éditez les fichiers
et enregistrez les respectivement comme /usr/local/bin/xplanet-bg et /usr/local/bin/clouds.pl
Les options sont expliquées dans les fichiers.
xplanet-bg :
#!/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=10m # Répertoire racine de xplanet PREFIX=~/.xplanet/ # Non du fichier images créer OUTPUT=xplanet.png APPEND=2 # Géométrie de l'image à régler suivant la résolution du bureau GEOMETRY=1280x1024 # 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° 15′E 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 -output "$PREFIX$OUTPUT" -geometry $GEOMETRY -longitude $LONGITUDE -latitude $LATITUDE else xplanet -num_times 1 -output "$PREFIX$OUTPUT" -geometry $GEOMETRY -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
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 # (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 = "~/.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 = ( "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", "http://xplanet.nerp.net/clouds_2048.php"); return $Mirrors[rand scalar(@Mirrors)]; }
Puis rendre executable le fichier xplanet-bg :
sudo chmod +x /usr/local/bin/xplanet-bg
Et éditez les fichiers gksudo gedit /etc/crontab et rajouter à la fin en remplaçant $USER par votre nom d'utilisateur:
49 2,5,8,11,14,17,20,23 * * * $USER perl /usr/local/bin/clouds.pl
Utilisation
Pour qu'il se lance automatiquement à l'ouverture de session:
- sous gnome, dans le menu "Système » Préférences » Sessions" rajouter une entrée comme suis:
- Nom : xplanet
- Commande : /usr/local/bin/xplanet-bg
- Commentaires : Fond d'écran planétaire
Validez et fermez.
Désinstallation
Pour supprimer cette application, il suffit de supprimer son paquet. La configuration de l'application sera conservée ou supprimée selon la méthode de désinstallation que vous choisirez.
- Dans gnome, dans le menu "Système » Préférences » Sessions" supprimer l'entrée xplanet
éditez les fichiers gksudo gedit /etc/crontab et supprimez ou commentez la ligne ainsi :
# 49 2,5,8,11,14,17,20,23 * * * $USER perl /usr/local/bin/clouds.pl
Voir aussi
Programme
Posistion
- (fr, en) Longitude wikipédia
Contributeurs : benje.
Basé sur « Titre original de l’article » par Auteur Original.