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.

#926 Le 11/06/2012, à 01:30

Pacifick_FR42

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

Par contre, j'ai du mal à comprendre le fonctionnement de la carte Radar...

${template1 Maj}
${voffset 34}${GOTO 66}${font ubuntu:bold:size=12}${color0}Target Radar${font}
## Affichage en RGB ou en IR en fonction  de l'heure (pour affichage IR de nuit) ##
${if_match ${exec echo $(expr $(sed -n "46p" ~/.ConkyPaul/meteo/prevision1)*60+$(sed -n "47p" ~/.ConkyPaul/meteo/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/" ~/.ConkyPaul/meteo/prevision1|sed -n '44p')*60+$(sed -n "45p" ~/.ConkyPaul/meteo/prevision1)|bc -l)}}${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image ~/.ConkyPaul/scripts/image.jpg -p 0,80 -s 240x220}${else}${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/.ConkyPaul/scripts/image.jpg -p 0,80 -s 240x220}${endif}${else}${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/.ConkyPaul/scripts/image.jpg -p 0,80 -s 240x220}${endif}

## Affichage carte des Orages ##
${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+400+90 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_MPE-westernEurope.jpg}${image ~/.ConkyPaul/scripts/image.jpg -p 0,80 -s 240x220}

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

## Affichage carte Radar1 ##
${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+50+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-Microphysics-centralEurope.jpg}${image ~/.ConkyPaul/scripts/image.jpg -p 0,80 -s 240x220}

## Affichage carte Radar2 ##
${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+50+10 -i http://images.intellicast.com/WxImages/Satellite/hieusat.gif}${image ~/.ConkyPaul/scripts/image.jpg -p 0,80 -s 240x220}

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

Il semble que j'ai toujours la même images...
Si tu peux m'éclairer ? wink

Hors ligne

#927 Le 11/06/2012, à 12:50

Pacifick_FR42

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

Bon... je les cumules... maintenant, j'ai ça :

convert: invalid distance too far back `/tmp/lune.png' @ error/png.c/MagickPNGErrorHandler/1309.
convert: Image corrompue `/tmp/lune.png' @ error/png.c/ReadPNGImage/3290.
convert: nom de fichier d'image absent `/tmp/lune.png' @ error/convert.c/ConvertImageCommand/3011.

... l'image en question est bien dans /tmp...
ça concerne ce conky :

# Cadre 1

# Default Fonts
use_xft yes
xftfont DejaVu Sans:size=10
override_utf8_locale yes

# Performance Settings
update_interval 1
total_run_times 0
double_buffer yes
no_buffers yes
net_avg_samples 2
text_buffer_size 2048

# Window Settings
own_window_argb_visual yes
own_window_argb_value 0
own_window yes
own_window_transparent no
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_title bargraph2

# Window border
draw_borders no
draw_shades no
minimum_size 650 338
maximum_width 650

# Default Color
default_color A0A0FF

# Color Title.
color0 DD3A21
color1 FF2020
color2 6090FF
color3 00FF00
color4 FF0000

# écart avec le bord x=gauche ou droit y= haut ou bas
minimum_size 254 252
maximum_width 254
alignment tl
gap_x 854
gap_y 778


show_graph_scale no
show_graph_range no


# -- Déclaration template -- #
    template0 ${image ~/conky/scripts/images/\1 -p \2 -s \3} # -- images fond -- #
    template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
    template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icônes météo -- \2=répertoire icônes \3=position \4=taille \5=jour (pour les prévisions) #
    template3 ${lua Lune_\1} 
    template4 ${lua_parse Images_\1 \2 \3 60 \4} # -- Appelle image -- \2=position \3=taille \4=jour (pour les prévisions) #
    
    lua_load ~/.ConkyPaul/scripts/meteo.lua
    lua_startup_hook init ~/.ConkyPaul/scripts/meteo.cfg
#    lua_load     ~/.ConkyPaul/scripts/Clic_info.lua

TEXT
${template1 Maj}
${font LED_mono :style=Medium:size=40}${color 6060FF}${goto 24}${time %H}:${goto 100}${time %M}:${font LED_mono :size=25:style=Medium}${color 808080}${goto 182}${time %S}
${GOTO 16}${color yellow}${font ubuntu size=12}${exec date "+%A %d %B %Y"|sed 's/^.\| [a-z]/\U&/g'}
${goto 16}${color green}${font ubuntu:bold:size=14}${template1 Ville}
${GOTO 16}${font ubuntu:bold:size=12}${color white}${template1  CondMeteo}
${GOTO 16}${font ubuntu:size=10}Pression${GOTO 112}: ${template1  Pression}
${GOTO 16}${color white}Soleil${GOTO 112}: ${template1  HLeverSoleil}h${template1  MLeverSoleil}m - ${template1  HCoucherSoleil}h${template1  MCoucherSoleil}m
${GOTO 16}Risque Pluie${GOTO 112}: ${template1  Jour_ProbPrec}%
${GOTO 16}Risque Orage${GOTO 112}: ${template1  Jour_ProbOrage}%
${GOTO 16}Taux Humidité${GOTO 112}: ${template1  Humidite}%
${GOTO 16}${color white}Indice UV${GOTO 112}: ${color ff5050}${template1  Uv}${color}
${GOTO 16}Tmp Max ${color ff5050}${template1  Jour_Temp}°${color white} - Temp Min ${color 6060ff}${template1  Nuit_Temp}°

Si quelqu'un a une idée... wink

Dernière modification par Pacifick_FR42 (Le 11/06/2012, à 12:51)

Hors ligne

#928 Le 11/06/2012, à 13:04

Didier-T

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

@ Pacifick_FR42,

Dit mois combien de conky avec le script météo fait tu tourner un même temps ?

Si il y en a plusieurs un seul doit avoir cette commande ci.

${template1 Maj}

Les autres doivent avoir ceci a la place.

${template1 horsligne}

Sinon sa fous le bazars lors des mises à jour.

Hors ligne

#929 Le 11/06/2012, à 13:15

Pacifick_FR42

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

Ah ! ok, j'ai compris, merci wink !!

EDIT : Effectivement, ça venait de là, merci encore !
...plus qu'a m'occuper de la carte radar wink

Dernière modification par Pacifick_FR42 (Le 11/06/2012, à 13:18)

Hors ligne

#930 Le 11/06/2012, à 16:59

Didier-T

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

Pacifick_FR42 a écrit :

Ah ! ok, j'ai compris, merci wink !!

EDIT : Effectivement, ça venait de là, merci encore !
...plus qu'a m'occuper de la carte radar wink

Pour ton soucis de carte radar, tu devrais poster ton conky en entier, ainsi que le script qui te permet de récupérer la dite carte, ont sait jamais.

Hors ligne

#931 Le 12/06/2012, à 01:27

Pacifick_FR42

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

Ok, je te donne ça, seulement en changeant les chemins, il est fort probable que j'ai effacé un truc en trop... et comme il y à 2 chemin (dir) différant...

# Cadre 1

# Default Fonts
use_xft yes
xftfont DejaVu Sans:size=10
override_utf8_locale yes

# Performance Settings
update_interval 1
total_run_times 0
double_buffer yes
no_buffers yes
net_avg_samples 2
text_buffer_size 2048

# Window Settings
own_window_argb_visual yes
own_window_argb_value 0
own_window yes
own_window_transparent no
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_title bargraph2

# Window border
draw_borders no
draw_shades no
minimum_size 650 338
maximum_width 650

# Default Color
default_color A0A0FF

# Color Title.
color0 DD3A21
color1 FF2020
color2 6090FF
color3 00FF00
color4 FF0000

# écart avec le bord x=gauche ou droit y= haut ou bas
#minimum_size 270 252
#maximum_width 270
alignment tl
gap_x 1254
gap_y 760


show_graph_scale no
show_graph_range no


# -- Déclaration template -- #
    template0 ${image ~/.ConkyPaul/meteo/images/\1 -p \2 -s \3} # -- images fond -- #
    template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
    template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icônes météo -- \2=répertoire icônes \3=position \4=taille \5=jour (pour les prévisions) #
    template3 ${lua Lune_\1} 
    template4 ${lua_parse Images_\1 \2 \3 60 \4} # -- Appelle image -- \2=position \3=taille \4=jour (pour les prévisions) #
    
    lua_load ~/.ConkyPaul/scripts/meteo.lua
    lua_startup_hook init ~/.ConkyPaul/scripts/meteo.cfg
#    lua_load     ~/.ConkyPaul/scripts/Clic_info.lua

TEXT
${template1 horsligne}
${voffset 34}${GOTO 66}${font ubuntu:bold:size=12}${color0}Target Radar${font}
#${if_match ${exec echo $(expr $(sed -n "46p" ~/.ConkyPaul/meteo/prevision1)*60+$(sed -n "47p" ~/.ConkyPaul/meteo/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/" ~/.ConkyPaul/meteo/prevision1|sed -n '44p')*60+$(sed -n "45p" ~/.ConkyPaul/meteo/prevision1)|bc -l)}}${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+300+110 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-naturalcolor-westernEurope.jpg}${image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220}${else}${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220}${endif}${else}${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+200+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_IR108EColor-westernEurope.jpg}${image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220}${endif}

## Affichage carte des Orages ##
${execpi 5 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+400+90 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_MPE-westernEurope.jpg}${image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220}

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

## Affichage carte Radar1 ##
#${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+50+10 -i http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGB-Microphysics-centralEurope.jpg}${image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220}

## Affichage carte Radar2 ##
#${execpi 1200 perl ~/.ConkyPaul/scripts/imagesat.pl -s 1274x657+50+10 -i http://images.intellicast.com/WxImages/Satellite/hieusat.gif}${image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220}

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

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

Merci wink

Hors ligne

#932 Le 12/06/2012, à 09:00

Phyllinux

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

@ Pacifick_FR42

Pour l'affichage de la carte SAT :
Je vois qu'entre ton post 946 et le dernier, tu as modifié un peu ton conky. En effet, pour ton post précédent, tu disais que tu avais toujours la même image, ce qui est normal, car tu avais supprimé tous les '#' devant tous les affichages possibles.
Dans ce cas, c'est la 1° image qui est chargée et affichée.
Les différentes lignes te permettent de choisir l'image SAT que tu désires, et il ne faut qu'en garder une seule, en fonction de ce que tu veux avoir (carte SAT RGB, couverture nuageuse, carte radar des orages, etc...)
Une fois que tu as choisi celle que tu veux avoir, tu laisses les '#' devant les autres. Si tu veux en changer, il suffit de supprimer le '#', d'enregistrer le conky, et à la prochaine actualisation, c'est celle choisie qui s'affichera.
Tu peux voir l'image qui s'affichera dans ton répertoire dans ton 'Home', sous le nom de fichier 'image.jpg', (si tu n'as pas changé le script imagesat.pl).
Les autres photos SAT précédemment utilisées apparaîtront sous leur nom complet dans le même répertoire. Ce sont les images téléchargées brutes, avant le redécoupage et la mise en forme pour l'affichage dans le conky.

De mon côté, pour ce conky en particulier d'image SAT, j'ai un bug aléatoire, avec régulièrement l'affichage du conky qui ne s'effectue pas, pour cause de problème de segmentation. Pour régler ce problème, dont je n'ai pas identifié la cause, le simple fait de relancer le conky (parfois 2 ou 3 fois de suite sont nécessaires) permet de faire tout rentrer dans l'ordre. Sinon, parfois, il suffit d'effacer toutes les images stockées dans le Home et de relancer le conky pour tout réinitialiser correctement... Les mystères des conkys sont impénétrables !


The ship is sinking normally...

Hors ligne

#933 Le 12/06/2012, à 09:00

Didier-T

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

@ Pacifick_FR42,

Bon a ce que je vois dans ton code il y a au moins trois solutions à ton problème.
la première rapide à mettre en œuvre, mais coûteuse en ressource processeur.
avant TEXT tu ajoute.

imlib_cache_size 0

la seconde un peut plus délicate à mettre en œuvre, mais bien plus discrète sur l'impacte système.
à chaque commande que tu souhaite rafraîchir de manière régulière"${image" tu ajoute ceci "-f 60"
Par exemple:

image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220 -f 60

mettra a jour ton image toutes les 60 secondes

et la troisième solution un compromis entre les deux précédentes.
avant TEXT

imlib_cache_flush_interval 60

mettra a jour toutes les images affiché toutes les 60 secondes

Attention il ne faut pas utiliser plusieurs de ces solutions ensembles, sa risquerait de mettre le bazars dans ton conky.

Dernière modification par Didier-T (Le 12/06/2012, à 09:02)

Hors ligne

#934 Le 12/06/2012, à 09:22

Phyllinux

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

Didier-T a écrit :

@ Pacifick_FR42,

Bon a ce que je vois dans ton code il y a au moins trois solutions à ton problème.
la première rapide à mettre en œuvre, mais coûteuse en ressource processeur.
avant TEXT tu ajoute.

imlib_cache_size 0

la seconde un peut plus délicate à mettre en œuvre, mais bien plus discrète sur l'impacte système.
à chaque commande que tu souhaite rafraîchir de manière régulière"${image" tu ajoute ceci "-f 60"
Par exemple:

image ~/.ConkyPaul/meteo/image.jpg -p 0,80 -s 240x220 -f 60

mettra a jour ton image toutes les 60 secondes

et la troisième solution un compromis entre les deux précédentes.
avant TEXT

imlib_cache_flush_interval 60

mettra a jour toutes les images affiché toutes les 60 secondes

Attention il ne faut pas utiliser plusieurs de ces solutions ensembles, sa risquerait de mettre le bazars dans ton conky.


Juste un petit commentaire sur ce qu'indique Didier_T :
Compte tenu du fait que les sources de récupération des images satellites ne sont mises à jour au mieux que toutes les heures, ou bien plus souvent toutes les 3 heures, il n'est pas nécessaire de rafaraichir aussi souvent, et cela soulagera le processeur big_smile
Aussi, on peut changer le chiffre '60' par '3600' sans problème.


The ship is sinking normally...

Hors ligne

#935 Le 12/06/2012, à 09:58

Phyllinux

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

Juste pour montrer les différentes Images SAT possibles :
Photo RGB (de jour)
imagergb.th.jpg
Photo IR (de nuit)
imageirn.th.jpg
Photo type Atlas - Suivi des incendies (un point rouge indique la localisation des incendies, lorsqu'il y en a en cours. Le Sud de la France et la Corse sont souvent concernés en été)
imageatlasincendies.th.jpg
Photo SAT des orages
imageorages.th.jpg
Photo SAT Couverture Nuageuse 1
imagenuages1.th.jpg
Photo SAT Couverture Nuageuse 2 - Origine Météo Belge
imagenuages2.th.jpg
Photo SAT Radar 1
imageradar1.th.jpg
Photo SAT Radar 2
imageradar2.th.jpg

Il suffit donc de faire son choix dans le conky.


The ship is sinking normally...

Hors ligne

#936 Le 12/06/2012, à 10:22

Didier-T

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

Phyllinux a écrit :

...
Juste un petit commentaire sur ce qu'indique Didier_T :
Compte tenu du fait que les sources de récupération des images satellites ne sont mises à jour au mieux que toutes les heures, ou bien plus souvent toutes les 3 heures, il n'est pas nécessaire de rafaraichir aussi souvent, et cela soulagera le processeur big_smile
Aussi, on peut changer le chiffre '60' par '3600' sans problème.

En fait je choisi toujours 60 secondes car dans le pire des cas après la mise à jour de l'image il ne faudra attendre que 1 minute avant de la voir apparaître (un soucis d'accès à un site internet est si vite venu).

Mais comme le dit si justement Phyllinux, plus le délais entre deux mises à jour de l'affichage est long moins tu utiliseras ton processeur, a toi de voir en fonction de ton PC.

Hors ligne

#937 Le 12/06/2012, à 11:21

Pacifick_FR42

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

Merci pour tous ! Je vais regarder ça de près wink

Hors ligne

#938 Le 12/06/2012, à 15:28

Didier-T

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

Bonjour a tous et toutes (je désespère pas big_smile ),

Je viens de mettre en ligne un pack de distribution facile pour ceux qui ne sont pas alaise avec l'ordinateur, il est trouvable sur la première page et dans ma signature.

En espérant que sa faciliteras la vie des nouveaux venu.

Hors ligne

#939 Le 13/06/2012, à 00:13

Pacifick_FR42

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

Je cherche un début d'idée pour afficher d'éventuelle alerte météo (weather.com ?)
Si quelqu'un à une idée.. merci smile

Hors ligne

#940 Le 13/06/2012, à 07:25

Didier-T

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

Pacifick_FR42 a écrit :

Je cherche un début d'idée pour afficher d'éventuelle alerte météo (weather.com ?)
Si quelqu'un à une idée.. merci smile

Tu peut utiliser un flux rss, celui ci par exemple
http://meteoalerte.com/france/rss.php?dep=95&show=7
tu remplace 95 par ton département
et 7 par le nombre d’alerte que tu veux voir

ensuite pour le conky c'est simple

# Use Xft?
use_xft yes
xftfont Trebuchet MS:size=9
xftalpha 0.8
text_buffer_size 2048
background yes
# Update interval in seconds
update_interval 1
xftalpha 0.8
own_window_argb_visual yes
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

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

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

# Minimum size of text area
minimum_size 180 0

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
# default_color white
# own_window_colour white


# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

#borders
draw_borders no
border_margin 4

#position
gap_x 15
gap_y 50
alignment tl

default_color d8d8d8
color1 white
default_shade_color 000000
default_outline_color d9d7d6

TEXT
${color1}${font Monospace:size=10:bold}Alerte Météo ${font}${color}
${rss http://meteoalerte.com/france/rss.php?dep=95&show=7 1 item_titles 7}

Hors ligne

#941 Le 13/06/2012, à 11:03

Phyllinux

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

Pacifick_FR42 a écrit :

Je cherche un début d'idée pour afficher d'éventuelle alerte météo (weather.com ?)
Si quelqu'un à une idée.. merci smile

Si tu veux une version 'graphique', avec l'affichage d'une carte de France et les alertes météo diffusées par Météo France, tu peux aller voir ce qu'a fait jbaseb, sur ce lien :
Météo jbaseb
Cela te permet, en piochant dans son pack, de faire afficher la carte de Météo France, actualisée 2 fois par jour (06H et 16H), avec les légendes et les départements en couleur en fonction de la vigilance.
C'est la traduction en conky du site Vigilance Météo France


The ship is sinking normally...

Hors ligne

#942 Le 13/06/2012, à 13:56

Pacifick_FR42

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

Merci, tous marche nickel ! smile

Hors ligne

#943 Le 18/06/2012, à 09:44

ragamatrix

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

Bonjour à tous;
Je suis passé à la distribution "voyager"  depuis peu et mon conky meteo ne se lance pas à cause de cette erreur que je ne comprends pas :

  └─> conky -c ~/.conky/conky8/ConkyMeteo
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-NxNCLE/pkcs11: No such file or directory

Si quelqu'un à une idée...Didier-T..??;)
Bonne journée

Hors ligne

#944 Le 18/06/2012, à 10:02

Didier-T

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

ragamatrix a écrit :

Bonjour à tous;
Je suis passé à la distribution "voyager"  depuis peu et mon conky meteo ne se lance pas à cause de cette erreur que je ne comprends pas :

  └─> conky -c ~/.conky/conky8/ConkyMeteo
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-NxNCLE/pkcs11: No such file or directory

Si quelqu'un à une idée...Didier-T..??;)
Bonne journée

Tu peut me redonner le script de ton conky.

Hors ligne

#945 Le 18/06/2012, à 11:18

ragamatrix

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

@Didiet-T
Tu veux dire le script Lua ou conkyrc ?
Voici le Lua :

  -- Créé par Didier-T (forum.ubuntu-fr.org)
-- Nécessite imagemagick http://apt.ubuntu.com/p/imagemagick



require "io"
require "os"
local Version = "v4.1"
local conditionJour = {}
local conditionNuit = {}
local conditionMatin = {}
local conditionAM = {}
local conditionSoiree = {}
local conditionNoct = {}
local InfoJour = {}
local conditioncourante = {}
local Rep, cmd, jours, matin, apresmidi, soiree, nuit, delais, r, repsauv, l, fichier_init, MAJ, tc, dermodif



--Traduction date
function trad_date(d)
    local date = d
    date = date:gsub("Monday", "Lundi"):gsub("Tuesday", "Mardi"):gsub("Wednesday", "Mercredi"):gsub("Thursday", "Jeudi"):gsub("Friday", "Vendredi"):gsub("Saturday", "Samedi"):gsub("Sunday", "Dimanche")

    date = date:gsub("lun", "Lun"):gsub("mar", "Mar"):gsub("mer", "Mer"):gsub("jeu", "Jeu"):gsub("ven", "Ven"):gsub("sam", "Sam"):gsub("dim", "Dim")

    date = date:gsub("Mon", "Lun"):gsub("Tue", "Mar"):gsub("Wed", "Mer"):gsub("Thu", "Jeu"):gsub("Fri", "Ven"):gsub("Sat", "Sam"):gsub("Sun", "Dim")
    
    date = date:gsub("January", "Janvier"):gsub("February", "Février"):gsub("March", "Mars"):gsub("April", "Avril"):gsub("May", "Mai"):gsub("June", "Juin"):gsub("July", "Juillet"):gsub("August", "Août"):gsub("September", "Septembre"):gsub("October", "Octobre"):gsub("November", "Novembre"):gsub("December", "Décembre")

    date = date:gsub("jan", "Jan"):gsub("fev", "Fév"):gsub("mar", "Mar"):gsub("avr", "Avr"):gsub("mai", "Mai"):gsub("jui", "Jui"):gsub("aou", "Aoû"):gsub("sep", "Sep"):gsub("oct", "Oct"):gsub("nov", "Nov"):gsub("dec", "Déc")
    
    date = date:gsub("Feb", "Fév"):gsub("Apr", "Avr"):gsub("May", "Mai"):gsub("Jun", "Juin"):gsub("Jul", "Juil"):gsub("Aug", "Aoû"):gsub("Dec", "Déc")
        
    return date
end

--Vérifier l'existence d'un fichier
function existe(file) 
  local a = io.open(file, "r")
  local present
  if a then
    present = true
    io.close(a)
  else
    present = false
  end
  return present
end

--Formatage des accents
function string.accent(ligne)

    ligne = ligne:gsub("ô", "ô"):gsub("â", "â"):gsub("é", "é"):gsub("è", "è"):gsub("à", "à"):gsub("ç", "ç"):gsub("ê", "ê"):gsub("ö", "ö"):gsub("î", "î"):gsub("ï", "ï"):gsub("û", "û"):gsub("ü", "ü"):gsub("'", "'"):gsub("Poudreries", "Bourrasques de neige"):gsub("É", "É")

    return ligne
end

function string.balise(self, arg1, arg2)
    local a, b, c
    
    a,b = self:find(arg1)
    if a ~= nil then
        if b == nil then
            b = a+1
        else
            b = b+1
        end
        
        c = self:find(arg2, b)
        if c == nil then
            c = b
        else
            c = c-1
        end
    end
    
    return b, c
end


--Traitement information Quart de journée
function Prevision_Quart_T(fichier)
    local pos1, pos2, icone, Descriptif, TempMax, TempMin, TempMaxR, TempMinR, Vdir, Vforce, Prec, Pluie, Neige, Humidite, Couverture, Rosee, Visibilite, parse
    local file = assert(io.open(fichier, "rb") )
    local line = file:read()

    parse = 0
    
    for line in file:lines() do
        if string.find(line, '"details"') ~= nil then
            parse = 1
        end
        if parse == 1 then
            if string.find(line, 'class="icon i-') ~= nil then
                pos1, pos2 = line:balise('-', '"')
                icone = string.sub(line, pos1, pos2)
            elseif string.find(line, '"cond"') ~= nil then
                pos1, pos2 = line:balise('d">', '<')
                Descriptif = line:sub(pos1, pos2):accent()
            elseif string.find(line, '"temp"') ~= nil then
                pos1, pos2 = line:balise('>', '<')
                TempMax = string.sub(line, pos1, pos2)
            elseif string.find(line, '"lo"') ~= nil then
                pos1, pos2 = line:balise('Mn', '<')
                TempMin = string.sub(line, pos1, pos2)
            elseif string.find(line, '"realfeel"') ~= nil then
                pos1, pos2 = line:balise('4; ', '&')
                TempMaxR = string.sub(line, pos1, pos2)
                pos1, pos2 = line:balise('/ ', '&')
                TempMinR = string.sub(line, pos1, pos2)
            elseif string.find(line, 'var d') ~= nil then
                pos1, pos2 = line:balise("'", "'")
                Vdir = string.gsub(string.sub(line, pos1, pos2), "W", "O")
            elseif string.find(line, 'var s') ~= nil then
                pos1, pos2 = line:balise("'", "'")
                Vforce = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'cipitations') ~= nil then
                pos1, pos2 = line:balise("g>", "<")
                Prec = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'Pluie') ~= nil then
                pos1, pos2 = line:balise("g>", " ")
                Pluie = string.sub(line, pos1, pos2)
            elseif string.find(line, 'Neige') ~= nil then
                pos1, pos2 = line:balise("g>", " ")
                Neige = string.sub(line, pos1, pos2)
            elseif string.find(line, 'Humidit') ~= nil then
                pos1, pos2 = line:balise("g>", "<")
                Humidite = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'Couverture') ~= nil then
                pos1, pos2 = line:balise("g>", "<")
                Couverture = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'Point') ~= nil then
                pos1, pos2 = line:balise("g>", "&")
                Rosee = string.sub(line, pos1, pos2)
            elseif string.find(line, 'Visibilit') ~= nil then
                pos1, pos2 = line:balise("g>", " ")
                Visibilite = string.sub(line, pos1, pos2)
            end
        end
    end
    io.close(file)

        return {Icone=icone, CondMeteo=Descriptif, TempMax=TempMax, TempMin=TempMin, TempMaxR=TempMaxR, TempMinR=TempMinR, VentDir=Vdir, VentForce=Vforce, Humidite=Humidite, CouvNuage=Couverture, PointRosee=Rosee, ProbPrec=Prec, Visibilite=Visibilite, QNeige=Neige, QPluie=Pluie}
end


--Prévision
function prevision(fichier)
    local iconej, iconen, Tmax, Tmin, Tmaxr, Tminr, ProbPrecj, ProbPrecn, Vdirj, Vdirn, Vforcej, Vforcen, Vrafalesj, Vrafalesn, Descriptifj, Descriptifn, UV, ProbOragesj, ProbOragesn, Precj, Precn, Pluiej, Pluien, Neigej, Neigen, Verglasj, Verglasn, Datej, LeverSoleil, CoucherSoleil, parse, pos1, pos2, LeverSoleilH, LeverSoleilM, CoucherSoleilH, CoucherSoleilM, histo, histo1, Histo_Max, Histo_Min
    local file = assert(io.open(fichier, "rb") )
    local line = file:read()
    for line in file:lines() do
        if string.find(line, '"details"') ~= nil then
            parse = 1
        end
        if parse == 1 then
            if string.find(line, 'class="icon i-') ~= nil then
                pos1, pos2 = line:balise("-", '"')
                if iconej == nil then
                    iconej = string.sub(line, pos1, pos2)
                else
                    iconen = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, '"temp"') ~= nil then
                pos1, pos2 = line:balise('"temp">', '<')
                if Tmax == nil then
                    Tmax = string.sub(line, pos1, pos2)
                else
                    Tmin = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'RealFeel&#174;') ~= nil then
                pos1, pos2 = line:balise(';', '&')
                if Tmaxr == nil then
                    Tmaxr = string.sub(line, pos1, pos2)
                else
                    Tminr = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'cipitations ') ~= nil then
                pos1, pos2 = line:balise('s ', '<')
                if ProbPrecj == nil then
                    ProbPrecj = line:sub(pos1, pos2):match("(%d+)")
                else
                    ProbPrecn = line:sub(pos1, pos2):match("(%d+)")
                end
            elseif string.find(line, 'var d') ~= nil then
                pos1, pos2 = line:balise("'", "'")
                if Vdirj == nil then
                    Vdirj = string.gsub(string.sub(line, pos1, pos2), "W", "O")
                else
                    Vdirn = string.gsub(string.sub(line, pos1, pos2), "W", "O")
                end
            elseif string.find(line, 'var s') ~= nil then
                pos1, pos2 = line:balise("'", "'")
                if Vforcej == nil then
                    Vforcej = line:sub(pos1, pos2):match("(%d+)")
                else
                    Vforcen = line:sub(pos1, pos2):match("(%d+)")
                end
            elseif string.find(line, 'Rafales') ~= nil then
                pos1, pos2 = line:balise("> ", " ")
                if Vrafalesj == nil then
                    Vrafalesj = line:sub(pos1, pos2):match("(%d+)")
                    if Vrafalesj == nil then Vrafalesj = Vforcen end
                else
                    Vrafalesn = line:sub(pos1, pos2):match("(%d+)")
                    if Vrafalesn == nil then Vrafalesn = Vforcej end
                end
            elseif Descriptifn == nil and string.find(line, '<p>') ~= nil then
                pos1, pos2 = line:balise(">", "<")
                if Descriptifj == nil then
                    Descriptifj = string.sub(line, pos1, pos2):accent()
                    local troplong = string.find(Descriptifj, ";")
                    if troplong ~= nil then
                        Descriptifj = string.sub(Descriptifj, "1", troplong-1)
                    end
                else
                    Descriptifn = string.sub(line, pos1, pos2):accent()
                    local troplong = string.find(Descriptifn, ";")
                    if troplong ~= nil then
                        Descriptifn = string.sub(Descriptifn, "1", troplong-1)
                    end
                end
            elseif string.find(line, 'UV') ~= nil then
                pos1, pos2 = line:balise("g>", "<")
                if UV == nil then
                    UV = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'Orages') ~= nil then
                pos1, pos2 = line:balise('">', "<")
                if ProbOragesj == nil then
                    ProbOragesj = line:sub(pos1, pos2):match("(%d+)")
                else
                    ProbOragesn = line:sub(pos1, pos2):match("(%d+)")
                end
            elseif string.find(line, 'cipitations:') ~= nil then
                pos1, pos2 = line:balise("g>", " ")
                if Precj == nil then
                    Precj = string.sub(line, pos1, pos2)
                else
                    Precn = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'Pluie:') ~= nil then
                pos1, pos2 = line:balise('">', " ")
                if Pluiej == nil then
                    Pluiej = string.sub(line, pos1, pos2)
                else
                    Pluien = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'Neige:') ~= nil then
                pos1, pos2 = line:balise('">', " ")
                if Neigej == nil then
                    Neigej = string.sub(line, pos1, pos2)
                else
                    Neigen = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'Verglas:') ~= nil then
                pos1, pos2 = line:balise('">', " ")
                if Verglasj == nil then
                    Verglasj = string.sub(line, pos1, pos2)
                else
                    Verglasn = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'Historique ') ~= nil then
                pos1, pos2 = line:balise('- ', "<")
                local j, m, a = line:sub(pos1, pos2):match("(%d+)/(%d+)/(%d+)")
                Datej = os.time{year=a, month=m, day=j, hour=0}
            elseif string.find(line, 'start"') ~= nil then
                pos1, pos2 = line:balise('>', "<")
                if LeverSoleil == nil then
                    LeverSoleil = string.sub(line, pos1, pos2)
                    LeverSoleilH, LeverSoleilM = LeverSoleil:match("(%d+):(%d+)")
                end
            elseif string.find(line, 'finish"') ~= nil then
                pos1, pos2 = line:balise('>', "<")
                if CoucherSoleil == nil then
                    CoucherSoleil = string.sub(line, pos1, pos2)
                    CoucherSoleilH, CoucherSoleilM = CoucherSoleil:match("(%d+):(%d+)")
                end
            elseif string.find(line, '<td class="high">') ~= nil then
                histo = 1
            elseif string.find(line, '<td>') ~= nil and histo ~= nil then
                if histo1 == nil then
                    histo1 = 1
                else
                    pos1, pos2 = line:balise('>', "&")
                    if Histo_Max == nil then
                        histo1 = nil
                        histo = nil
                        Histo_Max = string.sub(line, pos1, pos2)
                    elseif Histo_Min == nil then
                        Histo_Min = string.sub(line, pos1, pos2)
                    end
                end
                
            end
        end
    end
    io.close(file)
        return { Icone=iconej, CondMeteo=Descriptifj, Temp=Tmax, TempRes=Tmaxr, ProbPrec=ProbPrecj, VentDir=Vdirj, VentForce=Vforcej, VentRafales=Vrafalesj, Uv=UV, ProbOrage=ProbOragesj, NivPrec=Precj, QPluie=Pluiej, QNeige=Neigej, EVerglas=Verglasj }, { Icone=iconen, CondMeteo=Descriptifn, Temp=Tmin, TempRes=Tminr, ProbPrec=ProbPrecn, VentDir=Vdirn, VentForce=Vforcen, VentRafales=Vrafalesn, ProbOrage=ProbOragesn, NivPrec=Precn, QPluie=Pluien, QNeige=Neigen, EVerglas=Verglasn }, { Jour=Datej, LeverSoleil=LeverSoleil, LeverSoleilH=LeverSoleilH, LeverSoleilM=LeverSoleilM, CoucherSoleil=CoucherSoleil, CoucherSoleilH=CoucherSoleilH, CoucherSoleilM=CoucherSoleilM, Histo_Max=Histo_Max, Histo_Min=Histo_Min }

