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.

#1076 Le 28/06/2012, à 12:51

Phyllinux

Re : [Conky] Alternative à weather.com (2)

Pour ce qui est d'une usine à gaz, c'est sûr !!!

Premier point sur lequel je bloque :
Le script de récupération et découpe des images travaille comme ceci :
Il télécharge l'image
Il vérifie si elle est différente de celle qui existe (le cas échéant)
Si oui, il la redécoupe et il nomme l'image ainsi découpée 'image.jpg'.

L'affichage dans le conky demande d'afficher le fichier 'image.jpg'.

Jusque là, tout va bien. Le bateau coule normalement...

Là ou ça se corse, c'est lorsque je demande d'afficher une autre image SAT. Le script télécharge l'image, vérifie si elle est différente, effectivement, c'est le cas, elle est différente, donc il la redécoupe et l'enregistre à nouveau sous le nom de 'image.jpg'. Du coup, la première image SAT affichée est remplacée par la dernière téléchargée, et ce sont donc les 2 mêmes images qui sont affichées.

Solutions ?
Modifier le script pour qu'il renomme la nouvelle image 'image2.jpg'. Non, mauvaise idée car dans ce cas, l'image affichée ne se rafraîchira jamais. Car si le script travaille de cette façon, c'est uniquement pour permettre de renouveler l'image à chaque fois que l'on vérifie si elle a évolué (toutes les 3H)
Faire un script différent pour chaque type d'image téléchargée : 1 script pour les Images RGB, qui la nommera image.jpg, 1 script pour les images SAT de la couverture nuageuse qui la nommera image2.jpg, etc... Et ainsi le conky demande d'afficher soit image, soit image2, soit image et image2, etc...

C'est déjà le début d'une belle usine à gaz. C'est réalisable, mais pointu à gérer par la suite, si l'on veut permettre de faire un choix d'affichage comme proposé par enebre.

