Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 19/05/2007, à 19:25

JFNoubel

xplanet sur Feisty

Bonjour,

Je m'essaie à faire marcher xplanet sur ma Feisty nouvellement installée, et pour l'instant c'est sans succès... sad

Voici les éléments...

Le script de téléchargement des nuages, download_clouds.pl est placé dans mon répertoire /home/jf/bin. Le voici :

#!/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 = "/usr/share/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://xplanet.sourceforge.net/clouds/clouds_2048.jpg",
	"ftp://mirror.pacific.net.au/xplanet/clouds_2048.jpg",
	"http://www.ruwenzori.net/earth/clouds_2048.jpg",
	"http://xplanet.arculeo.com/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/~gitto88/cloud_data/clouds_2048.jpg",
	"http://home.megapass.co.kr/~holywatr/cloud_data/clouds_2048.jpg",
	"http://home.megapass.co.kr/~ysy00/cloud_data/clouds_2048.jpg",
	"http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg ",
	"http://giga.colozone.nl/clouds_2048.jpg",
	"http://www.wizabit.eclipse.co.uk/xplanet",
	"ftp://ftp.iastate.edu/pub/xplanet/clouds_2048.jpg",
	"http://xplanet.explore-the-world.net/clouds_2048.jpg");
  return $Mirrors[rand scalar(@Mirrors)];
}

Pas de problème pour initier le script en console :

sudo perl /home/jf/bin/download_clouds.pl

Le fichier "clouds.jpg" est correctement téléchargé, il apparaît dans /usr/share/xplanet/images

Ensuite, j'ai modifié le crontab pour un téléchargement toutes les 3 heures, en ajoutant la ligne suivante :

49 2,5,8,11,14,17,20,23 * * * root perl /home/jf/bin/download_clouds.pl 2&> /dev/null

Enfin, voici la ligne de commande dans les options avancées de kdesktop :

xplanet --geometry %xx%y --num_times 1 --latitude 42 --longitude 2 --output %f.jpg && mv %f.jpg %f

Voilà l'état d'avancement, mais ça ne marche pas. J'ai bien l'image de la terre en écran de fond, mais aucun nuage n'apparaît.

Quelqu'un aurait-il une idée ?

Merci d'avance pour ce soutien planétaire !

Hors ligne

#2 Le 08/07/2007, à 08:35

grog-ubuntu

Re : xplanet sur Feisty

Salut à toi,
Bon je suis désolé, je ne viens pas t'aider en tout cas pas pour l'instant mais pour demander ton aide.

J'ai installé xplanet avec synaptic. Je cherche à le configurer : j'ai donc créé un script comme dit sur ce forum : http://xplanet.sourceforge.net/FAQ.php#gnome2 pour gnome2. Malheureusement, toujours le même problème, à l'ouverture de session, la terre s'affiche 2 ou 3 secondes puis disparait. J'ai changé le

if [ -z $PROJECTION ]; then 
xplanet -num_times 1

en num_times 10 mais sans succés.
Comment as-tu fait?? je suis curieux!
Merci


www.greg-blog.com

Hors ligne

#3 Le 08/07/2007, à 10:48

JFNoubel

Re : xplanet sur Feisty

Aîe aïe, je crains de ne pouvoir t'aider, étant trop novice sur ces questions. La seule chose que je peux te donner est le script de download des nuages :

 
#!/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 = "/usr/share/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://xplanet.sourceforge.net/clouds/clouds_2048.jpg",
	"ftp://mirror.pacific.net.au/xplanet/clouds_2048.jpg",
	"http://www.ruwenzori.net/earth/clouds_2048.jpg",
	"http://xplanet.arculeo.com/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/~gitto88/cloud_data/clouds_2048.jpg",
	"http://home.megapass.co.kr/~holywatr/cloud_data/clouds_2048.jpg",
	"http://home.megapass.co.kr/~ysy00/cloud_data/clouds_2048.jpg",
	"http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg ",
	"http://giga.colozone.nl/clouds_2048.jpg",
	"http://www.wizabit.eclipse.co.uk/xplanet",
	"ftp://ftp.iastate.edu/pub/xplanet/clouds_2048.jpg",
	"http://xplanet.explore-the-world.net/clouds_2048.jpg");
  return $Mirrors[rand scalar(@Mirrors)];
}

Pour ce qui est de l'affichage de ton fond d'écran, j'ai l'impression que c'est ailleurs que cela se joue, mais je n'en sais pas plus... désolé !

Tu trouveras peut-être ton bonheur ici : http://nguild.org/tiki-index.php?page=Xplanet

Hors ligne

#4 Le 08/07/2007, à 13:02

blacknroll

Re : xplanet sur Feisty

http://nigthelfecity.miniville.fr/

Hors ligne