end


--Infos condition courante
function current(fichier)
    local pos1, pos2, icone, Descriptif, Temp, Tempr, Vdir, Vforce, Humidite, Pression, Couverture, UV, Rosee, Prec, Visibilite, Date, Ville, latitude, longitude, geo, parse
    local file = assert(io.open(fichier, "rb") )
    local line = file:read()
    geo = nil
    parse = nil

    for line in file:lines() do
        if string.find(line, '"details"') ~= nil then
            parse = 1
        end
        if parse == 1 then
            if string.find(line, 'class="icon i-') ~= nil then
                pos1, pos2 = line:balise('-', '"')
                icone = string.sub(line, pos1, pos2)
            elseif string.find(line, '"cond"') ~= nil then
                pos1, pos2 = line:balise('"cond">', '<')
                Descriptif = string.sub(line, pos1, pos2):accent()
                pos1, pos2 = line:balise('"temp">', '<')
                Temp = string.sub(line, pos1, pos2)
                pos1, pos2 = line:balise('; ', '<')
                Tempr = string.sub(line, pos1, pos2)
            elseif string.find(line, 'var d') ~= nil then
                pos1, pos2 = line:balise("'", "'")
                Vdir = string.gsub(string.sub(line, pos1, pos2), "W", "O")
            elseif string.find(line, 'var s') ~= nil then
                pos1, pos2 = line:balise("'", "'")
                Vforce = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'Humidit') ~= nil then
                pos1, pos2 = line:balise("g>", "<")
                Humidite = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'Pression') ~= nil then
                pos1, pos2 = line:balise("g>", " k")
                Pression = line:sub(pos1, pos2)*10
            elseif string.find(line, 'Couverture') ~= nil then
                pos1, pos2 = line:balise("g>", "<")
                Couverture = line:sub(pos1, pos2):match("(%d+)")
            elseif string.find(line, 'UV') ~= nil then
                if UV == nil then
                    pos1, pos2 = line:balise("g>", "<")
                    UV = string.sub(line, pos1, pos2)
                end
            elseif string.find(line, 'Point') ~= nil then
                pos1, pos2 = line:balise("g>", "&")
                Rosee = string.sub(line, pos1, pos2)
            elseif string.find(line, 'cipitations') ~= nil then
                pos1, pos2 = line:balise("g>", " ")
                Prec = string.sub(line, pos1, pos2)
            elseif string.find(line, 'Visibilit') ~= nil then
                pos1, pos2 = line:balise("g>", " ")
                Visibilite = string.sub(line, pos1, pos2)
            elseif string.find(line, 'Historique ') ~= nil then
                pos1, pos2 = line:balise("- ", "<")
                local j, m, a = line:sub(pos1, pos2):match("(%d+)/(%d+)/(%d+)")
                Date = os.time{year=a, month=m, day=j, hour=0}
            elseif string.find(line, 'latitude') ~= nil then
                geo = 1
            elseif string.find(line, 'title" ') ~= nil then
                pos1, pos2 = line:balise('e="', '"')
                if Ville == nil then
                    Ville = string.sub(line, pos1, pos2):accent()
                end
                if geo ~= nil then
                    if latitude ~= nil then
                        longitude = string.sub(line, pos1, pos2)
                    end
                    if latitude == nil then
                        latitude = string.sub(line, pos1, pos2)
                    end
                end
            end
        end
    end
    io.close(file)

        return {Icone=icone, Cond=Descriptif, Temp=Temp, Tempr=Tempr, VentDir=Vdir, VentForce=Vforce, Humidite=Humidite, Pression=Pression, CouvNuage=Couverture, Uv=UV, PointRosee=Rosee, QPrec=Prec, Visibilite=Visibilite, Date=Date, Ville=Ville, latitude=latitude, longitude=longitude}