Le plus simple est de rester sur l'affichage d'une seule image SAT (ou 2 fois la même si on veut équilibrer l'affichage du conky : centré à droite et à gauche).
Et dans ce cas, c'est par le fichier du conky que l'on peut définir l'image que l'on souhaite, en proposant toutes les possibilité d'images, et en mettant 'en commentaire' celles que l'on ne veut pas, pour ne garder que la seule à afficher.
C'est moins convivial pour un néophyte qui ne maîtrise pas les conkys, car il n'osera pas ou ne saura pas où aller chercher et comment faire, et il n'aura pas le choix. A moins que tu saches comment faire, avec un script de configuration, pour définir le choix, qui ne garde qu'une seule image et rende les autres inactives.

Je bricole un petit conky avec une image SAT de part et d'autre de la partie météo pour voir ce que cela rend.


The ship is sinking normally...

Hors ligne

#1077 Le 28/06/2012, à 13:00

enebre

Re : [Conky] Alternative à weather.com (2)

- Didier-T - Phyllinux - Serait-ce pas moins lourd d'avoir un conky séparé pour les images et qui pourrait être appelé dans la config à l'installation du premier ? Un peu comme un train auquel on ajoute des wagons, je pense à ça parce que je retrouve bien souvent les mêmes commande d'un conky à l'autre.
edit : non ça doit être une bétise, je sors hmm

Dernière modification par enebre (Le 28/06/2012, à 13:05)

Hors ligne

#1078 Le 28/06/2012, à 14:31

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Didier-T et Phyllinux

Salut !
Bin Didiet-T ! Tu ne te rappelle pas m'avoir fait un script qui pouvait gérer plein d'images...
Vous pourrez modifier les chemins et je pense que le fonctionnement du script dans conky te reviendras...(j'espère que c'est ce que vous recherchiez, sinon j'ai rien capté...:))
images_sat_multi.pl :

 #!/usr/bin/perl -w

use strict;
use warnings;

use constant VERSION => 0.03;

if(scalar @ARGV < 6) {
   &help;
}

my @image_web;
my @dimensions;
my @file_name;
my $nb;


# Détermination des arguments
$nb = 0;
for(my $i = 0; $i < scalar @ARGV; $i +=2) {

   if($ARGV[$i] eq "-s") {
           $nb = $nb + 1;
      $dimensions[$nb] = $ARGV[$i + 1];
   }
   elsif($ARGV[$i] eq "-i") {
      $image_web[$nb] = $ARGV[$i + 1];
   }
   elsif($ARGV[$i] eq "-f") {
      $file_name[$nb] = $ARGV[$i + 1];
   }
   else {
      print STDERR "Argument $ARGV[$i] inconnu\n";
      &help;
   }
}

for(my $j = 1; $j <= $nb; $j +=1) {
    # Détermination du nom de l'image
    my @decoupage = split "/", $image_web[$j];
    my $image_sat = $decoupage[$#decoupage];
    @decoupage = split "/", $file_name[$j];
    my $chemin = substr($file_name[$j], 0, length($file_name[$j]) - 1 - length($decoupage[$#decoupage]));
    # On regarde si le fichier existe déjà
    if(-e "$chemin/$image_sat") {
       # Récupération des informations de l'image
       my @infos_ancienne_image = (stat("$chemin/$image_sat"))[7..10];
    
       # Téléchargement de l'image si besoin
       &telecharger($image_web[$j], "-m -nd", "$chemin/$image_sat");
       
       # Récupération des informations de l'image
       my @infos_nouvelle_image = (stat("$chemin/$image_sat"))[7..10];
    
       # Comparaison des informations pour déterminer si on a téléchargé une image
       my $comparaison = 0;
       for(my $i = 0; $i < scalar @infos_ancienne_image; $i++) {
          if($infos_ancienne_image[$i] != $infos_nouvelle_image[$i]) {
             $comparaison++;
             last;
          }
       }
    
       # Si l'image est nouvelle, il faut refaire un découpage
       if($comparaison) {
          &nouvelle_image("$chemin/$image_sat", $dimensions[$j], $file_name[$j]);
       }
    }
    else {
       &telecharger($image_web[$j], "", "$chemin/$image_sat");
       &nouvelle_image("$chemin/$image_sat", $dimensions[$j], $file_name[$j]);
    }
}
    #######################
    # Début des fonctions #
    #######################
    
sub help {
   print "Utilisation : $0 [arguments]\n"
      . "arguments :\n"
      . "  -i : Permet d'indiquer l'emplacement où se trouve l'image\n"
      . "  -s : Permet d'indiquer le découpage de l'image\n"
      . "  -f : Permet d'indiquer où stoquer l'image créé et son nom\n";
   exit(0);
}

sub nouvelle_image {
   my ($image, $decoupage, $sauvegarde) = @_;

   # Sauvegarde de l'image actuelle
   system("cp $image imagesattmp.jpg");
   # Découpage de l'image
   system("convert imagesattmp.jpg -crop $decoupage $sauvegarde");
   # Suppression de l'image temporaire
   unlink "imagesattmp.jpg";
}
sub telecharger {
   my ($emplacement, $options, $sauvim) = @_;

   system("wget -q $options $emplacement -O $sauvim");
}

__END__

=encoding utf8

=head1 Nom

Imagesat

=head1 SYNOPSIS

Il permet de télécharger et réduire une image

=head1 DESCRIPTION

Ce script Perl permet de télécharger une image, de la redimensionner pour ensuite l'afficher dans conky. Le script prend B<obligatoirement> deux paramètres à savoir l'emplacement de l'image à
télécharger ainsi que les dimensions de la future image.
Les différentes images (en fonction de vos envies) où vous pouvez trouver votre bonheur se trouvent ici :
L<http://oiswww.eumetsat.org/IPPS/html/latestImages.html>

=head1 AUTEUR

Chipster Julien

=head1 Programmes externes

Pour fonctionner, ce script a besoin de deux logiciels :

=over 4

=item wget

=item imagemagick

=back

=head1 UTILISATION

Ce script s'utilise comme ceci :

C<${exec perl Imagesat} [arguments]>

Si vous avez fait un chmod +x Imagesat :

C<${exec ./Imagesat} [arguments]>

[arguments] doit être défini comme ceci :

=over 4

=item -i http://......../mon_image.jpg

=item -s 200x200+0+0

=back

=head2 Exemple

C<${exec perl Imagesat -s 1274x657+0+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}>

Allez, je suis sympa, voici comment ça s'utilise dans conky après la balise TEXT
${exec perl /home/user/.conky/Imagesat -s 1274x657+0+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image /home/user/.conky/image.jpg -p -5,-5 -s 400x220}

=head1 BOGUES

Aucun connu actuellement

=head1 Évolutions

=head1 Changelog

=item1 Rajout de l'option -q à wget. Il était trop bavard :D Ceci avait tendance à faire boguer gnome

=over 4

=item 30/08/2009

Création du script

=item Big Bang

Création de l'univers connu :D

=back 

Exemple à lancer dans conky :

  ${execpi 1200 perl ~/conky/script/imagesat_multi/imagesat1.pl -s 600x400+0+0 -i http://xplanet.jcweather.us/venus-sun.jpg}${image /home/ragamatrix/image1.jpg -p 10,30 -s 500x300 -f 60}
${execpi 1200 perl ~/conky/script/imagesat_multi/imagesat2.pl -s 600x400+0+0 -i http://xplanet.jcweather.us/mars-sun.jpg}${image /home/ragamatrix/image2.jpg -p 10,305 -s 500x300 -f 60}
${execpi 1200 perl ~/conky/script/imagesat_multi/imagesat3.pl -s 600x400+0+0 -i http://xplanet.jcweather.us/jupiter-sun.jpg}${image /home/ragamatrix/image3.jpg -p 507,305 -s 500x300 -f 60}etc..... 

Bronzez bien cool

Dernière modification par ragamatrix (Le 28/06/2012, à 14:32)

Hors ligne

#1079 Le 28/06/2012, à 14:52

Phyllinux

Re : [Conky] Alternative à weather.com (2)

enebre a écrit :

- Didier-T - Phyllinux - Serait-ce pas moins lourd d'avoir un conky séparé pour les images et qui pourrait être appelé dans la config à l'installation du premier ? Un peu comme un train auquel on ajoute des wagons, je pense à ça parce que je retrouve bien souvent les mêmes commande d'un conky à l'autre.
edit : non ça doit être une bétise, je sors hmm

Dans cet ordre d'idée, j'ai fait un petit conky, qui donne cela :
Lancement des infos météo, puis lancement de l'image SAT. Impérativement dans cet ordre, sinon, le conky image recouvre le texte et cela laisse une bande qui masque le texte qui est en dessous.
Pour le moment, en test, ce sont juste 2 conkys lancés séparément, mais cela peut sans problème être automatisé.
Un aperçu de ce que cela donne :
espacedetravail1017.png

J'en ai profité pour nettoyer un peu le conky, en refaisant un peu la mise en forme, alignement des données, etc... ainsi qu'en changeant quelques valeurs de Probabilité de Pluie au lieu de Probabilité d'Orage.
Le nouveau code conky :

 background yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right
use_xft yes

# Update interval in seconds
update_interval 3

# Minimum size of text area
minimum_size 780 450
maximum_width 1200

override_utf8_locale yes

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
#font freesans -12
xftfont Arial:size=9
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_inner_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color cbcbcb

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
alignment top_middle
#alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 0
gap_y 10

#Rafraichissement images
imlib_cache_size 0

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge
color4 E7E1D6 #
color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 48D1CC

# -- Declaration template -- #
template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icones météo -- \2=repertoir icones \3=position \4=taille \5=jour (pour les prévisions) #
template3 ${lua Lune_\1} 

lua_load ~/conky/script/meteo.lua
lua_startup_hook init ~/conky/script/meteo.cfg
# stuff after 'TEXT' will be formatted on screen
TEXT
#### Lancement du script récupérant les données météo ####
${template1 Maj}
####Affichage Heure et Date####
${font URW Chancery L:style=Bold:size=26}${color ffe595}${goto 50}${time %H}:${time %M}
${voffset -65}${goto 300}${font URW Chancery L:style=Bold:size=40}${template2 Date %A_%d_%B_%Y}
${voffset -45}${hr 2}${font}
####Affichage Cadre####
${voffset 15}${font Radio Space:style=Bold:size=24}${color yellow}MAINTENANT${goto 540}PREVISION 48H
####Affichage Localisation####
${voffset -60}${goto 350}${font Bitstream Vera Sans Mono:style=Bold:size=14}${color blue}${template1 Ville}
${voffset -5}${goto 275}${font Bitstream Vera Sans Mono:style=Bold:size=12}${template1 latitude} N / ${template1 longitude} E
####Affichage Actualisation####
${font URW Chancery L:style=Bold:size=16}${color red}${goto 280}Dernière mise à jour : ${template1 Heure}h${template1 Minute}
${voffset -15}${color ffe595}${hr 2}${font}
####Affichage Taux Humidité et T° ressentie####
${font URW Chancery L:style=Bold:size=16}${color ffe595}HUMIDITE${goto 415}RESSENTIE
${voffset -15}${font URW Chancery L:style=Bold:size=26}${color1}${goto 35}${template1  Humidite}%${goto 440}${template1  TempRes}°C
####Affichage Pression et Vent####
${voffset 20}${font URW Chancery L:style=Bold:size=16}${color ffe595}BAROMETRE${voffset -20}${goto 435}VENT
${voffset 5}${font URW Chancery L:style=Bold:size=26}${color1}${goto 15}${template1 Pression} mb${goto 430}${voffset -20}${template1 VentForce}Km/h
${voffset -15}${goto 430}${template1 VentDirP}
####Affichage Point de Rosée, Visibilité et Pluie####
${font URW Chancery L:style=Bold:size=16}${color ffe595}PT. DE ROSEE${goto 230}VISIBILITE${goto 430}PLUIE
${voffset -15}${font URW Chancery L:style=Bold:size=26}${color1}${goto 35}${template1 Rose}°C${goto 240}${template1 Visibilite} km${goto 430}${template1 QPrec} mm
####Affichage Icônes Temps et Vent####
${template2 IconeM ~/conky/meteo/icones 80,165 250x150}
${template2 IconeV ~/conky/meteo/icones/vent 365,260 55x55}
####Affichage T° Actuelle####
${voffset -300}${font Bitstream Vera Sans Mono:style=Bold:size=60}${if_match ${template1 TempAct}<6}${color red}${goto 302}${blink ${template1 TempAct}°}${else}${color white}${goto 302}${template1 TempAct}°${endif}
####Affichage Conditions Actuelles####
${voffset -30}${goto 135}${font URW Chancery L:style=Bold:size=22}${color Lightblue}${template1  CondMeteo}


####Affichage Cadre####
${goto 40}${font Radio Space:style=Bold:size=24}${color yellow}JOUR${goto 230}SOIR${goto 400}LUNE
####Affichage Titres####
${voffset -15}${font URW Chancery L:style=Bold:size=12}${color ffe595}AUBE${goto 77}T°MAX${goto 134}PLUIE${goto 190}COUCHER${goto 265}T°MIN${goto 320}PLUIE${goto 390}PHASE${goto 460}VISIBLE
####Affichage Icônes####
${image ~/conky/meteo/icones/Lever.png -p 0,475 -s 45x45}
${image ~/conky/meteo/icones/jour/ho.png -p 50,475 -s 50x30}
${image ~/conky/meteo/icones/Coucher.png -p 180,475 -s 45x45}
${image ~/conky/meteo/icones/jour/co.png -p 235,475 -s 50x30}
${image /tmp/lune.png -p 365,475 -s 45x45 -f 60}
####Affichage Données Jour####
${voffset -65}${font URW Chancery L:style=Bold:size=18}${color1}${template1 HLeverSoleil}:${template1 MLeverSoleil}${color ffe595}${goto 75}${template1 Jour_Temp 1}°C${goto 135}${voffset -40}${color Red}${template1 Jour_ProbPrec}%${voffset 40}${goto 130}${color1}${template1 Jour_QPluie 1}mm
####Affichage Données Nuit####
${voffset -30}${goto 190}${font URW Chancery L:style=Bold:size=18}${color ffe595}${template1 HCoucherSoleil}:${template1 MCoucherSoleil}${color1}${goto 260}${template1 Nuit_Temp 1}°C${goto 315}${voffset -40}${color Red}${template1 Nuit_ProbPrec}%${voffset 40}${goto 315}${color ffe595}${template1 Nuit_QPluie 1}mm
####Affichage Données Lune####
${voffset -30}${goto 375}${font URW Chancery L:style=Bold:size=14}${color1}${template3 ephemerides1}${voffset 15}${goto 375}${template3 ephemerides2}
${voffset -85}${goto 455}${font URW Chancery L:style=Bold:size=16}${color red}${template3 Visibilite}%
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color1}Lever
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color ffe595}${template3 HLeverLune}:${template3 MLeverLune}
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color1}Coucher
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color ffe595}${template3 HCoucherLune}:${template3 MCoucherLune}
${voffset -30}${font Radio Space:style=Bold:size=16}${color yellow}HISTORIQUE A-1 : ${color ffe595}${template1 Histo_Max 1}°C ${color }/ ${color1}${template1 Histo_Min 1}°C
####Prévisions 48H####
####J+1####
${voffset -425}${goto 575}${font URW Chancery L:style=Bold:size=16}${color6}${template2 Jour %A_%d_%B_%Y 2}
###Jour###
${template2 Jour_IconeM ~/conky/meteo/icones 510,170 70x42 2}
${voffset -30}${goto 585}${color red}${template1 Jour_Temp 2}°${color1}  Pluie:${template1 Jour_ProbPrec 2}% - ${template1 Jour_QPluie 2}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Jour_CondMeteo 2}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Jour_IconeV ~/conky/meteo/icones/vent 580,223 30x30 2}
${template2 Jour_IconeR ~/conky/meteo/icones/vent 735,223 30x30 2}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Jour_VentDirP 2} ${template1 Jour_VentForce 2}km/h${goto 690}${template1 Jour_VentDirP 2} ${template1 Jour_VentRafales 2}km/h
###Nuit###
${template2 Nuit_IconeM ~/conky/meteo/icones 510,268 70x42 2}
${voffset -20}${goto 585}${color lightblue}${template1 Nuit_Temp 2}°${color1}  Pluie:${template1 Jour_ProbPrec 2}% - ${template1 Jour_QPluie 2}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Nuit_CondMeteo 2}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Nuit_IconeV ~/conky/meteo/icones/vent 580,313 30x30 2}
${template2 Nuit_IconeR ~/conky/meteo/icones/vent 735,313 30x30 2}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Nuit_VentDirP 2} ${template1 Nuit_VentForce 2}km/h${goto 690}${template1 Nuit_VentDirP 2} ${template1 Nuit_VentRafales 2}km/h
####J+2####
${goto 575}${font URW Chancery L:style=Bold:size=16}${color6}${template2 Jour %A_%d_%B_%Y 3}
###Jour###
${template2 Jour_IconeM ~/conky/meteo/icones 510,390 70x42 3}
${voffset -30}${goto 585}${color red}${template1 Jour_Temp 3}°${color1}  Pluie:${template1 Jour_ProbPrec 3}% - ${template1 Jour_QPluie 3}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Jour_CondMeteo 3}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Jour_IconeV ~/conky/meteo/icones/vent 580,437 30x30 3}
${template2 Jour_IconeR ~/conky/meteo/icones/vent 735,437 30x30 3}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Jour_VentDirP 3} ${template1 Jour_VentForce 3}km/h${goto 690}${template1 Jour_VentDirP 3} ${template1 Jour_VentRafales 3}km/h
###Nuit###
${template2 Nuit_IconeM ~/conky/meteo/icones 510,483 70x42 2}
${voffset -20}${goto 585}${color lightblue}${template1 Nuit_Temp 3}°${color1}  Pluie:${template1 Jour_ProbPrec 3}% - ${template1 Jour_QPluie 3}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Nuit_CondMeteo 3}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Nuit_IconeV ~/conky/meteo/icones/vent 580,530 30x30 3}
${template2 Nuit_IconeR ~/conky/meteo/icones/vent 735,530 30x30 3}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Nuit_VentDirP 3} ${template1 Nuit_VentForce 3}km/h${goto 690}${template1 Nuit_VentDirP 3} ${template1 Nuit_VentRafales 3}km/h
${color ffe595}${hr 2}${font}
###PRÉVISIONS SIMPLIFIÉES RESTE DE LA SEMAINE###
###AFFICHAGE DES JOURS###
${font Radio Space:style=Bold:size=24}${color yellow}${alignc}RESTE DE LA SEMAINE
${voffset -15}${color ffe595}${hr 2}
${voffset -28}${font URW Chancery L:style=Bold:size=16}${color6}${goto 40}${template2 Jour %A 4}${goto 260}${template2 Jour %A 5}${goto 480}${template2 Jour %A 6}${goto 700}${template2 Jour %A 7}
###AFFICHAGE DES ICONES###
${template2 Jour_IconeM ~/conky/meteo/icones 0,667 70x42 4}
${template2 Jour_IconeM ~/conky/meteo/icones 220,667 70x42 5}
${template2 Jour_IconeM ~/conky/meteo/icones 440,667 70x42 6}
${template2 Jour_IconeM ~/conky/meteo/icones 655,667 70x42 7}
###AFFICHAGE DES TEMPERATURES###
${voffset -88}${goto 40}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 4}°${goto 255}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 5}°${goto 475}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 6}°${goto 695}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 7}°
${voffset -10}${goto 40}${color1}Maxi : ${color red}${template1 Jour_Temp 4}°${goto 255}${color1}Maxi : ${color red}${template1 Jour_Temp 5}°${goto 475}${color1}Maxi : ${color red}${template1 Jour_Temp 6}°${goto 695}${color1}Maxi : ${color red}${template1 Jour_Temp 7}°
${image ~/conky/meteo/icones/jour/ho.png -p 0,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 215,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 435,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 655,720 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 0,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 215,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 435,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 655,702 -s 30x18}
###AFFICHAGE DES CONDITIONS###
${voffset -240}${font Arial:size=10}${color3}${template1 Jour_CondMeteo1se 4}${goto 250}${template1 Jour_CondMeteo1se 5}${goto 470}${template1 Jour_CondMeteo1se 6}${goto 690}${template1 Jour_CondMeteo1se 7}
${template1 Jour_CondMeteo2se 4}${goto 250}${template1 Jour_CondMeteo2se 5}${goto 470}${template1 Jour_CondMeteo2se 6}${goto 690}${template1 Jour_CondMeteo2se 7}
###AFFICHAGE DU VENT###
${template2 Jour_IconeV ~/conky/meteo/icones/vent 60,672 30x30 4}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 280,672 30x30 5}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 500,672 30x30 6}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 720,672 30x30 7}
${voffset -170}${font URW Chancery L:style=Bold:size=14}${color ffe595}${goto 110}${template1 Jour_VentForce 4}km/h${goto 330}${template1 Jour_VentForce 5}km/h${goto 550}${template1 Jour_VentForce 6}km/h${goto 770}${template1 Jour_VentForce 7}km/h
###AFFICHAGE PRECIPITATIONS###
${voffset 80}PRECIPITATIONS${goto 220}PRECIPITATIONS${goto 440}PRECIPITATIONS${goto 660}PRECIPITATIONS
${image ~/conky/meteo/icones/pluie.png -p 0,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 40,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 220,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 260,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 440,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 480,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 660,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 700,820 -s 20x20}
${voffset -202}${color1}${goto 40}${template1 Jour_QPluie 4}mm${goto 260}${template1 Jour_QPluie 5}mm${goto 480}${template1 Jour_QPluie 6}mm${goto 700}${template1 Jour_QPluie 7}mm
${voffset -7}${goto 80}${template1 Jour_QNeige 4}cm${goto 300}${template1 Jour_QNeige 5}cm${goto 520}${template1 Jour_QNeige 6}cm${goto 740}${template1 Jour_QNeige 7}cm

Attention, le choix du fond d'écran est primordial, sinon, le conky devient très mal lisible.

@ ragamatrix :
Effectivement je vais essayer le script images multiples.
Cela pourrait correspondre à une partie du besoin.
Reste après la gestion du choix des images et la gestion de leur affichage en fonction du choix... wink


The ship is sinking normally...

Hors ligne

