salut à tous ! j'aurais besoin de votre aide.
j'ai fait une réinstallation de mon systeme, javais sauvegardé mon dossier conky, et quand je l'ai remis tout mes conky etait ok sauf le conky meteo.
je n'ai plus aucune infos dans les fichiers "curre_cond" "jour0" "jour1" etc... et "messages" , les fichiers sont present au lancement du conky mais sont vides. Et les images J1.png J2.png etc... disparaissent à chaque lancement.
ce qui fait que je n'ai rien qui s'affiche à part le texte du script. Ni images ni infos meteo.
pourtant je n'ai rien changé à la config des fichiers "afmeteo" et "meteo" ni à l'emplacement des dossiers etc...
voici mon script au cas ou :
TEXT
#######################################
${voffset 17}${offset 15}${font Santana:weight=bold:size=13}${color orange}Frohmuhl${execpi 1800 ~/conky/meteo/meteo}
${font Santana:size=10}${color whitesmoke}${offset 15}Conditions : ${color orange}${execpi 600 sed -n '1p' ~/conky/meteo/messages}${color orange}
${offset 18}${execpi 600 sed -n '2p' ~/conky/meteo/messages}
${voffset 8}${font Santana:size=10}${color whitesmoke}${offset 15}Humidité : ${color orange}${execpi 1800 ~/conky/meteo/afmeteo taux_humidite cc}
${voffset 3}${font Santana:size=10}${color whitesmoke}${offset 15}Sens vent : ${color orange}${execpi 1800 ~/conky/meteo/afmeteo direction_vent cc}
${voffset 3}${font Santana:size=10}${color whitesmoke}${offset 15}Vitesse vent : ${color orange}${execpi 1800 ~/conky/meteo/afmeteo vitesse_vent cc}
${voffset 23}${font Santana:size=10}${color whitesmoke}${offset 15}Pression : ${color orange}${execpi 1800 ~/conky/meteo/afmeteo pression cc} - ${execpi 1800 ~/conky/meteo/afmeteo tend_pression cc}
${goto 190}${voffset -144}${font Santana:size=32}${color 5C5C5C}${execpi 1800 ~/conky/meteo/afmeteo temp cc}
#######################################
${voffset 108}${font Santana:size=8}${color orange}${goto 25}${execpi 1800 ~/conky/meteo/afmeteo temp 1 jour}${color white}/${execpi 1800 ~/conky/meteo/afmeteo temp 1 soir}${font Santana:size=8}${color orange}${goto 75}${execpi 1800 ~/conky/meteo/afmeteo temp 2 jour}${color white}/${execpi 1800 ~/conky/meteo/afmeteo temp 2 soir}${font Santana:size=7}${color orange}${goto 122}${execpi 1800 ~/conky/meteo/afmeteo temp 3 jour}${color white}/${execpi 1800 ~/conky/meteo/afmeteo temp 3 soir}${font Santana:size=8}${color orange}${goto 170}${execpi 1800 ~/conky/meteo/afmeteo temp 4 jour}${color white}/${execpi 1800 ~/conky/meteo/afmeteo temp 4 soir}${font Santana:size=8}${color orange}${goto 214}${execpi 1800 ~/conky/meteo/afmeteo temp 5 jour}${color white}/${execpi 1800 ~/conky/meteo/afmeteo temp 5 soir}
${font Santana:size=8}${color AFAFAF}${goto 26}${execpi 1800 ~/conky/meteo/afmeteo jour 1}${font Santana:size=8}${goto 76}${execpi 1800 ~/conky/meteo/afmeteo jour 2}${font Santana:size=8}${goto 125}${execpi 1800 ~/conky/meteo/afmeteo jour 3}${font Santana:size=8}${goto 172}${execpi 1800 ~/conky/meteo/afmeteo jour 4}${font Santana:size=8}${goto 213}${execpi 1800 ~/conky/meteo/afmeteo jour 5}
#######################################
${image ~/conky/weather+clock/images/base4.png -p -12,-12 -s 290x285}
${image ~/conky/meteo/icones/cc.png -p 120,65 -s 135x81}
${image ~/conky/meteo/icones/J1jour.png -p 10,170 -s 50x30}
${image ~/conky/meteo/icones/J2jour.png -p 60,170 -s 50x30}
${image ~/conky/meteo/icones/J3jour.png -p 108,170 -s 50x30}
${image ~/conky/meteo/icones/J4jour.png -p 155,170 -s 50x30}
${image ~/conky/meteo/icones/J5jour.png -p 200,170 -s 50x30}
afmeteo :
#!/bin/bash
# Créé par Didier-T (forum.ubuntu-fr.org)
# utilisation
# afmeteo.sh 'info à afficher' 'jour' 'moment'
#<jour> soit maintenant = cc soit un nombre de 0 à 14 (0 prévision pour aujourd'hui)
#<moment> jour ou soir (uniquement pour les prévisions)
DirShell="$HOME/conky/meteo"
meteo() {
case $3 in
[Jj]our)
m=0
;;
[Ss]oir)
m=1
;;
*)
m=0
;;
esac
p=$(($1+$(($m*21))))
echo $(sed -n "$(($p))p" ${DirShell}/jour$2)
}
case $2 in
cc)
case $1 in
[Tt]emp) affichage=$(sed -n "2p" ${DirShell}/curr_cond)"°" ;;
[Mm]eteo) affichage=$(sed -n "3p" ${DirShell}/curr_cond) ;;
[Tt]emp_res) affichage=$(sed -n "4p" ${DirShell}/curr_cond)"°" ;;
[Dd]irection_[Vv]ent) affichage=$(sed -n "5p" ${DirShell}/curr_cond) ;;
[Vv]itesse_[Vv]ent) affichage=$(sed -n "6p" ${DirShell}/curr_cond)"" ;;
[Tt]aux_[Hh]umidite) affichage=$(sed -n "7p" ${DirShell}/curr_cond) ;;
[Pp]_[Rr]osee) affichage=$(sed -n "8p" ${DirShell}/curr_cond)"°C" ;;
[Pp]ression) affichage=$(sed -n "9p" ${DirShell}/curr_cond) ;;
[Tt]end_[Pp]ression) affichage=$(sed -n "10p" ${DirShell}/curr_cond) ;;
[Vv]isibilite) affichage=$(sed -n "11p" ${DirShell}/curr_cond) ;;
[Ll]ever_[Ss]oleil) affichage=$(sed -n "12p" ${DirShell}/curr_cond) ;;
[Cc]oucher_[Ss]oleil) affichage=$(sed -n "13p" ${DirShell}/curr_cond) ;;
*)
affichage="erreur"
;;
esac
;;
*)
case $1 in
[Jj]our) affichage=$(meteo 1 $2) ;;
[Mm]eteo) affichage=$(meteo 3 $2 $3) ;;
[Tt]emp) affichage=$(meteo 5 $2 $3)"°" ;;
[Tt]emp_res) affichage=$(meteo 7 $2 $3)"°C" ;;
[Dd]irection_[Vv]ent) affichage=$(meteo 9 $2 $3) ;;
[Vv]itesse_[Vv]ent) affichage=$(meteo 10 $2 $3)"km/h" ;;
[Pp]rob_[Oo]rage) affichage=$(meteo 12 $2 $3) ;;
[Qq]_[Pp]recipitation) affichage=$(meteo 14 $2 $3)"mm" ;;
[Qq]_[Pp]luie) affichage=$(meteo 16 $2 $3)"mm" ;;
[Qq]_[Nn]eige) affichage=$(meteo 18 $2 $3)"mm" ;;
[Dd]uree_[Pp]recipitation) affichage=$(meteo 20 $2 $3) ;;
[Dd]uree_[Pp]luie) affichage=$(meteo 22 $2 $3) ;;
[Ll]ever_[Ss]oleil) affichage=$(meteo 45 $2) ;;
[Cc]oucher_[Ss]oleil) affichage=$(meteo 47 $2) ;;
[Ll]ever_[Ll]une) affichage=$(meteo 49 $2) ;;
[Cc]oucher_[Ll]une) affichage=$(meteo 51 $2) ;;
[Dd]uree_[Jj]our) affichage=$(meteo 53 $2)" Heures" ;;
[Dd]uree_[Nn]uit) affichage=$(meteo 55 $2)" Heures" ;;
uv|UV|Uv|uV) affichage=$(meteo 57 $2) ;;
*)
affichage="erreur"
;;
esac
;;
esac
# retour information
echo $affichage
exit 0
meteo :
#!/bin/bash
#Repertoir de travail
DirShell="$HOME/conky/meteo"
#Copier votre adresse Accuweather ici
address="http://www.accuweather.com/fr/fr/alsace/frohmuhl/quick-look.aspx?cityid=141896"
#Prévision sur n jour (de 1 à 15)
periode=7
#function: test_image
test_image () {
case $1 in
1) echo 1su ;;
2) echo 2msu ;;
3) echo 3psu ;;
4) echo 4ic ;;
5) echo 5h ;;
6) echo 6mc ;;
7) echo 7c ;;
8) echo 8d ;;
11) echo 9f ;;
12) echo 10s ;;
13) echo 11mcs ;;
14) echo 12psus ;;
15) echo 13t ;;
16) echo 14mct ;;
17) echo 15psut ;;
18) echo 16r ;;
19) echo 17fl ;;
20) echo 18mcfl ;;
21) echo 19psfl ;;
22) echo 20sn ;;
23) echo 21mcsn ;;
24) echo 22i ;;
25) echo 23sl ;;
26) echo 24fr ;;
29) echo 25rsn ;;
30) echo 27ho ;;
31) echo 28co ;;
32) echo 26w ;;
33) echo 29cl ;;
34) echo 31mcl ;;
35) echo 32pc ;;
36) echo 33ic ;;
37) echo 34h ;;
38) echo 35mc ;;
39) echo 36pcs ;;
40) echo 37mcs ;;
41) echo 38pct ;;
42) echo 39mct ;;
43) echo 40mcfl ;;
44) echo 41mcsn ;;
esac
}
meteo_a_n_jours() {
for (( x=1; x<=$1; x+=1 ))
do
wget --load-cookies ${DirShell}/cookie -O ${DirShell}/details$(($x-1)) ${addr_week}"details${x}.aspx"
done
#Formatage détails journaliers
for (( x=0; x<=$(($1-1)); x+=1 ))
do
egrep -i 'lblDetails|imgDayIcon|lblDayText|lblHigh|lblHighValue|lblRealFeel|lblRealFeelValue|lblWinds|lblWindsValue|lblTStormProb|lblTStormProbValue|lblPrecip|lblPrecipValue|lblRain|lblRainValue|lblSnow|lblSnowValue|lblHoursPrecip|lblHoursPrecipValue|lblHoursOfRain|lblHoursOfRainValue|lblHoursOfRainValue|imgNightIcon|lblNightText|lblLow|lblLowValue|lblRealFeelN|lblRealFeelNValue|lblWindsN|lblWindsNValue|lblTStormProbN|lblTStormProbNValue|lblPrecipN|lblPrecipNValue|lblRainN|lblRainNValue|lblSnowN|lblSnowNValue|lblHoursPrecipN|lblHoursPrecipNValue|lblHoursOfRainN|lblHoursOfRainNValue|lblSunrise|lblSunset|lblMoonrise|lblMoonset|lblDaylight|lblDarkness' ${DirShell}/details$x > ${DirShell}/jour$x
egrep -i 'lblMaxUV|lblMaxUVValue' ${DirShell}/details$x >> ${DirShell}/jour$x
sed -i 's/\(^.*blue\/\|^.*pour \|_int.jpg.*$\|^.*">\|<\/.*$\|°C\)//g' ${DirShell}/jour$x
sed -i -e 's/: /\n/g' -e 's/W/O/g' -e '1s/ .*$//' ${DirShell}/jour$x
sed -i -e '1s/^./\u&/' -e '1s/./\n/4' ${DirShell}/jour$x
sed -i '2d' ${DirShell}/jour$x
for (( i=2; i<=22; i+=20 ))
do
image_raw=$(sed -n "${i}"p ${DirShell}/jour$x)
sed -i ${i}s/$image_raw/$(test_image $image_raw)/ ${DirShell}/jour$x
done
cp ${DirShell}/icones/base/$(sed -n 2p ${DirShell}/jour$x).png ${DirShell}/icones/J${x}jour.png
cp ${DirShell}/icones/base/$(sed -n 22p ${DirShell}/jour$x).png ${DirShell}/icones/J${x}soir.png
for (( i=29; i>=9; i-=20 ))
do
sed -i $i's/ /\n/' ${DirShell}/jour$x
done
def_vent $x
sed -n 3p ${DirShell}/jour$x >> ${DirShell}/messages
sed -n 24p ${DirShell}/jour$x >> ${DirShell}/messages
done
rm ${DirShell}/details*
}
def_vent() {
case $1 in
curr)
dvent=$(sed -n "5p" ${DirShell}/curr_cond)
fvent=$(sed -n "6p" ${DirShell}/curr_cond)
v=$(direction_vent $dvent)
cp $(icone_vent $v $fvent) ${DirShell}/icones/vcc.png
;;
*)
for (( i1=0; i1<=1; i1+=1 ))
do
n=$(($(($i1*21))+9))
dvent=$(sed -n "$(($n))p" ${DirShell}/jour$1)
fvent=$(sed -n "$(($n+1))p" ${DirShell}/jour$1)
v=$(direction_vent $dvent)
if (( $i1==0 )); then
moment="jour"
else
moment="soir"
fi
cp $(icone_vent $v $fvent) ${DirShell}/icones/v$1$moment.png
done
;;
esac
}
direction_vent() {
case $1 in
Variable) echo 1 ;;
N) echo 10 ;;
NNE) echo 11 ;;
NE) echo 12 ;;
ENE) echo 13 ;;
E) echo 14 ;;
ESE) echo 15 ;;
SE) echo 16 ;;
SSE) echo 17 ;;
S) echo 2 ;;
SSO) echo 3 ;;
SO) echo 4 ;;
OSO) echo 5 ;;
O) echo 6 ;;
ONO) echo 7 ;;
NO) echo 8 ;;
NNO) echo 9 ;;
*) echo 0 ;;
esac
}
icone_vent() {
if (( $2 <= 20 )); then
n=$1
elif (( $2 <= 35 )); then
n=$(($1+17))
elif (( $2 <= 50 )); then
n=$(($1+34))
elif (( $2 >= 51 )); then
n=$(($1+51))
fi
if (( $n <= 9 )); then
n="0$n"
fi
echo "${DirShell}/icones/base/vent/$n.png"
}
decoupage() {
for (( i=1; i<=$(($1*4)); i++))
do
no=$(sed -n ${i}p ${DirShell}/messages|wc -m)
if (( no<=21 )); then
sed -i $i"s/$/\n/" ${DirShell}/messages
i=$((i+1))
elif (( no>21 )); then
nbesp=$(awk '{ x=0; x+=gsub("\\ ",""); print x }' ${DirShell}/messages | sed -n "$(($i))p")
pos=$(($(($nbesp/2))+1))
sed -i $i"s/ /\n/$pos" ${DirShell}/messages
i=$((i+1))
fi
done
}
#Fin des fonctions début du script
ping -c 2 www.accuweather.com>>/dev/null
if [ $? -eq 0 ]
then
rm ${DirShell}/icones/*.png
rm ${DirShell}/jour*
rm ${DirShell}/messages
wget --save-cookies ${DirShell}/cookie -O ${DirShell}/curr_cond_raw $address
addr_week=$(echo $address|sed 's/quick.*$//')
#Formatage condition acctuelle
egrep -i 'CurrentTemp|CurrentText|RealFeelValue|WindsValue|HumidityValue|DewPointValue|PressureValue|PressureTenValue|VisibilityValue|SunriseValue|SunsetValue|imgCurConCondition' ${DirShell}/curr_cond_raw > ${DirShell}/curr_cond
rm ${DirShell}/curr_cond_raw
sed -i -e 's/\(^.*blue\/\|_int.*$\|^.*">\|<\/span>.*$\|°C\)//g' -e 's/W/O/g' ${DirShell}/curr_cond
curr_cond_raw_image=$(sed -n 1p ${DirShell}/curr_cond)
sed -i 1s/$curr_cond_raw_image/$(test_image $curr_cond_raw_image)/ ${DirShell}/curr_cond
cp ${DirShell}/icones/base/$(sed -n 1p ${DirShell}/curr_cond).png ${DirShell}/icones/cc.png
sed -i 's/Unavailable/N\/A/g' ${DirShell}/curr_cond
sed -i '5s/ /\n/' ${DirShell}/curr_cond
sed -i '6s/ .*$//' ${DirShell}/curr_cond
def_vent curr
#-----------------------------------------
meteo_a_n_jours $periode
decoupage $periode
rm ${DirShell}/cookie
fi