end


--Infos lunaison
function lunaison(r)

    s = "${exec wget --tries=3 -q -O "..r.."/cal_lunaire http://www.calendrier-lunaire.net/}"
    conky_parse( s )

    local file = assert(io.open(r..'/cal_lunaire', "rb") )
    local line = file:read()

    for line in file:lines() do
        local pos1 = string.find(line, '">')
        local pos2 = string.find(line, "</", pos1)
        local pos1, pos2 = line:balise('">', "</")
        if string.find(line, "ephemerides_1") ~= nil then
            pos1, pos2 = line:balise('src="', '" /')
            s = "${exec wget --tries=3 -q -O "..r.."/lune.png http://www.calendrier-lunaire.net/"..string.sub(line, pos1, pos2).."}"
            conky_parse( s )
            conky_parse( "${exec convert "..r.."/lune.png -transparent '#091a2a' "..r.."/lune.png}" )
        elseif string.find(line, "<h2>") ~= nil then
            ephemerides1 = string.sub(line, pos1, pos2)
            local pos3 = string.find(line, 'n>', pos2)+3
            local pos4 = string.find(line, "</", pos2+3)-1
            ephemerides2 = string.sub(line, pos3, pos4)
            ephemerides = ephemerides1.." "..ephemerides2
        elseif string.find(line, "Visibilit") ~= nil then
            Visibilite = string.sub(line, pos1, pos2-2)
        elseif string.find(line, "Phases") ~= nil then
            Phases = string.gsub(string.sub(line, pos1, pos2), "&eacute;", "é")
            local pos3 = string.find(Phases, ',')
            Phases1 = string.sub(Phases, 0, pos3-1)
            Phases2 = string.sub(Phases, pos3+2)
        elseif string.find(line, "Noeud lunaire") ~= nil then
            Noeud_lunaire = line:sub(pos1, pos2):match("(%d+)")
            if Noeud_lunaire == nil then Noeud_lunaire = line:sub(pos1, pos2) end
        elseif string.find(line, "Apog") ~= nil then
            Apogee = line:sub(pos1, pos2):match("(%d+)")
            if Apogee == nil then Apogee = line:sub(pos1, pos2) end
        elseif string.find(line, "Perig") ~= nil then
            Perigee = line:sub(pos1, pos2):match("(%d+)")
            if perigee == nil then Perigee = line:sub(pos1, pos2) end
        elseif string.find(line, "Distance") ~= nil then
            Distance = line:sub(pos1, pos2):match("(%d+)")
        elseif string.find(line, "Age de la Lune") ~= nil then
            Age = string.sub(line, pos1, pos2)
        elseif string.find(line, "La Lune se") ~= nil then
            Lever_LuneHeure, Lever_LuneMinute = line:sub(pos1, pos2):match("(%d+):(%d+)")
            if Lever_LuneHeure == nil then Lever_LuneHeure, Lever_LuneMinute = "N/A", "N/A" end
            local pos3 = string.find(line, '">', pos2)+2
            local pos4 = string.find(line, "</", pos3+3)-1
            Coucher_LuneHeure, Coucher_LuneMinute = line:sub(pos3, pos4):match("(%d+):(%d+)")
            if Coucher_LuneHeure == nil then Coucher_LuneHeure, Coucher_LuneMinute = "N/A", "N/A" end
        elseif string.find(line, "eclipse_partielle") ~= nil then
            local pos3 = string.find(line, '">', pos1+1)
            local a = string.sub(line, pos3+2, pos2)
            Eclipse_partielle = datelune(a)
        elseif string.find(line, "eclipse_totale") ~= nil then
            local pos3 = string.find(line, '">', pos1+1)
            local a = string.sub(line, pos3+2, pos2)
            Eclipse_total = datelune(a)
        end
    end
    io.close(file)