#1080 Le 28/06/2012, à 17:12

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ Phyllinux,

Pourquoi tu t’embête avec deux images, enfin si tu veux deux images qui change de source selon l’heure c'est faisable, avec le script que j'avais modifié pour ragamatrix ont peut généré toutes les images que l'on souhaite en donnant les arguments, puis il ne reste plus qu'a créer la condition qui vas bien.

Je suis pas très clair, pas grave dis moi ce que tu souhaitai obtenir comme source d'image, et je ferais le reste (enfin j'essayerai tongue ).

Edit : tu pourrais fournir les images suivantes
Lever.png
Coucher.png
pluie.png
neige.png

Dernière modification par Didier-T (Le 28/06/2012, à 18:20)

Hors ligne

#1081 Le 28/06/2012, à 19:16

Phyllinux

Re : [Conky] Alternative à weather.com (2)

Le lien des icônes est sur le post 1072.

Pour l'affichage des 2 côtés du conky :
L'idée est : D'un côté, afficher un photo SAT, et de l'autre la carte de vigilance de Meteo France.
Pour cela 2 solutions :
S1 : Réécrire le conky en totalité pour laisser la place aux images de part et d'autre. Car le conky est défini actuellement en position d'affichage centré. Donc si je veux y intégrer des images, pas possible, car elles se colleront à l'intérieur du 'texte'.
S2 : Plaquer par dessus un nouveau conky contenant les images. Pour cela, à l'affichage, le 1er conky lancé est celui du texte, et le 2°, qui sera déclaré en alignement à gauche , vient se 'coller' par dessus. D'où la nécessité de le lancer en retardement en second.

J'ai essayé le script donné par Ragamatrix, mais il me permet bien de télécharger l'image, mais il ne convertit pas l'image retaillée sous la forme image1, image 2.. Je m'y prends certainement mal.

Effectivement, je voudrais pouvoir faire changer une des images (celle en RGB) pour appeler l'image in IR en fonction de l'heure.
Pour les autres, cela n'a pas d'importance, car de jour ou de nuit, elles sont toujours exploitables.
Or, la solution que tu m'avais donné pour faire un appel différent en fonction de l'heure cause un bug aléatoire d'erreur de segmentation :

## Affichage en RGB ou en IR en fonction  de l'heure (pour affichage IR de nuit) ##
${if_match ${exec echo $(expr $(sed -n "46p" ~/meteotemp/prevision1)*60+$(sed -n "47p" ~/meteotemp/prevision1)|bc -l)}>${exec echo $(($(($(date +%H)*60))+$(date +%M)))}}${if_match ${exec echo $(($(($(date +%H)*60))+$(date +%M)))}>${exec echo $(expr $(sed -e "44s/0//" ~/meteotemp/prevision1|sed -n '44p')*60+$(sed -n "45p" ~/meteotemp/prevision1)|bc -l)}}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image ~/image.jpg -p 129,60 -s 180x120}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 129,60 -s 180x120}${endif}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 129,60 -s 180x120}${endif}

D'où l'idée proposée il y a quelques jours, de ne pas faire appel au script meteo lua pour définir quelle image aller chercher, mais peut être plus simplement l'heure système ?

EDIT :
Les différentes lignes de conky pour aller récupérer les différentes photos satellites :

## Affichage en RGB ou en IR en fonction  de l'heure (pour affichage IR de nuit) ##
${if_match ${exec echo $(expr $(sed -n "46p" ~/meteotemp/prevision1)*60+$(sed -n "47p" ~/meteotemp/prevision1)|bc -l)}>${exec echo $(($(($(date +%H)*60))+$(date +%M)))}}${if_match ${exec echo $(($(($(date +%H)*60))+$(date +%M)))}>${exec echo $(expr $(sed -e "44s/0//" ~/meteotemp/prevision1|sed -n '44p')*60+$(sed -n "45p" ~/meteotemp/prevision1)|bc -l)}}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image ~/image.jpg -p 15,635 -s 400x235}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 15,635 -s 400x235}${endif}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 15,635 -s 400x235}${endif}

## Affichage carte des Orages ##
${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+400+90 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_MPE-westernEurope.jpg}${image ~/image.jpg -p 15,635 -s 400x235}

## Affichage carte Type Atlas + suivi des Incendies ##
${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+400+50 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_FIRE-westernEurope.png}${image ~/image.jpg -p 15,635 -s 400x235}

## Affichage carte Radar ##
${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+50+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-Microphysics-centralEurope.jpg}${image ~/image.jpg -p 15,635 -s 400x235}

## Affichage carte Radar 2 ##
#${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+50+10 -i http://images.intellicast.com/WxImages/Satellite/hieusat.gif}${image ~/image.jpg -p 15,635 -s 400x235}

## Affichage carte Couverture Nuageuse 1 ##
${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+50+10 -i http://www.meteo-mc.fr/dedie/Images/sat/satireu1.gif}${image ~/image.jpg -p 15,635 -s 400x235}

## Affichage carte Couverture Nuageuse 2 ##
${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+50+10 -i http://www.meteo.be/meteo/view/fr/113200-ajaxcontroller.html/6723348/image.png?position=19}${image ~/image.jpg -p 15,635 -s 400x235}

## Affichage carte Infra Rouge ##
${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 15,635 -s 400x235}

Pour la carte de Meteo France des vigilances, il faut que je retrouve cela, car c'était sur mon DD avant la bascule sous Voyager, et donc pas encore classé.
C'était un script qui allait chercher la carte
Vigilance Meteo Fr
et la mettait en forme avec le 'décodeur'

EDIT 2:
J'ai retrouvé le lien où on a le script et tout le nécessaire Conkys jbaseb, travail de jbaseb :

Dernière modification par Phyllinux (Le 28/06/2012, à 19:31)


The ship is sinking normally...

Hors ligne

#1082 Le 29/06/2012, à 05:47

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ Phyllinux,

Et bien je vais tenter d’apporter des réponse a tes questions.

Le script fourni par ragamatrix permet de nommer les images comme bon nous semble, mais l'exemple d'utilisation qu'il fournit d'est pas bon
par exemple pour obtenir une image se nommant image1.jpg

${execpi 1200 perl ~/conky/script/imagesat_multi/imagesat1.pl -s 600x400+0+0 -i http://xplanet.jcweather.us/venus-sun.jpg -f image1.jpg}${image /home/ragamatrix/image1.jpg -p 10,30 -s 500x300 -f 60}

pour ce qui est du bug bug aléatoire d'erreur de segmentation, concernant le test jour nuit, il doit certainement intervenir lors des mise à jour des informations météo (pendant une fraction de seconde le fichier est vide), le moyen pour palier au problème et avoir toujours la bonne carte a la bonne heure consiste a utiliser directement les commandes du script météo, il faut que je regarde comment faire.

Edit : j'ai modifié le meteo.lua pour ajouter deux fonction une retournant l'information lever du jour en minute, et l'autre pour le coucher, il faudra tester le nouveau script, la j'ai pas le temps.

meteo.lua test

le bout de conky modifié

## Affichage en RGB ou en IR en fonction  de l'heure (pour affichage IR de nuit) ##
${if_match ${template2 CoucherSoleil}>${exec echo $(($(($(date +%H)*60))+$(date +%M)))}}${if_match ${exec echo $(($(($(date +%H)*60))+$(date +%M)))}>${template2 LeverSoleil}}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image ~/image.jpg -p 129,60 -s 180x120}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 129,60 -s 180x120}${endif}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 129,60 -s 180x120}${endif}

Dernière modification par Didier-T (Le 29/06/2012, à 06:14)

Hors ligne

#1083 Le 29/06/2012, à 07:52

jpdipsy

Re : [Conky] Alternative à weather.com (2)

Toutes,tous