end

function datelune(d)

    local j, m, a, h, min = d:gsub("Janvier", "01"):gsub("Février", "02"):gsub("Mars", "03"):gsub("Avril", "04"):gsub("Mais", "05"):gsub("Juin", "06"):gsub("Juillet", "07"):gsub("Août", "08"):gsub("septembre", "09"):gsub("Octobre", "10"):gsub("Novembre", "11"):gsub("Décembre", "12"):match("(%d+) (%d+) (%d+) <br /> (%d+):(%d+)")
    d = os.time{year=a, month=m, day=j, hour=h, min=min}

    return d
    
end


--Détermine icône vent
function direction_vent(i)

    if i == "Calme" then
        return 0
    elseif i == "N" then
        return 10
    elseif i == "NNE" then
        return 11
    elseif i == "NE" then
        return 12
    elseif i == "ENE" then
        return 13
    elseif i == "E" then
        return 14
    elseif i == "ESE" then
        return 15
    elseif i == "SE" then
        return 16
    elseif i == "SSE" then
        return 17
    elseif i == "S" then
        return 2
    elseif i == "SSO" then
        return 3
    elseif i == "SO" then
        return 4
    elseif i == "OSO" then
        return 5
    elseif i == "O" then
        return 6
    elseif i == "ONO" then
        return 7
    elseif i == "NO" then
        return 8
    elseif i == "NNO" then
        return 9
    else
        return 1
    end

end


--Renvoi vent direction pleine en toute lettre
function vent_plein(d)

    local b

    if string.len(d) == 1 then
        if string.find(d, "N") ~= nil then 
            b = string.gsub(d, "N", "Nord") 
        elseif string.find(d, "S") ~= nil then 
            b = string.gsub(d, "S", "Sud") 
        elseif string.find(d, "E") ~= nil then
            b = string.gsub(d, "E", "Est") 
        elseif string.find(d, "O") ~= nil then
            b = string.gsub(d, "O", "Ouest")
        end
    else
        b = d
    end

    return b

end


--Détermine l'icône vent en tenant conte de la force du vent
function icone_vent(d, fo)

    local f = tonumber(fo)
    local n

    if f <= Palier then
        n = d
    elseif f <= Palier*2 then
        n = d + 17
    elseif f <= Palier*3 then
        n = d + 34
    elseif f >= (Palier*3)+1 then
        n = d + 51
    end

    if n <= 9 then 
        n = "0"..n
    end

    return n..".png"

end


--Découpage descriptions sur deux lignes
function decoupage(d)

    local l1, l2, n, p1, p2, n1, n2, l1b, l2b
    if string.len(d) >= 22 then
        n = math.ceil(string.len(d)/2)
        p1 = string.find(d, " ", n)
        p2 = string.find(d, " ", -n)
        if p1 == nil and p2 == nil then p1 = string.find(d, " ") end
        if p2 == nil then p2 = p1 end
        if p1 == nil then p1 = p2 end
        if p1 >= p2 then
            l1b = string.sub(d, 1, p2-1)
            l2b = string.sub(d, p2+1)
        else
            l1b = string.sub(d, 1, p1-1)
            l2b = string.sub(d, p1+1)
        end
    else
        l1b = d
        l2b = " "
    end
    n1 = math.ceil((22 - string.len(l1b))/2)
    l1 = string.rep(" ", n1)..l1b 
    n2 = math.ceil((22 - string.len(l2b))/2)
    l2 = string.rep(" ", n2)..l2b 

--Retour information avec espaces ligne 1 & 2 et sans espaces ligne 1 & 2
    return l1, l2, l1b, l2b

end


--Information Matin
function Prevision_Matin(a, j, x)
    local i = j+x
        local s = '${exec wget --tries=3 -q --load-cookies '..Rep..'/cookie -O '..Rep..'/Matin'..j..' '..a..'?day='..i..'}'
        conky_parse( s )
        conditionMatin[j] = Prevision_Quart_T(Rep..'/Matin'..j)

    if conditionMatin[j].VentDir == "CLM" then
        conditionMatin[j].VentDir = "Calme"
        conditionMatin[j].VentForce = "0"
    end
    conditionMatin[j].VentIcone = icone_vent(direction_vent(conditionMatin[j].VentDir), conditionMatin[j].VentForce)
    conditionMatin[j].VentP = vent_plein(conditionMatin[j].VentDir)
    conditionMatin[j].CondMeteo1, conditionMatin[j].CondMeteo2, conditionMatin[j].CondMeteo1se, conditionMatin[j].CondMeteo2se = decoupage(conditionMatin[j].CondMeteo)

end


--Information Après-midi
function Prevision_AM(a, j, x)
    local i = j+x
        local s = '${exec wget --tries=3 -q --load-cookies '..Rep..'/cookie -O '..Rep..'/ApresMidi'..j..' '..a..'?day='..i..'}'
        conky_parse( s )
        conditionAM[j] = Prevision_Quart_T(Rep..'/ApresMidi'..j)

    if conditionAM[j].VentDir == "CLM" then
        conditionAM[j].VentDir = "Calme"
        conditionAM[j].VentForce = "0"
    end
    conditionAM[j].VentIcone = icone_vent(direction_vent(conditionAM[j].VentDir), conditionAM[j].VentForce)
    conditionAM[j].VentP = vent_plein(conditionAM[j].VentDir)
    conditionAM[j].CondMeteo1, conditionAM[j].CondMeteo2, conditionAM[j].CondMeteo1se, conditionAM[j].CondMeteo2se = decoupage(conditionAM[j].CondMeteo)

end


--Information Soirée
function Prevision_Soiree(a, j, x)
    local i = j+x
        local s = '${exec wget --tries=3 -q --load-cookies '..Rep..'/cookie -O '..Rep..'/Soiree'..j..' '..a..'?day='..i..'}'
        conky_parse( s )
        conditionSoiree[j] = Prevision_Quart_T(Rep..'/Soiree'..j)

    if conditionSoiree[j].VentDir == "CLM" then
        conditionSoiree[j].VentDir = "Calme"
        conditionSoiree[j].VentForce = "0"
    end
    conditionSoiree[j].VentIcone = icone_vent(direction_vent(conditionSoiree[j].VentDir), conditionSoiree[j].VentForce)
    conditionSoiree[j].VentP = vent_plein(conditionSoiree[j].VentDir)
    conditionSoiree[j].CondMeteo1, conditionSoiree[j].CondMeteo2, conditionSoiree[j].CondMeteo1se, conditionSoiree[j].CondMeteo2se = decoupage(conditionSoiree[j].CondMeteo)

end


--Information Nuit
function Prevision_Nuit(a, j, x)
    local i = j+x
        local s = '${exec wget --tries=3 -q --load-cookies '..Rep..'/cookie -O '..Rep..'/Nuit'..j..' '..a..'?day='..i..'}'
        conky_parse( s )
        conditionNoct[j] = Prevision_Quart_T(Rep..'/Nuit'..j)
    
    if conditionNoct[j].VentDir == "CLM" then
        conditionNoct[j].VentDir = "Calme"
        conditionNoct[j].VentForce = "0"
    end
    conditionNoct[j].VentIcone = icone_vent(direction_vent(conditionNoct[j].VentDir), conditionNoct[j].VentForce)
    conditionNoct[j].VentP = vent_plein(conditionNoct[j].VentDir)
    conditionNoct[j].CondMeteo1, conditionNoct[j].CondMeteo2, conditionNoct[j].CondMeteo1se, conditionNoct[j].CondMeteo2se = decoupage(conditionNoct[j].CondMeteo)

end


--Traitement infos prévisions (15 jours max) jour 1 = aujourd'hui
function jour_n(a, j, x)

    local i = j+x
        local s = '${exec wget --tries=3 -q --load-cookies '..Rep..'/cookie -O '..Rep..'/details'..j..' '..a..'?day='..i..'}'
        conky_parse( s )
        conditionJour[j], conditionNuit[j], InfoJour[j] = prevision(Rep..'/details'..j)

    if conditionJour[j].VentDir == "CLM" then
        conditionJour[j].VentDir = "Calme"
        conditionJour[j].VentForce = "0"
    end
    conditionJour[j].VentIcone = icone_vent(direction_vent(conditionJour[j].VentDir), conditionJour[j].VentForce)
    conditionJour[j].RafalesIcone = icone_vent(direction_vent(conditionJour[j].VentDir), conditionJour[j].VentRafales)
    conditionJour[j].VentP = vent_plein(conditionJour[j].VentDir)
    conditionJour[j].CondMeteo1, conditionJour[j].CondMeteo2, conditionJour[j].CondMeteo1se, conditionJour[j].CondMeteo2se = decoupage(conditionJour[j].CondMeteo)

    if conditionNuit[j].VentDir == "Calme" then
        conditionNuit[j].VentForce = "0"
    end
    conditionNuit[j].VentIcone = icone_vent(direction_vent(conditionNuit[j].VentDir), conditionNuit[j].VentForce)
    conditionNuit[j].RafalesIcone = icone_vent(direction_vent(conditionNuit[j].VentDir), conditionNuit[j].VentRafales)
    conditionNuit[j].VentP = vent_plein(conditionNuit[j].VentDir)
    conditionNuit[j].CondMeteo1, conditionNuit[j].CondMeteo2, conditionNuit[j].CondMeteo1se, conditionNuit[j].CondMeteo2se = decoupage(conditionNuit[j].CondMeteo)


end

--initialisation paramètres
function conky_init(cfg)

    local cmd1, pos1
    local home = os.getenv("HOME")
    cfg = string.gsub(cfg, "~", home)
    cfg = string.gsub(cfg, "$HOME", home)
    fichier_init = cfg
    
    local file = assert(io.open(cfg, "rb") )
    local line = file:read()
    for line in file:lines() do
        pos1 = string.find(line, '#')
        if pos1 ~= nil then
            line = string.sub(line, 1, pos1-1)
        end
        pos1 = string.find(line, '=')
        if string.find(line, 'repsauv=') ~= nil then
            repsauv = string.sub(line, pos1+1)
        elseif string.find(line, 'TempShell=') ~= nil then
            r = string.sub(line, pos1+1)
        elseif string.find(line, 'web=') ~= nil then
            cmd1 = string.sub(line, pos1+1)
        elseif string.find(line, 'periode=') ~= nil then
            jours = string.sub(line, pos1+1)
        elseif string.find(line, 'matinée=') ~= nil then
            matin = string.sub(line, pos1+1)
        elseif string.find(line, 'am=') ~= nil then
            apresmidi = string.sub(line, pos1+1)
        elseif string.find(line, 'soiree=') ~= nil then
            soiree = string.sub(line, pos1+1)
        elseif string.find(line, 'nuit=') ~= nil then
            nuit = string.sub(line, pos1+1)
        elseif string.find(line, 'Palier=') ~= nil then
            Palier = tonumber(string.sub(line, pos1+1))
        elseif string.find(line, 'update=') ~= nil then
            delais = string.sub(line, pos1+1)
        end
    end
    io.close(file)    
    r = r:gsub("~", home):gsub("$HOME", home)
    repsauv = repsauv:gsub("~", home):gsub("$HOME", home)
    repsauv = repsauv.."/"

print("", "version = "..Version.."\n", "web = "..cmd1.."\n", "Pévision Nb jours = "..jours.."\n", "Pévision Matin = "..matin.."\n", "Pévision Après Midi = "..apresmidi.."\n", "Pévision Soirée = "..soiree.."\n", "Pévision Nuit = "..nuit.."\n", "Délais = "..delais.."\n", "Chemin de travail = "..r.."\n","Palier = "..Palier.."\n", "Chemin de sauvegarde = "..repsauv)

--Création répertoire de travail
    l = cmd1:match("/(%d+)")
    if string.find(cmd1, 'forecast') ~= nil then
        pos1 = string.find(cmd1, '/weather')
        cmd = string.sub(cmd1, 0, pos1-1)
    else
        pos1 = string.find(cmd1, '/current')
        cmd = string.sub(cmd1, 0, pos1-1)
    end

    local bar, bar1
    local l1 = string.gsub(cmd, '/'..l, "" )
    local b = 1
    while bar1 == nil do
        b = b+1
        bar1 = string.find(l1, '/', -b)
    end
    l1 = string.sub(l1, bar1+1)
    Rep = r.."/"..l1.."/"..l
    if os.execute("cd "..Rep) ~= 0 then
        os.execute("mkdir "..r.."/"..l1.."&& mkdir "..Rep)
    end
    
--initialisation compteurs
    t = os.time()-delais
    tc = t
    start = 1
    
--Vérification existence repsauv
    local repsauv1 = string.sub(repsauv, 1, -2)
    if os.execute("cd "..repsauv1) ~= 0 then
--création de repsauv si inexistant
        local pos1 = 1
        local chemin = nil
        local cheminsup = nil
        while pos1 ~= nil do
            pos1 = string.find(repsauv1, '/', pos1+1)
            if pos1 ~= nil then
                cheminsup = string.sub(repsauv1, pos1)
                chemin = string.gsub(repsauv1, cheminsup, "")
            else
                cheminsup = ""
                chemin = repsauv1
            end
            if os.execute("cd "..chemin) ~= 0 then
                os.execute("mkdir "..chemin)
            end
        end
    end
    
    if not existe(repsauv.."CondCour") then
        conky_Meteo_enligne()
    end
    
    MAJ ="0"
    
end

--Mise à jour météo
function conky_Meteo_Maj()

    local s = '${if_gw}${lua conky_Meteo_enligne}${else}${lua conky_Meteo_horsligne}${endif}'
    conky_parse( s )
    return " "
end

--hors ligne récupération de données
function conky_Meteo_horsligne()

    if dermodif == nil or dermodif ~= conky_parse("${exec date -r "..repsauv.."CondCour '+%s'}") then
        dermodif=conky_parse("${exec date -r "..repsauv.."CondCour '+%s'}")
--Récupération dernière condition courante
        local file = assert(io.open(repsauv.."CondCour", "r") )
        local line = file:read()
        local i = 0
        local donee = {}
        for line in file:lines() do
            i = i+1
            donee[i] = line
        end
        local t = {"Icone", "Tempr", "Temp", "Cond", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "VentDir", "VentPlein", "VentForce", "VentIcone", "Humidite", "PointRosee", "Pression", "Visibilite", "Date", "Ville", "CouvNuage", "Uv", "QPrec", "latitude", "longitude"}
        for i = 1,23 do
            conditioncourante[t[i]] = donee[i]
        end
        time = donee[24]
        io.close(file)
        