Je viens de regarder le script de jbaseb pour la mise en forme de l'image sat à afficher.
une petite amélioration ( parceque je trouve l'affichage de l'étiquette pas clean mais c'est mon avis pas taper)
ex: 

#!/bin/bash
fonte=Times-Bold
wget -O  /tmp/imagesat.gif http://www.meteo-mc.fr/dedie/Images/sat/satireu1.gif
datemodif=`ls -l /tmp/imagesat.gif | cut -d ' ' -f9`
convert /tmp/imagesat.gif -filter Lanczos /tmp/imagesat.png
convert /tmp/imagesat.png -resize "462x462" \
-crop 404x304+23+110\!  \
-gravity North -fill white -font $fonte -pointsize 18 -annotate +0+285 "Mise à jour à : $datemodif" /tmp/imagesat.png

résultat image sat

en plus réduction du code
A+

j'ai oublié l'explication :
récupération de l'heure de modification de l'image par datemodif=`ls -l /tmp/imagesat.gif | cut -d ' ' -f9` et l'afficher voilà c'est tout pour aujourd'hui

Dernière modification par jpdipsy (Le 29/06/2012, à 08:17)

Hors ligne

#1084 Le 29/06/2012, à 08:30

jpdipsy

Re : [Conky] Alternative à weather.com (2)

toutes,tous

pour finir transformation de l'image en polaroïd

convert /tmp/imagesat.png   -bordercolor AliceBlue -background SteelBlue4 -polaroid 5 /tmp/pola.png

resultat polaroid

Voilà vous avez du taff pour le week-end

Dernière modification par jpdipsy (Le 29/06/2012, à 08:32)

Hors ligne

#1085 Le 29/06/2012, à 09:19

jpdipsy

Re : [Conky] Alternative à weather.com (2)

Et comme un peu de mégalomanie ne fait pas de mal

pola

J'ai ajouté çà si problème
probl


Je donnerai le code si on insiste    lol lol lol lol

Dernière modification par jpdipsy (Le 29/06/2012, à 11:49)

Hors ligne

#1086 Le 29/06/2012, à 13:12

Phyllinux

Re : [Conky] Alternative à weather.com (2)

Voici une ébauche de l'effet final recherché :

espacedetravail1018.png

Pour ceci, il me manque encore 2 ou 3 choses pour y arriver en direct (et pas avec un montage comme c'est le cas roll)
Le script qui me permette de télécharger 2 images sans qu'elles aient le me nom. Désolé, avec le script donné par ragamatrix, je n'arrive à rien hmm La vieillerie sans aucun doute, et je n'arrive pas à voir où ça cloche.
Le script pour récupérer la carte alerte météo. Celui de jbaseb n'est pas utilisable dans l'état, car il est lié à son fichier de config, qui est différent de celui que nous utilisons, et il faut rajouter également dans le répertoire icônes de nouvelles images appelées parle script. Pour le décodeur, avec les codes couleurs et la signification des icônes de vigilance, il existe dans le pack de jbaseb au format png.
Script jbaseb :

#!/bin/bash

path=`dirname $0`
source $path/meteo.cfg

rm ${DirShell}/icones/base/vigilance3.png

wget -O ${DirShell}/icones/base/vigilance.gif http://www.meteoalarm.eu/map.php?iso=FR&data=0&rnd=1328487696

sleep 3
convert ${DirShell}/icones/base/vigilance.gif -filter Lanczos ${DirShell}/icones/base/vigilance.png
convert ${DirShell}/icones/base/vigilance.png -crop 125x17+55+0\! ${DirShell}/icones/base/etiquette.png
mogrify -fuzz 40% -transparent white ${DirShell}/icones/base/etiquette.png
convert ${DirShell}/icones/base/vigilance.png -crop 85x118+14+407\! ${DirShell}/icones/base/corse.png
convert ${DirShell}/icones/base/vigilance.png -crop 500x508+49+24\! ${DirShell}/icones/base/vigilance1.png
convert ${DirShell}/icones/base/vigilance1.png -page +0+383 ${DirShell}/icones/base/corse.png -flatten ${DirShell}/icones/base/vigilance2.png
mogrify -resize "497x505" -filter Lanczos ${DirShell}/icones/base/vigilance2.png
convert ${DirShell}/icones/base/vigilance2.png -page +3+3 ${DirShell}/icones/base/etiquette.png -flatten ${DirShell}/icones/base/vigilance2.png
convert ${DirShell}/icones/base/vigilance2.png\
          -format 'roundrectangle 1,1 %[fx:w+4],%[fx:h+4] 15,15'\
          info: > ${DirShell}/icones/base/rounded_corner.mvg
convert ${DirShell}/icones/base/vigilance2.png -border 3 -alpha transparent \
          -background none -fill white -stroke none -strokewidth 0 \
          -draw "@${DirShell}/icones/base/rounded_corner.mvg"    ${DirShell}/icones/base/rounded_corner_mask.png
convert ${DirShell}/icones/base/vigilance2.png -border 3 -alpha transparent \
          -background none -fill none -stroke black -strokewidth 3 \
          -draw "@${DirShell}/icones/base/rounded_corner.mvg"    ${DirShell}/icones/base/rounded_corner_overlay.png
convert ${DirShell}/icones/base/vigilance2.png -matte -bordercolor none -border 3  \
          ${DirShell}/icones/base/rounded_corner_mask.png -compose DstIn -composite \
          ${DirShell}/icones/base/rounded_corner_overlay.png -compose Over -composite \
          ${DirShell}/icones/base/vigilance3.png

rm ${DirShell}/icones/base/vigilance.gif
rm ${DirShell}/icones/base/vigilance.png
rm ${DirShell}/icones/base/vigilance1.png
rm ${DirShell}/icones/base/vigilance2.png
rm ${DirShell}/icones/base/etiquette.png
rm ${DirShell}/icones/base/corse.png

Là, je n'ai pas la possibilité d'y travailler plus dessus, car je pars dans une petite heure, et je serais absent jusqu'à mercredi.
Je fais appel à votre connaissance des scripts pour trouver la bonne solution big_smile

J'ai modifié le conky pour permettre l'affichage des images sur la droite, en le ré alignant sur le côté gauche de l'écran :
code conky :

 background yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right
use_xft yes

# Update interval in seconds
update_interval 3

# Minimum size of text area
minimum_size 1420 450
maximum_width 1420

override_utf8_locale yes

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
#font freesans -12
xftfont Arial:size=9
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_inner_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color cbcbcb

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 10

#Rafraichissement images
imlib_cache_size 0

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge
color4 E7E1D6 #
color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 48D1CC

# -- Declaration template -- #
template0 ${image  ~/conky/meteo/icones/base/\1.png -p \2 -s \3}
template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icones météo -- \2=repertoir icones \3=position \4=taille \5=jour (pour les prévisions) #
template3 ${lua Lune_\1} 

lua_load ~/conky/script/meteo.lua
lua_startup_hook init ~/conky/script/meteo.cfg
# stuff after 'TEXT' will be formatted on screen
TEXT
#### Lancement du script récupérant les données météo ####
${template1 Maj}
####Affichage Heure et Date####
${font URW Chancery L:style=Bold:size=26}${color ffe595}${goto 300}${time %H}:${time %M}
${voffset -65}${goto 550}${font URW Chancery L:style=Bold:size=40}${template2 Date %A_%d_%B_%Y}
${voffset -45}${hr 2}${font}
####Affichage Cadre####
${voffset 15}${font Radio Space:style=Bold:size=24}${color yellow}MAINTENANT${goto 540}PREVISION 48H${goto 960}VIGILANCE METEO
####Affichage Localisation####
${voffset -60}${goto 350}${font Bitstream Vera Sans Mono:style=Bold:size=14}${color blue}${template1 Ville}
${voffset -5}${goto 275}${font Bitstream Vera Sans Mono:style=Bold:size=12}${template1 latitude} N / ${template1 longitude} E
####Affichage Actualisation####
${font URW Chancery L:style=Bold:size=16}${color red}${goto 280}Dernière mise à jour : ${template1 Heure}h${template1 Minute}
${voffset -15}${color ffe595}${hr 2}${font}
####Affichage Taux Humidité et T° ressentie####
${font URW Chancery L:style=Bold:size=16}${color ffe595}HUMIDITE${goto 415}RESSENTIE
${voffset -15}${font URW Chancery L:style=Bold:size=26}${color1}${goto 35}${template1  Humidite}%${goto 440}${template1  TempRes}°C
####Affichage Pression et Vent####
${voffset 20}${font URW Chancery L:style=Bold:size=16}${color ffe595}BAROMETRE${voffset -20}${goto 435}VENT
${voffset 5}${font URW Chancery L:style=Bold:size=26}${color1}${goto 15}${template1 Pression} mb${goto 430}${voffset -20}${template1 VentForce}Km/h
${voffset -15}${goto 430}${template1 VentDirP}
####Affichage Point de Rosée, Visibilité et Pluie####
${font URW Chancery L:style=Bold:size=16}${color ffe595}PT. DE ROSEE${goto 230}VISIBILITE${goto 430}PLUIE
${voffset -15}${font URW Chancery L:style=Bold:size=26}${color1}${goto 35}${template1 Rose}°C${goto 240}${template1 Visibilite} km${goto 430}${template1 QPrec} mm
####Affichage Icônes Temps et Vent####
${template2 IconeM ~/conky/meteo/icones 80,165 250x150}
${template2 IconeV ~/conky/meteo/icones/vent 365,260 55x55}
####Affichage T° Actuelle####
${voffset -300}${font Bitstream Vera Sans Mono:style=Bold:size=60}${if_match ${template1 TempAct}<6}${color red}${goto 302}${blink ${template1 TempAct}°}${else}${color white}${goto 302}${template1 TempAct}°${endif}
####Affichage Conditions Actuelles####
${voffset -30}${goto 135}${font URW Chancery L:style=Bold:size=22}${color Lightblue}${template1  CondMeteo}


####Affichage Cadre####
${goto 40}${font Radio Space:style=Bold:size=24}${color yellow}JOUR${goto 230}SOIR${goto 400}LUNE
####Affichage Titres####
${voffset -15}${font URW Chancery L:style=Bold:size=12}${color ffe595}AUBE${goto 77}T°MAX${goto 134}PLUIE${goto 190}COUCHER${goto 265}T°MIN${goto 320}PLUIE${goto 390}PHASE${goto 460}VISIBLE
####Affichage Icônes####
${image ~/conky/meteo/icones/Lever.png -p 0,475 -s 45x45}
${image ~/conky/meteo/icones/jour/ho.png -p 50,475 -s 50x30}
${image ~/conky/meteo/icones/Coucher.png -p 180,475 -s 45x45}
${image ~/conky/meteo/icones/jour/co.png -p 235,475 -s 50x30}
${image /tmp/lune.png -p 365,475 -s 45x45 -f 60}
####Affichage Données Jour####
${voffset -65}${font URW Chancery L:style=Bold:size=18}${color1}${template1 HLeverSoleil}:${template1 MLeverSoleil}${color ffe595}${goto 75}${template1 Jour_Temp 1}°C${goto 135}${voffset -40}${color Red}${template1 Jour_ProbPrec}%${voffset 40}${goto 130}${color1}${template1 Jour_QPluie 1}mm
####Affichage Données Nuit####
${voffset -30}${goto 190}${font URW Chancery L:style=Bold:size=18}${color ffe595}${template1 HCoucherSoleil}:${template1 MCoucherSoleil}${color1}${goto 260}${template1 Nuit_Temp 1}°C${goto 315}${voffset -40}${color Red}${template1 Nuit_ProbPrec}%${voffset 40}${goto 315}${color ffe595}${template1 Nuit_QPluie 1}mm
####Affichage Données Lune####
${voffset -30}${goto 375}${font URW Chancery L:style=Bold:size=14}${color1}${template3 ephemerides1}${voffset 15}${goto 375}${template3 ephemerides2}
${voffset -85}${goto 455}${font URW Chancery L:style=Bold:size=16}${color red}${template3 Visibilite}%
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color1}Lever
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color ffe595}${template3 HLeverLune}:${template3 MLeverLune}
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color1}Coucher
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color ffe595}${template3 HCoucherLune}:${template3 MCoucherLune}
${voffset -30}${font Radio Space:style=Bold:size=16}${color yellow}HISTORIQUE A-1 : ${color ffe595}${template1 Histo_Max 1}°C ${color }/ ${color1}${template1 Histo_Min 1}°C
####Prévisions 48H####
####J+1####
${voffset -425}${goto 575}${font URW Chancery L:style=Bold:size=16}${color6}${template2 Jour %A_%d_%B_%Y 2}
###Jour###
${template2 Jour_IconeM ~/conky/meteo/icones 510,170 70x42 2}
${voffset -30}${goto 585}${color red}${template1 Jour_Temp 2}°${color1}  Pluie:${template1 Jour_ProbPrec 2}% - ${template1 Jour_QPluie 2}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Jour_CondMeteo 2}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Jour_IconeV ~/conky/meteo/icones/vent 580,223 30x30 2}
${template2 Jour_IconeR ~/conky/meteo/icones/vent 735,223 30x30 2}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Jour_VentDirP 2} ${template1 Jour_VentForce 2}km/h${goto 690}${template1 Jour_VentDirP 2} ${template1 Jour_VentRafales 2}km/h
###Nuit###
${template2 Nuit_IconeM ~/conky/meteo/icones 510,268 70x42 2}
${voffset -20}${goto 585}${color lightblue}${template1 Nuit_Temp 2}°${color1}  Pluie:${template1 Jour_ProbPrec 2}% - ${template1 Jour_QPluie 2}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Nuit_CondMeteo 2}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Nuit_IconeV ~/conky/meteo/icones/vent 580,313 30x30 2}
${template2 Nuit_IconeR ~/conky/meteo/icones/vent 735,313 30x30 2}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Nuit_VentDirP 2} ${template1 Nuit_VentForce 2}km/h${goto 690}${template1 Nuit_VentDirP 2} ${template1 Nuit_VentRafales 2}km/h
####J+2####
${goto 575}${font URW Chancery L:style=Bold:size=16}${color6}${template2 Jour %A_%d_%B_%Y 3}
###Jour###
${template2 Jour_IconeM ~/conky/meteo/icones 510,390 70x42 3}
${voffset -30}${goto 585}${color red}${template1 Jour_Temp 3}°${color1}  Pluie:${template1 Jour_ProbPrec 3}% - ${template1 Jour_QPluie 3}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Jour_CondMeteo 3}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Jour_IconeV ~/conky/meteo/icones/vent 580,437 30x30 3}
${template2 Jour_IconeR ~/conky/meteo/icones/vent 735,437 30x30 3}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Jour_VentDirP 3} ${template1 Jour_VentForce 3}km/h${goto 690}${template1 Jour_VentDirP 3} ${template1 Jour_VentRafales 3}km/h
###Nuit###
${template2 Nuit_IconeM ~/conky/meteo/icones 510,483 70x42 2}
${voffset -20}${goto 585}${color lightblue}${template1 Nuit_Temp 3}°${color1}  Pluie:${template1 Jour_ProbPrec 3}% - ${template1 Jour_QPluie 3}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Nuit_CondMeteo 3}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Nuit_IconeV ~/conky/meteo/icones/vent 580,530 30x30 3}
${template2 Nuit_IconeR ~/conky/meteo/icones/vent 735,530 30x30 3}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Nuit_VentDirP 3} ${template1 Nuit_VentForce 3}km/h${goto 690}${template1 Nuit_VentDirP 3} ${template1 Nuit_VentRafales 3}km/h
${color ffe595}${hr 2}${font}
###PRÉVISIONS SIMPLIFIÉES RESTE DE LA SEMAINE###
###AFFICHAGE DES JOURS###
${font Radio Space:style=Bold:size=24}${color yellow}${goto 220}RESTE DE LA SEMAINE${goto 900}${color red}PHOTO SAT${goto 1220}ORAGES
${voffset -15}${color ffe595}${hr 2}
${voffset -28}${font URW Chancery L:style=Bold:size=16}${color6}${goto 40}${template2 Jour %A 4}${goto 260}${template2 Jour %A 5}${goto 480}${template2 Jour %A 6}${goto 700}${template2 Jour %A 7}
###AFFICHAGE DES ICONES###
${template2 Jour_IconeM ~/conky/meteo/icones 0,667 70x42 4}
${template2 Jour_IconeM ~/conky/meteo/icones 220,667 70x42 5}
${template2 Jour_IconeM ~/conky/meteo/icones 440,667 70x42 6}
${template2 Jour_IconeM ~/conky/meteo/icones 655,667 70x42 7}
###AFFICHAGE DES TEMPERATURES###
${voffset -88}${goto 40}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 4}°${goto 255}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 5}°${goto 475}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 6}°${goto 695}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 7}°
${voffset -10}${goto 40}${color1}Maxi : ${color red}${template1 Jour_Temp 4}°${goto 255}${color1}Maxi : ${color red}${template1 Jour_Temp 5}°${goto 475}${color1}Maxi : ${color red}${template1 Jour_Temp 6}°${goto 695}${color1}Maxi : ${color red}${template1 Jour_Temp 7}°
${image ~/conky/meteo/icones/jour/ho.png -p 0,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 215,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 435,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 655,720 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 0,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 215,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 435,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 655,702 -s 30x18}
###AFFICHAGE DES CONDITIONS###
${voffset -240}${font Arial:size=10}${color3}${template1 Jour_CondMeteo1se 4}${goto 250}${template1 Jour_CondMeteo1se 5}${goto 470}${template1 Jour_CondMeteo1se 6}${goto 690}${template1 Jour_CondMeteo1se 7}
${template1 Jour_CondMeteo2se 4}${goto 250}${template1 Jour_CondMeteo2se 5}${goto 470}${template1 Jour_CondMeteo2se 6}${goto 690}${template1 Jour_CondMeteo2se 7}
###AFFICHAGE DU VENT###
${template2 Jour_IconeV ~/conky/meteo/icones/vent 60,672 30x30 4}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 280,672 30x30 5}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 500,672 30x30 6}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 720,672 30x30 7}
${voffset -170}${font URW Chancery L:style=Bold:size=14}${color ffe595}${goto 110}${template1 Jour_VentForce 4}km/h${goto 330}${template1 Jour_VentForce 5}km/h${goto 550}${template1 Jour_VentForce 6}km/h${goto 770}${template1 Jour_VentForce 7}km/h
###AFFICHAGE PRECIPITATIONS###
${voffset 80}PRECIPITATIONS${goto 220}PRECIPITATIONS${goto 440}PRECIPITATIONS${goto 660}PRECIPITATIONS
${image ~/conky/meteo/icones/pluie.png -p 0,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 40,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 220,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 260,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 440,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 480,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 660,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 700,820 -s 20x20}
${voffset -202}${color1}${goto 40}${template1 Jour_QPluie 4}mm${goto 260}${template1 Jour_QPluie 5}mm${goto 480}${template1 Jour_QPluie 6}mm${goto 700}${template1 Jour_QPluie 7}mm
${voffset -7}${goto 80}${template1 Jour_QNeige 4}cm${goto 300}${template1 Jour_QNeige 5}cm${goto 520}${template1 Jour_QNeige 6}cm${goto 740}${template1 Jour_QNeige 7}cm
## Affichage en RGB ou en IR en fonction  de l'heure (pour affichage IR de nuit) ##
${if_match ${template2 CoucherSoleil}>${exec echo $(($(($(date +%H)*60))+$(date +%M)))}}${if_match ${exec echo $(($(($(date +%H)*60))+$(date +%M)))}>${template2 LeverSoleil}}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image ~/image.jpg -p 820,600 -s 300x235}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 820,600 -s 300x235}${endif}${else}${execpi 1200 perl ~/conky/meteo/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/image.jpg -p 820,600 -s 300x235}${endif}
###LES LIGNES QUI SUIVENT NE SONT LA QU'A TITRE D'EXEMPLE POUR MONTRER####
#####LE RESULTAT --- A MODIFIER LORSQUE SCRIPTS REALISES#####
${image ~/Téléchargements/image3.jpg -p 1122,600 -s 300x235}
${image ~/Téléchargements/vigilance.png -p 920,150 -s 350x351}
${image ~/Téléchargements/vigilance_legendes2.png -p 920,500 -s 350x95}