--Récupération prévision
        
        for j = 1,jours do
            local file = assert(io.open(repsauv.."prevision"..j, "r"))
            local line = file:read()
            local i = 0
            local donee = {}
            for line in file:lines() do
                i = i+1
                donee[i] = line
            end
            local info = {}
            local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "Temp", "TempRes", "ProbPrec", "VentDir", "VentP", "VentForce", "VentRafales", "Uv", "ProbOrage", "NivPrec", "QPluie", "QNeige", "Icone", "VentIcone", "RafalesIcone", "EVerglas"}
            conditionJour[j] = {}
            for i = 1, 21 do
                info[t[i]] = donee[i]
            end
            conditionJour[j] = info
            local info1 = {}
            t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "Temp", "TempRes", "ProbPrec", "VentDir", "VentP", "VentForce", "VentRafales", "ProbOrage", "NivPrec", "QPluie", "QNeige", "Icone", "VentIcone", "RafalesIcone", "EVerglas"}
            conditionNuit[j] = {}
            for i = 22, 41 do
                info1[t[i-21]] = donee[i]
            end
            conditionNuit[j] = info1
            local info2 = {}
            t= {"Jour", "LeverSoleilH", "LeverSoleilM", "CoucherSoleilH", "CoucherSoleilM", "Histo_Max", "Histo_Min"}
            InfoJour[j] = {}
            for i = 42, 48 do
                info2[t[i-41]] = donee[i]
            end
            InfoJour[j] = info2
            io.close(file)
            
            if matin == "oui" then
                local file = assert(io.open(repsauv.."matin"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
                conditionMatin[j] = {}
                local info3 = {}
                for i = 1, 21 do
                    info3[t[i]] = donee[i]
                end
                conditionMatin[j] = info3
                io.close(file)
            end

            if apresmidi == "oui" then
                local file = assert(io.open(repsauv.."ApresMidi"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
                conditionAM[j] = {}
                local info3 = {}
                for i = 1, 21 do
                    info3[t[i]] = donee[i]
                end
                conditionAM[j] = info3
                io.close(file)
            end

            if soiree == "oui" then
                local file = assert(io.open(repsauv.."Soiree"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
                conditionSoiree[j] = {}
                local info3 = {}
                for i = 1, 21 do
                    info3[t[i]] = donee[i]
                end
                conditionSoiree[j] = info3
                io.close(file)
            end

            if nuit == "oui" then
                local file = assert(io.open(repsauv.."Nuit"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
                conditionNoct[j] = {}
                local info3 = {}
                for i = 1, 21 do
                    info3[t[i]] = donee[i]
                end
                conditionNoct[j] = info3
                io.close(file)
            end

        end

--Récupération lunaison
        local file = assert(io.open(repsauv.."lunaison", "r"))
        local line = file:read()
        local i = 0
        local donee = {}
        for line in file:lines() do
            i = i+1
            donee[i] = line
        end
        ephemerides = donee[1]
        ephemerides1 = donee[2]
        ephemerides2 = donee[3]
        Visibilite = donee[4]
        Phases = donee[5]
        Phases1 = donee[6]
        Phases2 = donee[7]
        Noeud_lunaire = donee[8]
        Apogee = donee[9]
        Perigee = donee[10]
        Distance = donee[11]
        Age = donee[12]
        Lever_LuneHeure = donee[13]
        Lever_LuneMinute = donee[14]
        Coucher_LuneHeure = donee[15]
        Coucher_LuneMinute = donee[16]
        Eclipse_partielle = donee[17]
        Eclipse_total = donee[18]
        io.close(file)

        
        if MAJ == "0" then
            MAJ = "1"
        else
            MAJ = "0"
        end

        
        collectgarbage()
    end
    return ""
end

--en ligne mise à jour
function conky_Meteo_enligne()
    
    if tonumber(delais) <= os.difftime(os.time(), t) then
        t = os.time()
        time = t

            conditioncourante.Date = nil
            while conditioncourante.Date == nil do

                local s = '${exec wget --tries=3 -q --save-cookies '..Rep..'/cookie -O '..Rep..'/curr_cond_raw '..cmd..'/current-weather/'..l..'}'
                conky_parse( s )
                
                conditioncourante = current(Rep.."/curr_cond_raw")
                if conditioncourante.VentDir == "CLM" then
                    conditioncourante.VentDir = "Calme"
                    conditioncourante.VentForce = "0"
                end
                conditioncourante.VentIcone = icone_vent(direction_vent(conditioncourante.VentDir), conditioncourante.VentForce)
                conditioncourante.VentPlein = vent_plein(conditioncourante.VentDir)
                conditioncourante.CondMeteo1, conditioncourante.CondMeteo2, conditioncourante.CondMeteo1se, conditioncourante.CondMeteo2se = decoupage(conditioncourante.Cond)


                if 14400 <= os.difftime(os.time(), tc) or start == 1 then
                    start = 2
                    tc = t

                    local addr_week = cmd..'/daily-weather-forecast/'..l
                    jour_n(addr_week, 1, 0)

                    if conditioncourante.Date == InfoJour[1].Jour then
                        for i = 2,jours do jour_n(addr_week, i, 0) end
                    else
                        for i = 1,jours do jour_n(addr_week, i, 1) end
                    end

--infos matin si demandée
                    if matin == "oui" then
                        addr_week = cmd..'/morning-weather-forecast/'..l

                        if conditioncourante.Date == InfoJour[1].Jour then
                            for i = 1,jours do Prevision_Matin(addr_week, i, 0) end
                        else
                            for i = 1,jours do Prevision_Matin(addr_week, i, 1) end
                        end
                    end

--infos Après Midi si demandée
                    if apresmidi == "oui" then
                        addr_week = cmd..'/afternoon-weather-forecast/'..l

                        if conditioncourante.Date == InfoJour[1].Jour then
                            for i = 1,jours do Prevision_AM(addr_week, i, 0) end
                        else
                            for i = 1,jours do Prevision_AM(addr_week, i, 1) end
                        end
                    end

--infos Soirée si demandée
                    if soiree == "oui" then
                        addr_week = cmd..'/evening-weather-forecast/'..l

                        if conditioncourante.Date == InfoJour[1].Jour then
                            for i = 1,jours do Prevision_Soiree(addr_week, i, 0) end
                        else
                            for i = 1,jours do Prevision_Soiree(addr_week, i, 1) end
                        end
                    end

--infos Nuit si demandée
                    if nuit == "oui" then
                        addr_week = cmd..'/overnight-weather-forecast/'..l

                        if conditioncourante.Date == InfoJour[1].Jour then
                            for i = 1,jours do Prevision_Nuit(addr_week, i, 0) end
                        else
                            for i = 1,jours do Prevision_Nuit(addr_week, i, 1) end
                        end
                    end
                    
                end -- fin mise à jour compète
            end
            
            lunaison(r)
--lancement sauvegarde
        if repsauv ~= nil then
            sauvegarde()
        end
        
        
        if MAJ == "0" then
            MAJ = "1"
        else
            MAJ = "0"
        end

        
        collectgarbage()
    end
    return " "
end


--Retour d'information météo

--Condition courrante

function conky_Meteo_IconeM(r, p, s, f)
    if os.date("%H%M", os.time()) <= InfoJour[1].CoucherSoleilH..InfoJour[1].CoucherSoleilM and os.date("%H%M", os.time()) >= InfoJour[1].LeverSoleilH..InfoJour[1].LeverSoleilM then
        return "${image "..r.."/jour/"..conditioncourante.Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
    else
        return "${image "..r.."/nuit/"..conditioncourante.Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
    end
end

function conky_Meteo_TempRes()
    return conditioncourante.Tempr
end

function conky_Meteo_TempAct()
    return conditioncourante.Temp
end

function conky_Meteo_CondMeteo()
    return conditioncourante.Cond
end

function conky_Meteo_CondMeteo1()
    return conditioncourante.CondMeteo1
end

function conky_Meteo_CondMeteo2()
    return conditioncourante.CondMeteo2
end

function conky_Meteo_CondMeteo1se()
    return conditioncourante.CondMeteo1se
end

function conky_Meteo_CondMeteo2se()
    return conditioncourante.CondMeteo2se
end

function conky_Meteo_VentDir()
    return conditioncourante.VentDir
end

function conky_Meteo_VentDirP()
    return conditioncourante.VentPlein
end

function conky_Meteo_VentForce()
    return conditioncourante.VentForce
end

function conky_Meteo_IconeV(r, p, s, f)
    return "${image "..r.."/"..conditioncourante.VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Humidite()
    return tonumber(conditioncourante.Humidite)
end

function conky_Meteo_Rose()
    return tonumber(conditioncourante.PointRosee)
end

function conky_Meteo_Pression()
    return tonumber(conditioncourante.Pression)
end

function conky_Meteo_Visibilite()
    return tonumber(conditioncourante.Visibilite)
end

function conky_Meteo_Date(format)
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, conditioncourante.Date))
end

function conky_Meteo_Ville()
    return conditioncourante.Ville
end

function conky_Meteo_CouvNuage(r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditioncourante.CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then 
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Uv()
    return conditioncourante.Uv
end

function conky_Meteo_QPrec()
    return conditioncourante.QPrec
end

function conky_Meteo_latitude()
    return conditioncourante.latitude
end

function conky_Meteo_longitude()
    return conditioncourante.longitude
end

function conky_Meteo_Heure()
    return os.date("%H", time)
end

function conky_Meteo_Minute()
    return os.date("%M", time)
end


--Prévision Météo

--Jour

function conky_Meteo_Jour_CondMeteo(j)
    return conditionJour[tonumber(j)].CondMeteo
end

function conky_Meteo_Jour_CondMeteo1(j)
    return conditionJour[tonumber(j)].CondMeteo1
end

function conky_Meteo_Jour_CondMeteo2(j)
    return conditionJour[tonumber(j)].CondMeteo2
end

function conky_Meteo_Jour_CondMeteo1se(j)
    return conditionJour[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Jour_CondMeteo2se(j)
    return conditionJour[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Jour_Temp(j)
    return tonumber(conditionJour[tonumber(j)].Temp)
end

function conky_Meteo_Jour_TempRes(j)
    return tonumber(conditionJour[tonumber(j)].TempRes)
end

function conky_Meteo_Jour_ProbPrec(j)
    return tonumber(conditionJour[tonumber(j)].ProbPrec)
end

function conky_Meteo_Jour_VentDir(j)
    return conditionJour[tonumber(j)].VentDir
end

function conky_Meteo_Jour_VentDirP(j)
    return conditionJour[tonumber(j)].VentP
end

function conky_Meteo_Jour_VentForce(j)
    return tonumber(conditionJour[tonumber(j)].VentForce)
end

function conky_Meteo_Jour_VentRafales(j)
    return tonumber(conditionJour[tonumber(j)].VentRafales)
end

function conky_Meteo_Jour_Uv(j)
    return tonumber(conditionJour[tonumber(j)].Uv)
end

function conky_Meteo_Jour_ProbOrage(j)
    return tonumber(conditionJour[tonumber(j)].ProbOrage)
end

function conky_Meteo_Jour_NivPrec(j)
    return tonumber(conditionJour[tonumber(j)].NivPrec)
end

function conky_Meteo_Jour_QPluie(j)
    return tonumber(conditionJour[tonumber(j)].QPluie)
end

function conky_Meteo_Jour_QNeige(j)
    return tonumber(conditionJour[tonumber(j)].QNeige)
end

function conky_Meteo_Jour_EVerglas(j)
    return tonumber(conditionJour[tonumber(j)].EVerglas)
end

function conky_Meteo_Jour_IconeM(r, p, s, f, j)
    return "${image "..r.."/jour/"..conditionJour[tonumber(j)].Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Jour_IconeV(r, p, s, f, j)
    return "${image "..r.."/"..conditionJour[tonumber(j)].VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Jour_IconeR(r, p, s, f, j)
    return "${image "..r.."/"..conditionJour[tonumber(j)].RafalesIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end


--Nuit

function conky_Meteo_Nuit_CondMeteo(j)
    return conditionNuit[tonumber(j)].CondMeteo
end

function conky_Meteo_Nuit_CondMeteo1(j)
    return conditionNuit[tonumber(j)].CondMeteo1
end

function conky_Meteo_Nuit_CondMeteo2(j)
    return conditionNuit[tonumber(j)].CondMeteo2
end

function conky_Meteo_Nuit_CondMeteo1se(j)
    return conditionNuit[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Nuit_CondMeteo2se(j)
    return conditionNuit[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Nuit_Temp(j)
    return tonumber(conditionNuit[tonumber(j)].Temp)
end

function conky_Meteo_Nuit_TempRes(j)
    return tonumber(conditionNuit[tonumber(j)].TempRes)
end

function conky_Meteo_Nuit_ProbPrec(j)
    return tonumber(conditionNuit[tonumber(j)].ProbPrec)
end

function conky_Meteo_Nuit_VentDir(j)
    return conditionNuit[tonumber(j)].VentDir
end

function conky_Meteo_Nuit_VentDirP(j)
    return conditionNuit[tonumber(j)].VentP
end

function conky_Meteo_Nuit_VentForce(j)
    return tonumber(conditionNuit[tonumber(j)].VentForce)
end

function conky_Meteo_Nuit_VentRafales(j)
    return tonumber(conditionNuit[tonumber(j)].VentRafales)
end

function conky_Meteo_Nuit_ProbOrage(j)
    return tonumber(conditionNuit[tonumber(j)].ProbOrage)
end

function conky_Meteo_Nuit_NivPrec(j)
    return tonumber(conditionNuit[tonumber(j)].NivPrec)
end

function conky_Meteo_Nuit_QPluie(j)
    return tonumber(conditionNuit[tonumber(j)].QPluie)
end

function conky_Meteo_Nuit_QNeige(j)
    return tonumber(conditionNuit[tonumber(j)].QNeige)
end

function conky_Meteo_Nuit_EVerglas(j)
    return tonumber(conditionNuit[tonumber(j)].EVerglas)
end

function conky_Meteo_Nuit_IconeM(r, p, s, f, j)
    return "${image "..r.."/nuit/"..conditionNuit[tonumber(j)].Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Nuit_IconeV(r, p, s, f, j)
    return "${image "..r.."/"..conditionNuit[tonumber(j)].VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Nuit_IconeR(r, p, s, f, j)
    return "${image "..r.."/"..conditionNuit[tonumber(j)].RafalesIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end


--Infos sur la journée

function conky_Meteo_Jour(format, j)
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, InfoJour[tonumber(j)].Jour))
end

function conky_Meteo_HLeverSoleil(j)
    return InfoJour[tonumber(j)].LeverSoleilH
end

function conky_Meteo_MLeverSoleil(j)
    return InfoJour[tonumber(j)].LeverSoleilM
end

function conky_Meteo_HCoucherSoleil(j)
    return InfoJour[tonumber(j)].CoucherSoleilH
end

function conky_Meteo_MCoucherSoleil(j)
    return InfoJour[tonumber(j)].CoucherSoleilM
end

function conky_Meteo_HDureeJour(j)
    return InfoJour[tonumber(j)].CoucherSoleilH-InfoJour[tonumber(j)].LeverSoleilH
end

function conky_Meteo_MDureeJour(j)
    return os.date("%M", ((((InfoJour[tonumber(j)].CoucherSoleilH*3600)-3600)+(InfoJour[tonumber(j)].CoucherSoleilM*60))-(((InfoJour[tonumber(j)].LeverSoleilH*3600))+(InfoJour[tonumber(j)].LeverSoleilM*60))))
end

function conky_Meteo_Histo_Min(j)
    return InfoJour[tonumber(j)].Histo_Min
end

function conky_Meteo_Histo_Max(j)
    return InfoJour[tonumber(j)].Histo_Max
end


--Matin

function conky_Meteo_Matin_CondMeteo(j)
    return conditionMatin[tonumber(j)].CondMeteo
end

function conky_Meteo_Matin_CondMeteo1(j)
    return conditionMatin[tonumber(j)].CondMeteo1
end

function conky_Meteo_Matin_CondMeteo2(j)
    return conditionMatin[tonumber(j)].CondMeteo2
end

function conky_Meteo_Matin_CondMeteo1se(j)
    return conditionMatin[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Matin_CondMeteo2se(j)
    return conditionMatin[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Matin_TempMax(j)
    return tonumber(conditionMatin[tonumber(j)].TempMax)
end

function conky_Meteo_Matin_TempMin(j)
    return tonumber(conditionMatin[tonumber(j)].TempMin)
end

function conky_Meteo_Matin_TempMaxRes(j)
    return tonumber(conditionMatin[tonumber(j)].TempMaxR)
end

function conky_Meteo_Matin_TempMinRes(j)
    return tonumber(conditionMatin[tonumber(j)].TempMinR)
end

function conky_Meteo_Matin_ProbPrec(j)
    return tonumber(conditionMatin[tonumber(j)].ProbPrec)
end

function conky_Meteo_Matin_VentDir(j)
    return conditionMatin[tonumber(j)].VentDir
end

function conky_Meteo_Matin_VentDirP(j)
    return conditionMatin[tonumber(j)].VentP
end

function conky_Meteo_Matin_VentForce(j)
    return tonumber(conditionMatin[tonumber(j)].VentForce)
end

function conky_Meteo_Matin_QPluie(j)
    return tonumber(conditionMatin[tonumber(j)].QPluie)
end

function conky_Meteo_Matin_QNeige(j)
    return tonumber(conditionMatin[tonumber(j)].QNeige)
end

function conky_Meteo_Matin_Humidite(j)
    return tonumber(conditionMatin[tonumber(j)].Humidite)
end

function conky_Meteo_Matin_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionMatin[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then 
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Matin_Rose(j)
    return tonumber(conditionMatin[tonumber(j)].PointRosee)
end

function conky_Meteo_Matin_Visibilite(j)
    return tonumber(conditionMatin[tonumber(j)].Visibilite)
end

function conky_Meteo_Matin_IconeM(r, p, s, f, j)
    return "${image "..r.."/jour/"..conditionMatin[tonumber(j)].Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Matin_IconeV(r, p, s, f, j)
    return "${image "..r.."/"..conditionMatin[tonumber(j)].VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end


--Après Midi

function conky_Meteo_AM_CondMeteo(j)
    return conditionAM[tonumber(j)].CondMeteo
end

function conky_Meteo_AM_CondMeteo1(j)
    return conditionAM[tonumber(j)].CondMeteo1
end

function conky_Meteo_AM_CondMeteo2(j)
    return conditionAM[tonumber(j)].CondMeteo2
end

function conky_Meteo_AM_CondMeteo1se(j)
    return conditionAM[tonumber(j)].CondMeteo1se
end

function conky_Meteo_AM_CondMeteo2se(j)
    return conditionAM[tonumber(j)].CondMeteo2se
end

function conky_Meteo_AM_TempMax(j)
    return tonumber(conditionAM[tonumber(j)].TempMax)
end

function conky_Meteo_AM_TempMin(j)
    return tonumber(conditionAM[tonumber(j)].TempMin)
end

function conky_Meteo_AM_TempMaxRes(j)
    return tonumber(conditionAM[tonumber(j)].TempMaxR)
end

function conky_Meteo_AM_TempMinRes(j)
    return tonumber(conditionAM[tonumber(j)].TempMinR)
end

function conky_Meteo_AM_ProbPrec(j)
    return tonumber(conditionAM[tonumber(j)].ProbPrec)
end

function conky_Meteo_AM_VentDir(j)
    return conditionAM[tonumber(j)].VentDir
end

function conky_Meteo_AM_VentDirP(j)
    return conditionAM[tonumber(j)].VentP
end

function conky_Meteo_AM_VentForce(j)
    return tonumber(conditionAM[tonumber(j)].VentForce)
end

function conky_Meteo_AM_QPluie(j)
    return tonumber(conditionAM[tonumber(j)].QPluie)
end

function conky_Meteo_AM_QNeige(j)
    return tonumber(conditionAM[tonumber(j)].QNeige)
end

function conky_Meteo_AM_Humidite(j)
    return tonumber(conditionAM[tonumber(j)].Humidite)
end

function conky_Meteo_AM_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionAM[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then 
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_AM_Rose(j)
    return tonumber(conditionAM[tonumber(j)].PointRosee)
end

function conky_Meteo_AM_Visibilite(j)
    return tonumber(conditionAM[tonumber(j)].Visibilite)
end

function conky_Meteo_AM_IconeM(r, p, s, f, j)
    return "${image "..r.."/jour/"..conditionAM[tonumber(j)].Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_AM_IconeV(r, p, s, f, j)
    return "${image "..r.."/"..conditionAM[tonumber(j)].VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end


--Soirée

function conky_Meteo_Soiree_CondMeteo(j)
    return conditionSoiree[tonumber(j)].CondMeteo
end

function conky_Meteo_Soiree_CondMeteo1(j)
    return conditionSoiree[tonumber(j)].CondMeteo1
end

function conky_Meteo_Soiree_CondMeteo2(j)
    return conditionSoiree[tonumber(j)].CondMeteo2
end

function conky_Meteo_Soiree_CondMeteo1se(j)
    return conditionSoiree[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Soiree_CondMeteo2se(j)
    return conditionSoiree[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Soiree_TempMax(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMax)
end

function conky_Meteo_Soiree_TempMin(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMin)
end

function conky_Meteo_Soiree_TempMaxRes(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMaxR)
end

function conky_Meteo_Soiree_TempMinRes(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMinR)
end

function conky_Meteo_Soiree_ProbPrec(j)
    return tonumber(conditionSoiree[tonumber(j)].ProbPrec)
end

function conky_Meteo_Soiree_VentDir(j)
    return conditionSoiree[tonumber(j)].VentDir
end

function conky_Meteo_Soiree_VentDirP(j)
    return conditionSoiree[tonumber(j)].VentP
end

function conky_Meteo_Soiree_VentForce(j)
    return tonumber(conditionSoiree[tonumber(j)].VentForce)
end

function conky_Meteo_Soiree_QPluie(j)
    return tonumber(conditionSoiree[tonumber(j)].QPluie)
end

function conky_Meteo_Soiree_QNeige(j)
    return tonumber(conditionSoiree[tonumber(j)].QNeige)
end

function conky_Meteo_Soiree_Humidite(j)
    return tonumber(conditionSoiree[tonumber(j)].Humidite)
end

function conky_Meteo_Soiree_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionSoiree[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then 
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Soiree_Rose(j)
    return tonumber(conditionSoiree[tonumber(j)].PointRosee)
end

function conky_Meteo_Soiree_Visibilite(j)
    return tonumber(conditionSoiree[tonumber(j)].Visibilite)
end

function conky_Meteo_Soiree_IconeM(r, p, s, f, j)
    return "${image "..r.."/jour/"..conditionSoiree[tonumber(j)].Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Soiree_IconeV(r, p, s, f, j)
    return "${image "..r.."/"..conditionSoiree[tonumber(j)].VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end


--Nuit

function conky_Meteo_Noct_CondMeteo(j)
    return conditionNoct[tonumber(j)].CondMeteo
end

function conky_Meteo_Noct_CondMeteo1(j)
    return conditionNoct[tonumber(j)].CondMeteo1
end

function conky_Meteo_Noct_CondMeteo2(j)
    return conditionNoct[tonumber(j)].CondMeteo2
end

function conky_Meteo_Noct_CondMeteo1se(j)
    return conditionNoct[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Noct_CondMeteo2se(j)
    return conditionNoct[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Noct_TempMax(j)
    return tonumber(conditionNoct[tonumber(j)].TempMax)
end

function conky_Meteo_Noct_TempMin(j)
    return tonumber(conditionNoct[tonumber(j)].TempMin)
end

function conky_Meteo_Noct_TempMaxRes(j)
    return tonumber(conditionNoct[tonumber(j)].TempMaxR)
end

function conky_Meteo_Noct_TempMinRes(j)
    return tonumber(conditionNoct[tonumber(j)].TempMinR)
end

function conky_Meteo_Noct_ProbPrec(j)
    return tonumber(conditionNoct[tonumber(j)].ProbPrec)
end

function conky_Meteo_Noct_VentDir(j)
    return conditionNoct[tonumber(j)].VentDir
end

function conky_Meteo_Noct_VentDirP(j)
    return conditionNoct[tonumber(j)].VentP
end

function conky_Meteo_Noct_VentForce(j)
    return tonumber(conditionNoct[tonumber(j)].VentForce)
end

function conky_Meteo_Noct_QPluie(j)
    return tonumber(conditionNoct[tonumber(j)].QPluie)
end

function conky_Meteo_Noct_QNeige(j)
    return tonumber(conditionNoct[tonumber(j)].QNeige)
end

function conky_Meteo_Noct_Humidite(j)
    return tonumber(conditionNoct[tonumber(j)].Humidite)
end

function conky_Meteo_Noct_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionNoct[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then 
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Noct_Rose(j)
    return tonumber(conditionNoct[tonumber(j)].PointRosee)
end

function conky_Meteo_Noct_Visibilite(j)
    return tonumber(conditionNoct[tonumber(j)].Visibilite)
end

function conky_Meteo_Noct_IconeM(r, p, s, f, j)
    return "${image "..r.."/nuit/"..conditionNoct[tonumber(j)].Icone..".png -p "..p.." -s "..s.." -f "..f.."}"
end

function conky_Meteo_Noct_IconeV(r, p, s, f, j)
    return "${image "..r.."/"..conditionNoct[tonumber(j)].VentIcone.." -p "..p.." -s "..s.." -f "..f.."}"
end


--Lunaison

function conky_Lune_ephemerides()
    return ephemerides
end

function conky_Lune_ephemerides1()
    return ephemerides1
end

function conky_Lune_ephemerides2()
    return ephemerides2
end

function conky_Lune_Visibilite()
    return Visibilite
end

function conky_Lune_Phases()
    return Phases
end

function conky_Lune_Phases1()
    return Phases1
end

function conky_Lune_Phases2()
    return Phases2
end

function conky_Lune_Noeudlunaire()
    return Noeud_lunaire
end

function conky_Lune_Apogee()
    return Apogee
end

function conky_Lune_Perigee()
    return Perigee
end

function conky_Lune_Distance()
    return Distance
end

function conky_Lune_Age()
    return Age
end

function conky_Lune_HLeverLune()
    return Lever_LuneHeure
end

function conky_Lune_MLeverLune()
    return Lever_LuneMinute
end

function conky_Lune_HCoucherLune()
    return Coucher_LuneHeure
end

function conky_Lune_MCoucherLune()
    return Coucher_LuneMinute
end

function conky_Lune_EclipsePartielle(format)
    if format == nil then format = "%A_%d_%B_%Y_à_%H:%M" end
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, Eclipse_partielle))
end

function conky_Lune_EclipseTotal()
    if format == nil then format = "%A_%d_%B_%Y_à_%H:%M" end
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, Eclipse_total))
end


--Informations sur le lua
function conky_Version()
    return Version
end

function conky_Meteo_fichier_init()
    return fichier_init
end

function conky_Meteo_etat_MAJ()
    return MAJ
end


--Sauvegarde des données
function sauvegarde()

--sauvegarde prévision
    for j = 1,jours do
        local file = assert(io.open(repsauv.."prevision"..j, "w+"))
        file:write ("\n")
        local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "Temp", "TempRes", "ProbPrec", "VentDir", "VentP", "VentForce", "VentRafales", "Uv", "ProbOrage", "NivPrec", "QPluie", "QNeige", "Icone", "VentIcone", "RafalesIcone", "EVerglas"}
        for i = 1, 21 do
            file:write (conditionJour[j][t[i]], "\n")
        end
        t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "Temp", "TempRes", "ProbPrec", "VentDir", "VentP", "VentForce", "VentRafales", "ProbOrage", "NivPrec", "QPluie", "QNeige", "Icone", "VentIcone", "RafalesIcone", "EVerglas"}
        for i = 1, 20 do
            file:write (conditionNuit[j][t[i]], "\n")
        end
        t= {"Jour", "LeverSoleilH", "LeverSoleilM", "CoucherSoleilH", "CoucherSoleilM", "Histo_Max", "Histo_Min"}
        for i = 1, 7 do
            file:write (InfoJour[j][t[i]], "\n")
        end
        io.close(file)

        if matin == "oui" then
            local file = assert(io.open(repsauv.."matin"..j, "w+"))
            file:write ("\n")
            local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
            for i = 1, 21 do
                file:write (conditionMatin[j][t[i]], "\n")
            end
            io.close(file)
        end
        if apresmidi == "oui" then
            local file = assert(io.open(repsauv.."ApresMidi"..j, "w+"))
            file:write ("\n")
            local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
            for i = 1, 21 do
                file:write (conditionAM[j][t[i]], "\n")
            end
            io.close(file)
        end
        if soiree == "oui" then
            local file = assert(io.open(repsauv.."Soiree"..j, "w+"))
            file:write ("\n")
            local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
            for i = 1, 21 do
                file:write (conditionSoiree[j][t[i]], "\n")
            end
            io.close(file)
        end
        if nuit == "oui" then
            local file = assert(io.open(repsauv.."Nuit"..j, "w+"))
            file:write ("\n")
            local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
            for i = 1, 21 do
                file:write (conditionNoct[j][t[i]], "\n")
            end
            io.close(file)
        end
    end

--sauvegarde lunaison
    local file = assert(io.open(repsauv.."lunaison", "w+"))
    file:write ("\n", ephemerides, "\n")
    file:write (ephemerides1, "\n")
    file:write (ephemerides2, "\n")
    file:write (Visibilite, "\n")
    file:write (Phases, "\n")
    file:write (Phases1, "\n")
    file:write (Phases2, "\n")
    file:write (Noeud_lunaire, "\n")
    file:write (Apogee, "\n")
    file:write (Perigee, "\n")
    file:write (Distance, "\n")
    file:write (Age, "\n")
    file:write (Lever_LuneHeure, "\n")
    file:write (Lever_LuneMinute, "\n")
    file:write (Coucher_LuneHeure, "\n")
    file:write (Coucher_LuneMinute, "\n")
    file:write (Eclipse_partielle, "\n")
    file:write (Eclipse_total, "\n")
    io.close(file)
    
--Sauvegarde condition courante
    local file = assert(io.open(repsauv.."CondCour", "w+") )
    file:write ("\n")
    local t = {"Icone", "Tempr", "Temp", "Cond", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "VentDir", "VentPlein", "VentForce", "VentIcone", "Humidite", "PointRosee", "Pression", "Visibilite", "Date", "Ville", "CouvNuage", "Uv", "QPrec", "latitude", "longitude"}
    for i = 1,23 do
        file:write (conditioncourante[t[i]], "\n")
    end
    file:write (time, "\n")
    io.close(file)

end 

merci

Hors ligne

#946 Le 18/06/2012, à 11:22

ragamatrix

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

@Didier-T
Je n'ai pas "conkyall" lorsque je veux l'installer il me demande de supprimer conky-std ??Je ne sais pas quelle lib "io" installer ni quelle "os"
Que dois-je faire ?
Merci

Dernière modification par ragamatrix (Le 18/06/2012, à 11:27)

Hors ligne

#947 Le 18/06/2012, à 13:24

Didier-T

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

Ok, et bien en effet il faut installer le conky all et accepter ce que te demande le système, vérifie les autres dépendances sur le post 1.

P.S. : c'est ton conky qui m'intéressait. wink

Hors ligne

#948 Le 18/06/2012, à 16:00

ragamatrix

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

Didier-T a écrit :

Ok, et bien en effet il faut installer le conky all et accepter ce que te demande le système, vérifie les autres dépendances sur le post 1.

P.S. : c'est ton conky qui m'intéressait. wink

J'ai installé les dépendances et ça roule !
Merci !
Bon aprem
cool

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

Hors ligne

#949 Le 19/06/2012, à 15:30

Phyllinux

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

@ Didier-T :

Petite question sur Voyager :
Je finis la migration de mon netbook sur Voyager; Cette 'distribution' est vraiment bien adaptée à de petites configurations, et cela tourne impec. Il y a juste quelques petites habitudes à prendre, mais rien de très méchant.
J'ai cependant un petit souci avec les conkys.
Partant d'un 'Home' vide, je vais réinstaller mes différents conkys. Pour commencer, et pour avoir tout ce qui est nécessaire au départ (scripts, icônes, etc...), j'ai téléchargé ton pack, et je l'ai installé sans rien y toucher (j'ai même la météo de Montréal pour le moment smile )
Cela fonctionne correctement, mais, petit souci, en prenant les fichiers bruts et sans la moindre modif, le conky est sur un fond noir, et pas la moindre transparence. Ce qui ne rend pas terrible au final... Entre les différents cadres, j'ai du noir opaque. Or, sur tes posts, la transparence est bien gérée. Aurais je oublié quelque chose ?

Question annexe ? Quelle est la technique pour installer des polices sur Voyager ? Car le double clic sur la police ne marche pas. La solution que j'ai adopté, c'est un copier-coller en Administrateur pour rajouter la police LED, l'installation ne s'étant pas faite.

Merci

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


The ship is sinking normally...

Hors ligne

#950 Le 19/06/2012, à 18:28

Didier-T

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

@ Phyllinux,

En fait il faut faire la mise à jour en xfce 4.10, pour la gestion de la fausse transparence de conky.

A mon avis pour ce qui est des polices de caractères, ta solution est la meilleur, seulement il ne faut pas oublier de réactualiser la liste des polices avec la commande suivante

fc-cache -v -f

Au fait, bienvenu sur voyager, la prochaine version devrait être très sympa.

Hors ligne