Si certains veulent s'amuser à continuer à travailler dessus, cela ne me dérange pas du tout big_smile
@ mercredi !
Bon week end à tous.

PS :
Les lignes modifiées par Didier-T donnent toujours un message d'erreur :

┌─( gilles ) - ( 3.2.0-26-generic ) - ( ~ )
└─> conky -c ~/conky/meteo/conkyrcmeteolua1
Conky: forked to background, pid is 27820
┌─( gilles ) - ( 3.2.0-26-generic ) - ( ~ )
└─> 
Conky: desktop window (1200003) is subwindow of root window (15d)
Conky: window type - override
Conky: drawing to created window (0x5400001)
Conky: drawing to double buffer
    version = v4.1
    web = http://www.accuweather.com/fr/fr/marseille/170960/current-weather/170960
    Pévision Nb jours = 7
    Pévision Matin = non
    Pévision Après Midi = oui
    Pévision Soirée = non
    Pévision Nuit = oui
    Délais = 300
    Chemin de travail = /tmp
    Palier = 16
    Chemin de sauvegarde = /home/gilles/meteotemp/
Conky: llua_do_call: function conky_Meteo_CoucherSoleil execution failed: attempt to call a nil value
Conky: failed to parse compare string '>850'
Conky: compare failed for expression '>850'
Conky: llua_do_call: function conky_Meteo_LeverSoleil execution failed: attempt to call a nil value
Conky: converting '' to long failed

The ship is sinking normally...

Hors ligne

#1087 Le 29/06/2012, à 13:12

ragamatrix

Re : [Conky] Alternative à weather.com (2)

jpdipsy a écrit :

Et comme un peu de mégalomanie ne fait pas de mal

http://uppix.net/a/9/d/fcac751555588583 … 4333e4.png

J'ai ajouté çà si problème
http://uppix.net/2/e/8/0c8c525dcc8bb960 … 2eefd4.png


Je donnerai le code si on insiste    lol lol lol lol

@jpdipsy
Salut
Très sympa cet effet "polaroïd"
Quelle version meteo_lua faut-il pour utiliser ce code ? Il faut utiliser un des scripts de jbaseb et l'adapter pour son conky...?
J'en profite aussi pour poser d'autres question...Dis moi si c'est un peu lourd:lol:
J'ai un bug avec un conky affichant la terre en petit version infra rouge :
L'image ne devrait s'afficher qu'une fois:
I_R
conkyrc :

 # -- Conky settings -- #
background no
update_interval 3600

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

# -- Window specifications -- #

own_window yes
own_window_type normal
own_window_transparent yes
#own_window_argb_visual yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 350 350

alignment br
gap_y 200
gap_x 250

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# -- Text settings -- #
use_xft yes
xftfont Trebuchet MS:size=12
xftalpha 0

uppercase no

default_color 000000
text_buffer_size 2048 
imlib_cache_size 0 
#--- LUA ---
#lua_load ~/.conky/conky17/newconky/calendar.lua
lua_load ~/.conky/conky17/newconky/square_to_round.lua
lua_draw_hook_pre main /tmp/earth/earth_image
#lua_draw_hook_post calendar


TEXT
${time}
${voffset 50}${font}${color FFC125}Températures infra rouge
${font}${color EFEFEF}Couverture nuageuse
${font}${color slate grey}Nuit
${execpi 60 ~/.conky/conky17/newconky/get_moon_earth.sh}
${image /tmp/earth/earth_image -p 10,125 -s 190x190} 

J'ai aussi récupérer un "conky equalizer"lua qui réagit lorsque la musique tourne sur le bureau...Chez moi il ne marche pas
aperçus
#post 175--->scripts_lua
spectrum (j'arrette parce que je suis en "border"HS...comme l'autre jour...Euh j'ai récidivé:rolleyes:)

Dernière modification par ragamatrix (Le 29/06/2012, à 13:16)

Hors ligne

#1088 Le 29/06/2012, à 13:44

jpdipsy

Re : [Conky] Alternative à weather.com (2)

ragamatrix a écrit :

Quelle version meteo_lua faut-il pour utiliser ce code ?

Aucun c'est un script bash autonome.
un conky du style

${execi 900 lefichier}
${image  imagesat -n}

suffit

ragamatrix a écrit :

Il faut utiliser un des scripts de jbaseb et l'adapter pour son conky...?

Non je trouvais juste son script un tantinet touffu.

son script

#!/bin/bash

path=`dirname $0`
source $path/meteo.cfg

rm ${DirShell}/icones/base/satireu5.png

wget -O  ${DirShell}/icones/base/satireu1.gif http://www.meteo-mc.fr/dedie/Images/sat/satireu1.gif

convert ${DirShell}/icones/base/satireu1.gif -filter Lanczos ${DirShell}/icones/base/satireu1.png
convert ${DirShell}/icones/base/satireu1.png -crop 141x20+0+0\! ${DirShell}/icones/base/etiquette.png
mogrify -fuzz 40% -transparent black ${DirShell}/icones/base/etiquette.png
convert ${DirShell}/icones/base/etiquette.png -fuzz 40% -fill white -opaque yellow ${DirShell}/icones/base/etiquette2.png
convert ${DirShell}/icones/base/etiquette.png -fuzz 40% -fill black -opaque yellow ${DirShell}/icones/base/etiquette3.png
convert ${DirShell}/icones/base/satireu1.png -resize "462x462" ${DirShell}/icones/base/satireu2.png
mogrify -crop 404x304+23+110\! ${DirShell}/icones/base/satireu2.png
convert ${DirShell}/icones/base/satireu2.png -page +7+281 ${DirShell}/icones/base/etiquette3.png -flatten ${DirShell}/icones/base/satireu3.png
convert ${DirShell}/icones/base/satireu3.png -page +3+277 ${DirShell}/icones/base/etiquette2.png -flatten ${DirShell}/icones/base/satireu4.png
convert ${DirShell}/icones/base/satireu4.png -page +40+6 ${DirShell}/icones/base/ville4.png -flatten ${DirShell}/icones/base/satireu5.png
convert ${DirShell}/icones/base/satireu5.png\
          -format 'roundrectangle 1,1 %[fx:w+4],%[fx:h+4] 15,15'\
          info: > ${DirShell}/icones/base/rounded_corner.mvg
convert ${DirShell}/icones/base/satireu5.png -border 3 -alpha transparent \
          -background none -fill white -stroke none -strokewidth 0 \
          -draw "@${DirShell}/icones/base/rounded_corner.mvg"    ${DirShell}/icones/base/rounded_corner_mask.png
convert ${DirShell}/icones/base/satireu5.png -border 3 -alpha transparent \
          -background none -fill none -stroke black -strokewidth 3 \
          -draw "@${DirShell}/icones/base/rounded_corner.mvg"    ${DirShell}/icones/base/rounded_corner_overlay.png
convert ${DirShell}/icones/base/satireu5.png -matte -bordercolor none -border 3  \
          ${DirShell}/icones/base/rounded_corner_mask.png -compose DstIn -composite \
          ${DirShell}/icones/base/rounded_corner_overlay.png -compose Over -composite \
          ${DirShell}/icones/base/satireu6.png

rm ${DirShell}/icones/base/satireu1.gif
rm ${DirShell}/icones/base/satireu1.png
rm ${DirShell}/icones/base/satireu2.png
rm ${DirShell}/icones/base/satireu3.png
rm ${DirShell}/icones/base/satireu4.png
rm ${DirShell}/icones/base/satireu5.png
rm ${DirShell}/icones/base/etiquette.png
rm ${DirShell}/icones/base/etiquette2.png
rm ${DirShell}/icones/base/etiquette3.png
rm ${DirShell}/icones/base/rounded_corner.mvg
rm ${DirShell}/icones/base/rounded_corner_mask.png
rm ${DirShell}/icones/base/rounded_corner_overlay.png

et maintenant çà se résume à ceci

#!/bin/bash

# Crée par JPDipsy 
# script de recupération imagesat couverture nuageuse http://www.meteo-mc.fr
# et mise en forme polaroïd
# pas touche ----------------------------------------------------------------------
function polaroid {
    #pour tourner l'image -polaroid + ou -
    #pour le texte jouer sur -density et -pointsize
    #pour la taile jouer sur -resize    
convert   -caption "$libelle"$heuremodif"h"$minmodif \
    /tmp/$nomimage.png   -bordercolor Lavender -border 5x5   -density 200 \
    -gravity center -font $fonte  -pointsize 10   -background black \
    -polaroid -15    -resize $tailleimage%   /tmp/$nomimage.png    
}
#----------------------------------------------------------------------------------
# ce que vous voulez
fonte=Times-Bold
nomimage=imagesat-couvnuage
tailleimage=70
# recup image sat
wget -q -O  /tmp/$nomimage.gif http://www.meteo-mc.fr/dedie/Images/sat/satireu1.gif

if [[ -e /tmp/$nomimage.gif ]] ; then
    # extraction heure de modification
    heuremodif=`ls -l /tmp/$nomimage.gif | cut -d ' ' -f9 | cut -d : -f1`
    minmodif=`ls -l /tmp/$nomimage.gif  | cut -d ' ' -f9 | cut -d : -f2`
    # decoupage de la partie utile
    convert /tmp/$nomimage.gif -filter Lanczos -crop 550x550+50+50\! /tmp/$nomimage.png
    libelle="Couverture nuageuse à  "
    polaroid
    rm /tmp/$nomimage.gif
else
    # comme ça votre conky aura toujours une image au cas ou 
    convert -size 550x550 plasma:  /tmp/$nomimage.png
    libelle="Désolé pas d'image radar à "
    heuremodif=`date +%H`
    minmodif=`date +%M`
    polaroid
fi

avec en prime une image de substitution en cas de problème.

Hors ligne

#1090 Le 29/06/2012, à 15:03

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@jpdipsy
Muchas gracias !
"funcionado muy buen !"
Bon là j'ai trop de photos sat smile
conkysat

Hors ligne

#1091 Le 29/06/2012, à 15:08

jpdipsy

Re : [Conky] Alternative à weather.com (2)

ragamatrix a écrit :

@jpdipsy
Muchas gracias !
"funcionado muy buen !"

De rien mon petit prend le script www.sat24.com les images sont plus belles

et Viva Espana Olé   lol

ps dans le script tu as  -background black change le en  -background gray40 (ou ce que tu veux) pour voir l'ombre sur ton fond noir

Dernière modification par jpdipsy (Le 29/06/2012, à 15:41)

Hors ligne

#1092 Le 30/06/2012, à 06:58

Didier-T

Re : [Conky] Alternative à weather.com (2)

Bonjour a tous,

pour commencer petite mise à jour du meteo.lua en 4.3, ajout du support lever soleil coucher soleil converti en minute pour éviter le problème rencontré par

code conky

background yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right
use_xft yes

# Update interval in seconds
update_interval 1

# Minimum size of text area
minimum_size 1420 450
maximum_width 1420

override_utf8_locale yes

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
#font freesans -12
xftfont Arial:size=9
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_inner_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color cbcbcb

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 0

#Rafraichissement images
#imlib_cache_size 0

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge
color4 E7E1D6 #
color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 48D1CC

# -- Declaration template -- #
template0 ${image  ~/conky/meteo/icones/base/\1.png -p \2 -s \3}
template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icones météo -- \2=repertoir icones \3=position \4=taille \5=jour (pour les prévisions) #
template3 ${lua Lune_\1} 

lua_load ~/conky/script/meteo.lua
lua_startup_hook init ~/conky/script/meteo.cfg
# stuff after 'TEXT' will be formatted on screen
TEXT
#### Lancement du script récupérant les données météo ####
${template1 Maj}
####Affichage Heure et Date####
${font URW Chancery L:style=Bold:size=26}${color ffe595}${goto 300}${time %H}:${time %M}
${voffset -65}${goto 550}${font URW Chancery L:style=Bold:size=40}${template2 Date %A_%d_%B_%Y}
${voffset -45}${hr 2}${font}
####Affichage Cadre####
${voffset 15}${font Radio Space:style=Bold:size=24}${color yellow}MAINTENANT${goto 540}PREVISION 48H${goto 960}VIGILANCE METEO
####Affichage Localisation####
${voffset -60}${goto 350}${font Bitstream Vera Sans Mono:style=Bold:size=14}${color blue}${template1 Ville}
${voffset -5}${goto 275}${font Bitstream Vera Sans Mono:style=Bold:size=12}${template1 latitude} N / ${template1 longitude} E
####Affichage Actualisation####
${font URW Chancery L:style=Bold:size=16}${color red}${goto 280}Dernière mise à jour : ${template1 Heure}h${template1 Minute}
${voffset -15}${color ffe595}${hr 2}${font}
####Affichage Taux Humidité et T° ressentie####
${font URW Chancery L:style=Bold:size=16}${color ffe595}HUMIDITE${goto 415}RESSENTIE
${voffset -15}${font URW Chancery L:style=Bold:size=26}${color1}${goto 35}${template1  Humidite}%${goto 440}${template1  TempRes}°C
####Affichage Pression et Vent####
${voffset 20}${font URW Chancery L:style=Bold:size=16}${color ffe595}BAROMETRE${voffset -20}${goto 435}VENT
${voffset 5}${font URW Chancery L:style=Bold:size=26}${color1}${goto 15}${template1 Pression} mb${goto 430}${voffset -20}${template1 VentForce}Km/h
${voffset -15}${goto 430}${template1 VentDirP}
####Affichage Point de Rosée, Visibilité et Pluie####
${font URW Chancery L:style=Bold:size=16}${color ffe595}PT. DE ROSEE${goto 230}VISIBILITE${goto 430}PLUIE
${voffset -15}${font URW Chancery L:style=Bold:size=26}${color1}${goto 35}${template1 Rose}°C${goto 240}${template1 Visibilite} km${goto 430}${template1 QPrec} mm
####Affichage Icônes Temps et Vent####
${template2 IconeM ~/conky/meteo/icones 80,165 250x150}
${template2 IconeV ~/conky/meteo/icones/vent 365,260 55x55}
####Affichage T° Actuelle####
${voffset -300}${font Bitstream Vera Sans Mono:style=Bold:size=60}${if_match ${template1 TempAct}<6}${color red}${goto 302}${blink ${template1 TempAct}°}${else}${color white}${goto 302}${template1 TempAct}°${endif}
####Affichage Conditions Actuelles####
${voffset -30}${goto 135}${font URW Chancery L:style=Bold:size=22}${color Lightblue}${template1  CondMeteo}


####Affichage Cadre####
${goto 40}${font Radio Space:style=Bold:size=24}${color yellow}JOUR${goto 230}SOIR${goto 400}LUNE
####Affichage Titres####
${voffset -15}${font URW Chancery L:style=Bold:size=12}${color ffe595}AUBE${goto 77}T°MAX${goto 134}PLUIE${goto 190}COUCHER${goto 265}T°MIN${goto 320}PLUIE${goto 390}PHASE${goto 460}VISIBLE
####Affichage Icônes####
${image ~/conky/meteo/icones/Lever.png -p 0,475 -s 45x45}
${image ~/conky/meteo/icones/jour/ho.png -p 50,475 -s 50x30}
${image ~/conky/meteo/icones/Coucher.png -p 180,475 -s 45x45}
${image ~/conky/meteo/icones/jour/co.png -p 235,475 -s 50x30}
${image /tmp/lune.png -p 365,475 -s 45x45 -f 60}
####Affichage Données Jour####
${voffset -65}${font URW Chancery L:style=Bold:size=18}${color1}${template1 HLeverSoleil}:${template1 MLeverSoleil}${color ffe595}${goto 75}${template1 Jour_Temp 1}°C${goto 135}${voffset -40}${color Red}${template1 Jour_ProbPrec}%${voffset 40}${goto 130}${color1}${template1 Jour_QPluie 1}mm
####Affichage Données Nuit####
${voffset -30}${goto 190}${font URW Chancery L:style=Bold:size=18}${color ffe595}${template1 HCoucherSoleil}:${template1 MCoucherSoleil}${color1}${goto 260}${template1 Nuit_Temp 1}°C${goto 315}${voffset -40}${color Red}${template1 Nuit_ProbPrec}%${voffset 40}${goto 315}${color ffe595}${template1 Nuit_QPluie 1}mm
####Affichage Données Lune####
${voffset -30}${goto 375}${font URW Chancery L:style=Bold:size=14}${color1}${template3 ephemerides1}${voffset 15}${goto 375}${template3 ephemerides2}
${voffset -85}${goto 455}${font URW Chancery L:style=Bold:size=16}${color red}${template3 Visibilite}%
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color1}Lever
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color ffe595}${template3 HLeverLune}:${template3 MLeverLune}
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color1}Coucher
${voffset -10}${goto 455}${font URW Chancery L:style=Bold:size=16}${color ffe595}${template3 HCoucherLune}:${template3 MCoucherLune}
${voffset -30}${font Radio Space:style=Bold:size=16}${color yellow}HISTORIQUE A-1 : ${color ffe595}${template1 Histo_Max 1}°C ${color }/ ${color1}${template1 Histo_Min 1}°C
####Prévisions 48H####
####J+1####
${voffset -425}${goto 575}${font URW Chancery L:style=Bold:size=16}${color6}${template2 Jour %A_%d_%B_%Y 2}
###Jour###
${template2 Jour_IconeM ~/conky/meteo/icones 510,170 70x42 2}
${voffset -30}${goto 585}${color red}${template1 Jour_Temp 2}°${color1}  Pluie:${template1 Jour_ProbPrec 2}% - ${template1 Jour_QPluie 2}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Jour_CondMeteo 2}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Jour_IconeV ~/conky/meteo/icones/vent 580,223 30x30 2}
${template2 Jour_IconeR ~/conky/meteo/icones/vent 735,223 30x30 2}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Jour_VentDirP 2} ${template1 Jour_VentForce 2}km/h${goto 690}${template1 Jour_VentDirP 2} ${template1 Jour_VentRafales 2}km/h
###Nuit###
${template2 Nuit_IconeM ~/conky/meteo/icones 510,268 70x42 2}
${voffset -20}${goto 585}${color lightblue}${template1 Nuit_Temp 2}°${color1}  Pluie:${template1 Jour_ProbPrec 2}% - ${template1 Jour_QPluie 2}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Nuit_CondMeteo 2}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Nuit_IconeV ~/conky/meteo/icones/vent 580,313 30x30 2}
${template2 Nuit_IconeR ~/conky/meteo/icones/vent 735,313 30x30 2}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Nuit_VentDirP 2} ${template1 Nuit_VentForce 2}km/h${goto 690}${template1 Nuit_VentDirP 2} ${template1 Nuit_VentRafales 2}km/h
####J+2####
${goto 575}${font URW Chancery L:style=Bold:size=16}${color6}${template2 Jour %A_%d_%B_%Y 3}
###Jour###
${template2 Jour_IconeM ~/conky/meteo/icones 510,390 70x42 3}
${voffset -30}${goto 585}${color red}${template1 Jour_Temp 3}°${color1}  Pluie:${template1 Jour_ProbPrec 3}% - ${template1 Jour_QPluie 3}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Jour_CondMeteo 3}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Jour_IconeV ~/conky/meteo/icones/vent 580,437 30x30 3}
${template2 Jour_IconeR ~/conky/meteo/icones/vent 735,437 30x30 3}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Jour_VentDirP 3} ${template1 Jour_VentForce 3}km/h${goto 690}${template1 Jour_VentDirP 3} ${template1 Jour_VentRafales 3}km/h
###Nuit###
${template2 Nuit_IconeM ~/conky/meteo/icones 510,483 70x42 2}
${voffset -20}${goto 585}${color lightblue}${template1 Nuit_Temp 3}°${color1}  Pluie:${template1 Jour_ProbPrec 3}% - ${template1 Jour_QPluie 3}mm
${voffset -10}${goto 550}${font Arial:size=10}${color3}${template1 Nuit_CondMeteo 3}
${goto 555}${font URW Chancery L:style=Bold:size=16}${color1}Vent${goto 690}Rafales
${template2 Nuit_IconeV ~/conky/meteo/icones/vent 580,530 30x30 3}
${template2 Nuit_IconeR ~/conky/meteo/icones/vent 735,530 30x30 3}
${font URW Chancery L:style=Bold:size=14}${voffset -65}${goto 555}${color yellow}${template1 Nuit_VentDirP 3} ${template1 Nuit_VentForce 3}km/h${goto 690}${template1 Nuit_VentDirP 3} ${template1 Nuit_VentRafales 3}km/h
${color ffe595}${hr 2}${font}
###PRÉVISIONS SIMPLIFIÉES RESTE DE LA SEMAINE###
###AFFICHAGE DES JOURS###
${font Radio Space:style=Bold:size=24}${color yellow}${goto 220}RESTE DE LA SEMAINE${goto 900}${color red}PHOTO SAT${goto 1220}ORAGES
${voffset -15}${color ffe595}${hr 2}
${voffset -28}${font URW Chancery L:style=Bold:size=16}${color6}${goto 40}${template2 Jour %A 4}${goto 260}${template2 Jour %A 5}${goto 480}${template2 Jour %A 6}${goto 700}${template2 Jour %A 7}
###AFFICHAGE DES ICONES###
${template2 Jour_IconeM ~/conky/meteo/icones 0,667 70x42 4}
${template2 Jour_IconeM ~/conky/meteo/icones 220,667 70x42 5}
${template2 Jour_IconeM ~/conky/meteo/icones 440,667 70x42 6}
${template2 Jour_IconeM ~/conky/meteo/icones 655,667 70x42 7}
###AFFICHAGE DES TEMPERATURES###
${voffset -88}${goto 40}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 4}°${goto 255}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 5}°${goto 475}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 6}°${goto 695}${color1}Mini : ${color lightblue}${template1 Nuit_Temp 7}°
${voffset -10}${goto 40}${color1}Maxi : ${color red}${template1 Jour_Temp 4}°${goto 255}${color1}Maxi : ${color red}${template1 Jour_Temp 5}°${goto 475}${color1}Maxi : ${color red}${template1 Jour_Temp 6}°${goto 695}${color1}Maxi : ${color red}${template1 Jour_Temp 7}°
${image ~/conky/meteo/icones/jour/ho.png -p 0,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 215,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 435,720 -s 30x18}
${image ~/conky/meteo/icones/jour/ho.png -p 655,720 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 0,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 215,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 435,702 -s 30x18}
${image ~/conky/meteo/icones/jour/co.png -p 655,702 -s 30x18}
###AFFICHAGE DES CONDITIONS###
${voffset -240}${font Arial:size=10}${color3}${template1 Jour_CondMeteo1se 4}${goto 250}${template1 Jour_CondMeteo1se 5}${goto 470}${template1 Jour_CondMeteo1se 6}${goto 690}${template1 Jour_CondMeteo1se 7}
${template1 Jour_CondMeteo2se 4}${goto 250}${template1 Jour_CondMeteo2se 5}${goto 470}${template1 Jour_CondMeteo2se 6}${goto 690}${template1 Jour_CondMeteo2se 7}
###AFFICHAGE DU VENT###
${template2 Jour_IconeV ~/conky/meteo/icones/vent 60,672 30x30 4}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 280,672 30x30 5}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 500,672 30x30 6}
${template2 Jour_IconeV ~/conky/meteo/icones/vent 720,672 30x30 7}
${voffset -170}${font URW Chancery L:style=Bold:size=14}${color ffe595}${goto 110}${template1 Jour_VentForce 4}km/h${goto 330}${template1 Jour_VentForce 5}km/h${goto 550}${template1 Jour_VentForce 6}km/h${goto 770}${template1 Jour_VentForce 7}km/h
###AFFICHAGE PRECIPITATIONS###
${voffset 80}PRECIPITATIONS${goto 220}PRECIPITATIONS${goto 440}PRECIPITATIONS${goto 660}PRECIPITATIONS
${image ~/conky/meteo/icones/pluie.png -p 0,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 40,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 220,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 260,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 440,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 480,820 -s 20x20}
${image ~/conky/meteo/icones/pluie.png -p 660,800 -s 20x20}
${image ~/conky/meteo/icones/neige.png -p 700,820 -s 20x20}
${voffset -202}${color1}${goto 40}${template1 Jour_QPluie 4}mm${goto 260}${template1 Jour_QPluie 5}mm${goto 480}${template1 Jour_QPluie 6}mm${goto 700}${template1 Jour_QPluie 7}mm
${voffset -7}${goto 80}${template1 Jour_QNeige 4}cm${goto 300}${template1 Jour_QNeige 5}cm${goto 520}${template1 Jour_QNeige 6}cm${goto 740}${template1 Jour_QNeige 7}cm
## Affichage en RGB ou en IR en fonction  de l'heure (pour affichage IR de nuit) ##
${if_match ${template1 CoucherSoleil}>${exec echo $(($(($(date +%H)*60))+$(date +%M)))}}${if_match ${exec echo $(($(($(date +%H)*60))+$(date +%M)))}>${template1 LeverSoleil}}${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg -f /tmp/image1.jpg -x 300x235}${else}${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg -f /tmp/image1.jpg -x 300x235}${endif}${else}${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg -f /tmp/image1.jpg -x 300x235}${endif}
${image /tmp/image1.jpg -p 820,600 -s 300x235 -f 60}
## Affichage carte des Orages ##
${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+400+90 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_MPE-westernEurope.jpg -f /tmp/image2.jpg -x 300x235}
## Affichage carte Type Atlas + suivi des Incendies ##
#${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+400+50 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_FIRE-westernEurope.png -f /tmp/image2.jpg -x 300x235}
## Affichage carte Radar ##
#${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+50+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-Microphysics-centralEurope.jpg -f /tmp/image2.jpg -x 300x235}
## Affichage carte Radar 2 ##
#${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+50+10 -i http://images.intellicast.com/WxImages/Satellite/hieusat.gif -f /tmp/image2.jpg -x 300x235}
## Affichage carte Couverture Nuageuse 1 ##
#${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+50+10 -i http://www.meteo-mc.fr/dedie/Images/sat/satireu1.gif -f /tmp/image2.jpg -x 300x235}
## Affichage carte Couverture Nuageuse 2 ##
#${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+50+10 -i http://www.meteo.be/meteo/view/fr/113200-ajaxcontroller.html/6723348/image.png?position=19 -f /tmp/image2.jpg -x 300x235}
## Affichage carte Infra Rouge ##
#${execpi 1200 perl ~/conky/script/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg -f /tmp/image2.jpg -x 300x235}
${image /tmp/image2.jpg -p 1122,600 -s 300x235 -f 60}

${execpi 3600 ~/conky/script/vigilance.sh}
${image ~/conky/meteo/icones/vigilance3.png -p 920,150 -s 350x351}
${image ~/conky/meteo/icones/vigilance_legendes2.png -p 920,500 -s 350x95}

code vigilance.sh

#!/bin/bash

path=`dirname $0`
DirShell="$HOME/conky/meteo"

rm ${DirShell}/icones/vigilance3.png

wget -q -O ${DirShell}/icones/vigilance.gif http://www.meteoalarm.eu/map.php?iso=FR&data=0&rnd=1328487696

sleep 3
convert ${DirShell}/icones/vigilance.gif -filter Lanczos ${DirShell}/icones/vigilance.png
convert ${DirShell}/icones/vigilance.png -crop 125x17+55+0\! ${DirShell}/icones/etiquette.png
mogrify -fuzz 40% -transparent white ${DirShell}/icones/etiquette.png
convert ${DirShell}/icones/vigilance.png -crop 85x118+14+407\! ${DirShell}/icones/corse.png
convert ${DirShell}/icones/vigilance.png -crop 500x508+49+24\! ${DirShell}/icones/vigilance1.png
convert ${DirShell}/icones/vigilance1.png -page +0+383 ${DirShell}/icones/corse.png -flatten ${DirShell}/icones/vigilance2.png
mogrify -resize "497x505" -filter Lanczos ${DirShell}/icones/vigilance2.png
convert ${DirShell}/icones/vigilance2.png -page +3+3 ${DirShell}/icones/etiquette.png -flatten ${DirShell}/icones/vigilance2.png
convert ${DirShell}/icones/vigilance2.png\
          -format 'roundrectangle 1,1 %[fx:w+4],%[fx:h+4] 15,15'\
          info: > ${DirShell}/icones/rounded_corner.mvg
convert ${DirShell}/icones/vigilance2.png -border 3 -alpha transparent \
          -background none -fill white -stroke none -strokewidth 0 \
          -draw "@${DirShell}/icones/rounded_corner.mvg"    ${DirShell}/icones/rounded_corner_mask.png
convert ${DirShell}/icones/vigilance2.png -border 3 -alpha transparent \
          -background none -fill none -stroke black -strokewidth 3 \
          -draw "@${DirShell}/icones/rounded_corner.mvg"    ${DirShell}/icones/rounded_corner_overlay.png
convert ${DirShell}/icones/vigilance2.png -matte -bordercolor none -border 3  \
          ${DirShell}/icones/rounded_corner_mask.png -compose DstIn -composite \
          ${DirShell}/icones/rounded_corner_overlay.png -compose Over -composite \
          ${DirShell}/icones/vigilance3.png

rm ${DirShell}/icones/vigilance.gif
rm ${DirShell}/icones/vigilance.png
rm ${DirShell}/icones/vigilance1.png
rm ${DirShell}/icones/vigilance2.png
rm ${DirShell}/icones/etiquette.png
rm ${DirShell}/icones/corse.png

code imagesat.pl

#!/usr/bin/perl -w

use strict;
use warnings;

use constant VERSION => 0.04;

if(scalar @ARGV < 6) {
   &help;
}

my @image_web;
my @dimensions;
my @file_name;
my @Redim;
my $nb;


# Détermination des arguments
$nb = 0;
for(my $i = 0; $i < scalar @ARGV; $i +=2) {

   if($ARGV[$i] eq "-s") {
           $nb = $nb + 1;
      $dimensions[$nb] = $ARGV[$i + 1];
   }
   elsif($ARGV[$i] eq "-i") {
      $image_web[$nb] = $ARGV[$i + 1];
   }
   elsif($ARGV[$i] eq "-f") {
      $file_name[$nb] = $ARGV[$i + 1];
   }
   elsif($ARGV[$i] eq "-x") {
      $Redim[$nb] = $ARGV[$i + 1];
   }
   else {
      print STDERR "Argument $ARGV[$i] inconnu\n";
      &help;
   }
}

for(my $j = 1; $j <= $nb; $j +=1) {
    # Détermination du nom de l'image
    my @decoupage = split "/", $image_web[$j];
    my $image_sat = $decoupage[$#decoupage];
    @decoupage = split "/", $file_name[$j];
    my $chemin = substr($file_name[$j], 0, length($file_name[$j]) - 1 - length($decoupage[$#decoupage]));
    # On regarde si le fichier existe déjà
    if(-e "$chemin/$image_sat") {
       # Récupération des informations de l'image
       my @infos_ancienne_image = (stat("$chemin/$image_sat"))[7..10];
    
       # Téléchargement de l'image si besoin
       &telecharger($image_web[$j], "-m -nd", "$chemin/$image_sat");
       
       # Récupération des informations de l'image
       my @infos_nouvelle_image = (stat("$chemin/$image_sat"))[7..10];
    
       # Comparaison des informations pour déterminer si on a téléchargé une image
       my $comparaison = 0;
       for(my $i = 0; $i < scalar @infos_ancienne_image; $i++) {
          if($infos_ancienne_image[$i] != $infos_nouvelle_image[$i]) {
             $comparaison++;
             last;
          }
       }
    
       # Si l'image est nouvelle, il faut refaire un découpage
       if($comparaison) {
          &nouvelle_image("$chemin/$image_sat", $dimensions[$j], $file_name[$j], $Redim[$j]);
       }
    }
    else {
       &telecharger($image_web[$j], "", "$chemin/$image_sat");
       &nouvelle_image("$chemin/$image_sat", $dimensions[$j], $file_name[$j], $Redim[$j]);
    }
}
    #######################
    # Début des fonctions #
    #######################
    
sub help {
   print "Utilisation : $0 [arguments]\n"
      . "arguments :\n"
      . "  -i : Permet d'indiquer l'emplacement où se trouve l'image\n"
      . "  -s : Permet d'indiquer le découpage de l'image\n"
      . "  -f : Permet d'indiquer où stoquer l'image créé et son nom\n";
   exit(0);
}

sub nouvelle_image {
   my ($image, $decoupage, $sauvegarde, $Redim) = @_;

   # Sauvegarde de l'image actuelle
   system("cp $image imagesattmp.jpg");
   # Découpage de l'image
   system("convert imagesattmp.jpg -crop $decoupage -resize $Redim $sauvegarde");
   # Suppression de l'image temporaire
   unlink "imagesattmp.jpg";
}
sub telecharger {
   my ($emplacement, $options, $sauvim) = @_;

   system("wget -q $options $emplacement -O $sauvim");
}

__END__

=encoding utf8

=head1 Nom

Imagesat

=head1 SYNOPSIS

Il permet de télécharger et réduire une image

=head1 DESCRIPTION

Ce script Perl permet de télécharger une image, de la redimensionner pour ensuite l'afficher dans conky. Le script prend B<obligatoirement> deux paramètres à savoir l'emplacement de l'image à
télécharger ainsi que les dimensions de la future image.
Les différentes images (en fonction de vos envies) où vous pouvez trouver votre bonheur se trouvent ici :
L<http://oiswww.eumetsat.org/IPPS/html/latestImages.html>

=head1 AUTEUR

Chipster Julien

=head1 Programmes externes

Pour fonctionner, ce script a besoin de deux logiciels :

=over 4

=item wget

=item imagemagick

=back

=head1 UTILISATION

Ce script s'utilise comme ceci :

C<${exec perl Imagesat} [arguments]>

Si vous avez fait un chmod +x Imagesat :

C<${exec ./Imagesat} [arguments]>

[arguments] doit être défini comme ceci :

=over 4

=item -i http://......../mon_image.jpg

=item -s 200x200+0+0

=back

=head2 Exemple

C<${exec perl Imagesat -s 1274x657+0+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}>

Allez, je suis sympa, voici comment ça s'utilise dans conky après la balise TEXT
${exec perl /home/user/.conky/Imagesat -s 1274x657+0+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image /home/user/.conky/image.jpg -p -5,-5 -s 400x220}

=head1 BOGUES

Aucun connu actuellement

=head1 Évolutions

=head1 Changelog

=item1 Rajout de l'option -q à wget. Il était trop bavard :D Ceci avait tendance à faire boguer gnome

=over 4

=item 30/08/2009

Création du script

=item Big Bang

Création de l'univers connu :D

=back 

Retour terminal

┌─( didier ) - ( 3.2.0-26-generic ) - ( ~ )
└─> conky -c conkyrc_test
Conky: forked to background, pid is 19041
┌─( didier ) - ( 3.2.0-26-generic ) - ( ~ )
└─> 
Conky: desktop window (1200003) is subwindow of root window (15a)
Conky: window type - override
Conky: drawing to created window (0x3e00001)
Conky: drawing to double buffer
    version = v4.3
    web = http://www.accuweather.com/fr/fr/argenteuil/133593/weather-forecast/133593
    Pévision Nb jours = 7
    Pévision Matin = non
    Pévision Après Midi = oui
    Pévision Soirée = non
    Pévision Nuit = oui
    Délais = 300
    Chemin de travail = /tmp
    Palier = 20
    Chemin de sauvegarde = /home/didier/conky/meteo/
Condition courante Ok
Prévision 1 Ok
Prévision 2 Ok
Prévision 3 Ok
Prévision 4 Ok
Prévision 5 Ok
Prévision 6 Ok
Prévision 7 Ok
Apres Midi 1 Ok
Apres Midi 2 Ok
Apres Midi 3 Ok
Apres Midi 4 Ok
Apres Midi 5 Ok
Apres Midi 6 Ok
Apres Midi 7 Ok
Nuit 1 Ok
Nuit 2 Ok
Nuit 3 Ok
Nuit 4 Ok
Nuit 5 Ok
Nuit 6 Ok
Nuit 7 Ok
lunaison Ok

1341035422.png

Police Radio Space
le pack icônes supplémentaire

P.S. : j'ai une idée de où pourrais venir le problème d'attente après redémarrage du PC (les execpi et execp pourraient en être la cause)

Hors ligne

#1093 Le 30/06/2012, à 08:29

jpdipsy

Re : [Conky] Alternative à weather.com (2)

Didier

J'ai pas bien compris l'histoire des minutes pour le lever et coucher ?

Pour les scripts d'images sat. de tous poils tu as vu mon post c'est réduit de façon drastique et simplement avec convert  (en 4 ou cinqs lignes on à le même résultat sans utiliser perl  ).

Voila le code pour eumetsat au lieu du script en perl avec en plus une création d'image plasma au cas ou wget à échoué ou autre problème

#!/bin/bash

# Crée par JPDipsy 
# script de recupération imagesat couverture nuageuse http://oiswww.eumetsat.org
nomimage="imagesat-eumetsat"
tailleimage="300x235"  # taille de votre image finale

# recup image sat
wget  -O  /tmp/$nomimage.jpg "http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg"
if [[ -e /tmp/$nomimage.jpg ]] ; then
    # decoupage de la partie utile
    convert /tmp/$nomimage.jpg -filter Lanczos -crop  1274x657+0+110\!  -resize $tailleimage\! /tmp/$nomimage.png
    # ici vous pouvez habiller votre image 
    rm /tmp/$nomimage.jpg
else
    # comme ça votre conky aura toujours une image au cas ou 
    convert -size 1274x657 plasma:  -resize $tailleimage\! /tmp/$nomimage.png
    # ici vous pouvez habiller votre image 
fi

Dernière modification par jpdipsy (Le 30/06/2012, à 09:22)

Hors ligne

#1094 Le 30/06/2012, à 09:24

Didier-T

Re : [Conky] Alternative à weather.com (2)

jpdipsy a écrit :

Didier

J'ai pas bien compris l'histoire des minutes pour le lever et coucher ?

Pour les scripts d'images sat. de tous poils tu as vu mon post c'est réduit de façon drastique et simplement avec convert  (en 4 ou cinqs lignes on à le même résultat sans utiliser perl  ).

Voila le code pour eumetsat au lieu du script en perl avec en plus une création d'image plasma au cas ou wget à échoué ou autre problème

#!/bin/bash
# Crée par JPDipsy 
# script de recupération imagesat couverture nuageuse http://oiswww.eumetsat.org
nomimage="imagesat-eumetsat"
tailleimage=60 # ceci est en pourcentage

# recup image sat
wget  -q -O  /tmp/$nomimage.jpg "http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg"
if [[ -e /tmp/$nomimage.jpg ]] ; then
    # decoupage de la partie utile
    convert /tmp/$nomimage.jpg -filter Lanczos -crop  1274x657+0+110\!  -resize $tailleimage% /tmp/$nomimage.png
    rm /tmp/$nomimage.jpg
else
    # comme ça votre conky aura toujours une image au cas ou 
    convert -size 1274x657 plasma:  -resize $tailleimage% /tmp/$nomimage.png
fi

Je vais regarder ça de plus près, mais je crois préférable de conserver l'ancienne image si il y a un soucis avec wget.

Hors ligne

#1095 Le 30/06/2012, à 09:40

jpdipsy

Re : [Conky] Alternative à weather.com (2)

Didier-T a écrit :

Je vais regarder ça de plus près, mais je crois préférable de conserver l'ancienne image si il y a un soucis avec wget.

C'est pour ça que si wget ne télécharge pas l'image une plasma est crée au moins on voit si il y'a un probleme mais bon c'est une question de choix juste à enlever rm .......
On peut aussi si on veut passer le format d'image en argument comme ça pas besoin de se casser le c.. dans le conky

tailleimage=$1 dans le script et passage par  nomduscript 300x235 par ex.

ce qui donne par ex:

#!/bin/bash

# Crée par JPDipsy 
# script de recupération imagesat couverture nuageuse http://oiswww.eumetsat.org

nomimage="imagesat-eumetsat"
tailleimage=$1  # taille de votre image finale

# recup image sat
wget  -O  /tmp/$nomimage.jpg "http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg"
if [[ -e /tmp/$nomimage.jpg ]] ; then
    # decoupage de la partie utile
    convert /tmp/$nomimage.jpg -filter Lanczos -crop  1274x657+0+110\!  -resize $tailleimage\! /tmp/$nomimage.png
    # ici vous pouvez habiller votre image 
    #rm /tmp/$nomimage.jpg
else
    # comme ça votre conky aura toujours une image au cas ou 
    convert -size 1274x657 plasma:  -resize $tailleimage\! /tmp/$nomimage.png
    # ici vous pouvez habiller votre image 
fi

Hors ligne

#1096 Le 30/06/2012, à 10:05

jpdipsy

Re : [Conky] Alternative à weather.com (2)

et pour vigilance

#!/bin/bash

# Crée par JPDipsy 
# script de recupération imagesat couverture nuageuse  http://www.meteoalarm.eu

nomimage="imagesat-vigilance"
tailleimage=$1  # taille de votre image finale

# recup image sat
wget  -O  /tmp/$nomimage.gif "http://www.meteoalarm.eu/map.php?iso=FR&data=0&rnd=1328487696"
if [[ -e /tmp/$nomimage.gif ]] ; then
    # decoupage de la partie utile
    convert /tmp/$nomimage.gif -filter Lanczos -crop   564x508+0+24\!  -resize $tailleimage\! /tmp/$nomimage.png
    # ici vous pouvez habiller votre image 
    #rm /tmp/$nomimage.gif
else
    # comme ça votre conky aura toujours une image au cas ou 
    convert -size 564x508 plasma:  -resize $tailleimage\! /tmp/$nomimage.png
    # ici vous pouvez habiller votre image 
fi

sauvegarder sous vigilance.sh et lancer vigilance.sh 350x351 par ex:

Hors ligne

#1097 Le 30/06/2012, à 11:00

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ jpdipsy,

Ton script retravaillé a ma sauce.

#!/bin/bash
# Crée par JPDipsy 
# script de recupération imagesat couverture nuageuse http://oiswww.eumetsat.org
crop=$1
adress=$2
nomimage=$3
resize=$4

# recup image sat
wget -q -O $nomimage.jpg $adress
if [[ -e $nomimage.jpg ]] ; then
    # decoupage de la partie utile
    echo "ok"
    convert $nomimage.jpg -filter Lanczos -crop $crop\! -resize $resize $nomimage.png
    rm $nomimage.jpg
else
    # comme ça votre conky aura toujours une image au cas ou 
    convert -size 1274x657 plasma: -resize $resize $nomimage.png
fi

comme tu peut le constater je n'ai pas modifié grand chose.

exemple de ligne d'appel

${execpi 1200 bash ~/conky/script/imagesat.sh 1274x657+400+90 http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_MPE-westernEurope.jpg /tmp/image2 300x235}

retaille, nome et redimensionne. wink

fait le travaille aussi bien que le script en perl, et certainement un peut plus vite, merci jpdipsy.

Hors ligne

#1098 Le 30/06/2012, à 11:12

jpdipsy

Re : [Conky] Alternative à weather.com (2)

Didier-T a écrit :

fait le travaille aussi bien que le script en perl, et certainement un peut plus vite, merci jpdipsy.

C'est surtout  Phyllinux qui va être content ce sera plus simple.

A+

Hors ligne

#1099 Le 30/06/2012, à 17:55

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ ragamatrix,

j'ai réglé le soucis pour le démarrage du conky avant 30 minute.

En fait il s'agit d'un bug de conky réglé avec le passage en 1.9 (seul soucis ubuntu reste en 1.8 dans son dépôt)

La solution passer par le "Gestionnaire de paquets synaptique"
puis chercher conky

cliquer sur conky puis 'ctrl+e' forcer version 1.9, faire la même chose avec conky-std
sélectionner conky-all pour désinstallation
et Appliquer

Hors ligne

#1100 Le 01/07/2012, à 14:07

Didier-T

Re : [Conky] Alternative à weather.com (2)

Attention réalisé sans trucage.

Un conky météo extra large avec prévision sur 7 jours, oui vous avez bien entendu, 7 jours et trois clicher satellite, dont 1 a la demande, cliquer sur l'image si dessous pour assister au spectacle !


comme vous pouvez le constater les deux conkys nécessaire ne dépasse pas 4% d'utilisation processeur à eux deux, de plus le clic droit reste disponible cool

Et le petit pack qui vas bien

je pense le coller sur le premier post

Dernière modification par Didier-T (Le 01/07/2012, à 14:11)

Hors ligne