daniel38100 a écrithttp://pix.toile-libre.org/upload/img/1357154561.png
pour le script
images_meteo.lua
-- Créé par Didier-T (forum.ubuntu-fr.org), pour jpdipsy
-- Nécessite imagemagick http://apt.ubuntu.com/p/imagemagick
require "io"
require "os"
local Version = "v2.3c"
local conditionJour = {}
local conditionNuit = {}
local conditionMatin = {}
local conditionAM = {}
local conditionSoiree = {}
local conditionNoct = {}
local InfoJour = {}
local conditioncourante = {}
local huitHeures = {}
local Thermometre = {}
local ThermometresRond = {}
local init_thermo = {}
local init_thermo_res = {}
local init_rose = {}
local init_rose_raf = {}
local lunaison = {}
local Barometre = {}
local Rep, cmd, jours, matin, apresmidi, soiree, nuit, delais, r, repsauv, l, Rep_Therm, Rep_Rose, Palier, t1, MAJHold, maj1, Nb_Thermo, Rep_Lune, Rep_Barometre, Rep_ThermRond, Nb_ThermRond, palier1, palier2, palier3, palier4, mise_en_page, fich_creationmodule
local boucle, imagecfg,meteocfg
boucle = tonumber("0")
-- Création rose des vent par jpdipsy
function Rose(i, dp, v, nom, taille, opacite)
local angle, couleur, f ,couleurfont
local vitesse = "'"..v.." km/h'"
if v ~= nil then
f = tonumber(v)
else
f = 0
end
if f <= Palier then
couleur = palier1
couleurfont = palier1coulfont
elseif f <= Palier*2 then
couleur = palier2
couleurfont = palier2coulfont
elseif f <= Palier*3 then
couleur = palier3
couleurfont = palier3coulfont
elseif f >= (Palier*3)+1 then
couleur = palier4
couleurfont = palier4coulfont
end
if i == "Calme" then
angle = nil
elseif i == "N" then
angle = 0
elseif i == "NNE" then
angle = 22.5
elseif i == "NE" then
angle = 45
elseif i == "ENE" then
angle = 67.5
elseif i == "E" then
angle = 90
elseif i == "ESE" then
angle = 112.5
elseif i == "SE" then
angle = 135
elseif i == "SSE" then
angle = 157.5
elseif i == "S" then
angle = 180
elseif i == "SSO" then
angle = 202.5
elseif i == "SO" then
angle = 225
elseif i == "OSO" then
angle = 247.5
elseif i == "O" then
angle = 270
elseif i == "ONO" then
angle = 292.5
elseif i == "NO" then
angle = 315
elseif i == "NNO" then
angle = 337.5
else
angle = nil
end
if angle ~= nil then
os.execute(' convert -background transparent '..Rep_Rose..'/'..couleur..' -rotate '..angle..' '..Rep..'/dir_rot.png && composite -compose Over -gravity Center '..Rep..'/dir_rot.png '..Rep_Rose..'/base.png '..Rep..'/'..nom..'.png')
--os.execute(' convert -background transparent '..Rep_Rose..'/Calme.png -rotate -'..angle..' '..Rep..'/dir_rot.png && composite -compose Over -gravity Center '..Rep..'/dir_rot.png '..Rep_Rose..'/'..couleur..' '..Rep..'/'..nom..'.png')
else
os.execute(' composite -compose Over -gravity Center '..Rep_Rose..'/Calme.png '..Rep_Rose..'/base.png '..Rep..'/'..nom..'.png')
end
os.execute(' convert '..Rep..'/'..nom..'.png -font '..repfonts..'/AlteHaasGroteskBold.ttf -fill '..couleurfont..' -pointsize 40 -gravity center -annotate +0+0 '..vitesse..' '..Rep..'/'..nom..'.png && mogrify -resize '..taille..'! '..Rep..'/'..nom..'.png && composite -blend 0x'..opacite..' null: '..Rep..'/'..nom..'.png -matte '..Rep..'/'..nom..'.png')
os.execute('chmod -R o+rw- '..Rep)
end
-- Récupération des infos à afficher
function Recup(info)
local num = info:match("%d+")
if num ~= nil then
info = string.gsub(info, num, "")
num = tonumber(num)
end
info = string.gsub(info, " ", "")
if info == "TempRes" then
T1 = conditioncourante.Tempr
elseif info == "TempAct" then
T1 = conditioncourante.Temp
elseif info == "Rose" then
T1 = conditioncourante.PointRosee
elseif info == "Pression" then
T1 = conditioncourante.Pression
elseif info == "Jour_Temp" then
T1 = conditionJour[num].Temp
elseif info == "Jour_TempRes" then
T1 = conditionJour[num].TempRes
elseif info == "Nuit_Temp" then
T1 = conditionNuit[num].Temp
elseif info == "Nuit_TempRes" then
T1 = conditionNuit[num].TempRes
elseif info == "Histo_Max" then
T1 = InfoJour[num].Histo_Max
elseif info == "Histo_Min" then
T1 = InfoJour[num].Histo_Min
elseif info == "Matin_TempMax" then
T1 = conditionMatin[num].TempMax
elseif info == "Matin_TempMin" then
T1 = conditionMatin[num].TempMin
elseif info == "Matin_TempMaxRes" then
T1 = conditionMatin[num].TempMaxR
elseif info == "Matin_TempMinRes" then
T1 = conditionMatin[num].TempMinR
elseif info == "Matin_Rose" then
T1 = conditionMatin[num].PointRosee
elseif info == "AM_TempMax" then
T1 = conditionAM[num].TempMax
elseif info == "AM_TempMin" then
T1 = conditionAM[num].TempMin
elseif info == "AM_TempMaxRes" then
T1 = conditionAM[num].TempMaxR
elseif info == "AM_TempMinRes" then
T1 = conditionAM[num].TempMinR
elseif info == "AM_Rose" then
T1 = conditionAM[num].PointRosee
elseif info == "Soiree_TempMax" then
T1 = conditionSoiree[num].TempMax
elseif info == "Soiree_TempMin" then
T1 = conditionSoiree[num].TempMin
elseif info == "Soiree_TempMaxRes" then
T1 = conditionSoiree[num].TempMaxR
elseif info == "Soiree_TempMinRes" then
T1 = conditionSoiree[num].TempMinR
elseif info == "Soiree_Rose" then
T1 = conditionSoiree[num].PointRosee
elseif info == "Noct_TempMax" then
T1 = conditionNoct[num].TempMax
elseif info == "Noct_TempMin" then
T1 = conditionNoct[num].TempMin
elseif info == "Noct_TempMaxRes" then
T1 = conditionNoct[num].TempMaxR
elseif info == "Noct_TempMinRes" then
T1 = conditionNoct[num].TempMinR
elseif info == "Noct_Rose" then
T1 = conditionNoct[num].PointRosee
elseif info == "huitHeure_TempMax" then
T1 = huitHeures[num].TempMax
elseif info == "huitHeure_TempMin" then
T1 = huitHeures[num].TempMin
elseif info == "huitHeure_TempMaxRes" then
T1 = huitHeures[num].TempMaxR
elseif info == "huitHeure_TempMinRes" then
T1 = huitHeures[num].TempMinR
elseif info == "huitHeure_Rose" then
T1 = huitHeures[num].PointRosee
end
T1 = tonumber(T1)
if T1 <= -30 then
T1 = -30
elseif T1 >= 50 then
T1 = 50
end
return T1
end
-- Création thermomètre par jpdipsy
function CreaThermometre(TherNb)
local NbPlot
local Tbase = Thermometre[TherNb].base
local Alcool = Thermometre[TherNb].mercure
Alcool = string.gsub(Alcool, " ", "")
local InfoAlcool = Recup(Thermometre[TherNb].mercure_info)
local Plot = {}
local InfoPlot = {}
if Thermometre[TherNb].plot ~= "" then
local PlotCherche = Thermometre[TherNb].plot
PlotCherche = string.gsub(PlotCherche, " ", "")
local InfoPlotCherche = Thermometre[TherNb].plot_info
local pos1 = 0
NbPlot = 0
while pos1 ~= nil do
local pos2 = string.find(PlotCherche, ",", pos1+1)
NbPlot = NbPlot+1
if pos2 ~= nil then
Plot[NbPlot] = string.sub(PlotCherche, pos1+1, pos2-1)
else
Plot[NbPlot] = string.sub(PlotCherche, pos1+1)
end
pos1 = pos2
end
pos1 = 0
NbPlot = 0
while pos1 ~= nil do
local pos2 = string.find(InfoPlotCherche, ",", pos1+1)
NbPlot = NbPlot+1
if pos2 ~= nil then
InfoPlot[NbPlot] = Recup(string.sub(InfoPlotCherche, pos1+1, pos2-1))
else
InfoPlot[NbPlot] = Recup(string.sub(InfoPlotCherche, pos1+1))
end
pos1 = pos2
end
end
if InfoAlcool > -30 then
local T1 = (InfoAlcool*5)+150
os.execute( "convert "..Rep_Therm.."/"..Alcool.." -resize 20x"..T1.."! "..Rep.."/colonne.png && composite -compose Over -geometry -0+108 -gravity South "..Rep.."/colonne.png "..Rep_Therm.."/"..Tbase.." "..Rep.."/Thermo"..TherNb..".png" )
else
os.execute( "cp "..Rep_Therm.."/"..Tbase.." "..Rep.."/Thermo"..TherNb..".png" )
end
if NbPlot ~= nil then
for i = 1, NbPlot do
T2 = InfoPlot[i]
local pos_T2 = (T2*5) +258
os.execute("composite -compose Over -geometry -0+"..pos_T2.." -gravity South "..Rep_Therm.."/"..Plot[i].." "..Rep.."/Thermo"..TherNb..".png "..Rep.."/Thermo"..TherNb..".png")
end
end
os.execute('mogrify -resize '..Thermometre[TherNb].taille..'! '..Rep..'/Thermo'..TherNb..'.png && composite -blend 0x'..Thermometre[TherNb].opacite..' null: '..Rep..'/Thermo'..TherNb..'.png -matte '..Rep..'/Thermo'..TherNb..'.png')
os.execute('chmod -R o+rw- '..Rep)
end
function CreaThermometreRond(TherNb)
local val
os.execute(' cp '..Rep_ThermRond..'/base.png '..Rep..'/Thermorond'..TherNb..'.png')
if ThermometresRond[TherNb].bleu ~= nil then
val = Recup(ThermometresRond[TherNb].bleu)
val = string.gsub(val, " ", "")
cree("ind-bleu", val, TherNb)
end
if ThermometresRond[TherNb].rouge ~= nil then
val = Recup(ThermometresRond[TherNb].rouge)
val = string.gsub(val, " ", "")
cree("ind-rouge", val, TherNb)
end
if ThermometresRond[TherNb].vert ~= nil then
val = Recup(ThermometresRond[TherNb].vert)
val = string.gsub(val, " ", "")
cree("ind-vert", val, TherNb)
end
if ThermometresRond[TherNb].jaune ~= nil then
val = Recup(ThermometresRond[TherNb].jaune)
val = string.gsub(val, " ", "")
cree("ind-jaune", val, TherNb)
end
if ThermometresRond[TherNb].blanc ~= nil then
val = Recup(ThermometresRond[TherNb].blanc)
val = string.gsub(val, " ", "")
cree("ind-blanc", val, TherNb)
end
if ThermometresRond[TherNb].aiguille ~= nil then
val = Recup(ThermometresRond[TherNb].aiguille)
val = string.gsub(val, " ", "")
cree("aiguille", val, TherNb)
end
os.execute('mogrify -resize '..ThermometresRond[TherNb].taille..'! '..Rep..'/Thermorond'..TherNb..'.png && composite -blend 0x'..ThermometresRond[TherNb].opacite..' null: '..Rep..'/Thermorond'..TherNb..'.png -matte '..Rep..'/Thermorond'..TherNb..'.png')
os.execute('chmod -R o+rw- '..Rep)
end
function cree(aiguille, angle, TherNb)
angle = (angle*4)-40
os.execute(' convert -background transparent '..Rep_ThermRond..'/'..aiguille..'.png -rotate '..angle..' '..Rep..'/direction_rot.png && composite -compose Over -gravity Center '..Rep..'/direction_rot.png '..Rep..'/Thermorond'..TherNb..'.png '..Rep..'/Thermorond'..TherNb..'.png')
end
function lune()
local j, h, m = Age:match("(%d+) Jours (%d+)h (%d+)m")
if j == nil then
j, h, m = Age:match("(%d+) Jour (%d+)h (%d+)m")
if j == nil then
h, m = Age:match("(%d+)h (%d+)m")
j = 0
end
end
local angle = ((360/42524)*((((j*24)+h)*60)+m))+180
os.execute(' convert -background transparent '..Rep_Lune..'/indicateur.png -rotate '..angle..' '..Rep..'/indicateur_rot.png && composite -compose Over -gravity Center '..Rep..'/indicateur_rot.png '..Rep_Lune..'/lune-base.png '..Rep..'/lune.png && mogrify -resize '..lunaison.taille..'! '..Rep..'/lune.png && composite -blend 0x'..lunaison.opacite..' null: '..Rep..'/lune.png -matte '..Rep..'/lune.png')
os.execute('chmod -R o+rw- '..Rep)
end
function Baro()
local angle = ((conditioncourante.Pression-980)*4.5)-135
---- Aiguille
os.execute('convert -background transparent '..Rep_Barometre..'/aiguille.png -rotate '..angle..' '..Rep..'/aiguille_rot.png && composite -compose Over -gravity Center '..Rep..'/aiguille_rot.png '..Rep_Barometre..'/base.png '..Rep..'/Barometre.png && mogrify -resize '..Barometre.taille..'! '..Rep..'/Barometre.png && composite -blend 0x'..Barometre.opacite..' null: '..Rep..'/Barometre.png -matte '..Rep..'/Barometre.png')
os.execute('chmod -R o+rw- '..Rep)
end
-- initialisation création rose des sables
function fonc_init_rose()
for j = 1,jours do
init_rose[j] = {CondCour=nil, Jour=nil, Nuit=nil, Matin=nil, AM=nil, Soiree=nil, Noct=nil, huitHeures=nil}
init_rose_raf[j]= {CondCour=nil, Jour=nil, Nuit=nil, Matin=nil, AM=nil, Soiree=nil, Noct=nil, huitHeures=nil}
end
end
-----Affichage Barometre
function conky_Images_Barometre(p, s, f, o)
if Barometre.taille == nil then
Barometre.opacite = o
Barometre.taille = s
Baro()
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/Barometre.png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/Barometre.png "
end
end
-----Affichage lune
function conky_Images_Lunaison(p, s, f, o)
if lunaison.taille == nil then
lunaison.opacite = o
lunaison.taille = s
lune()
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/lune.png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/lune.png "
end
end
-----Affichage Thermometre
function conky_Images_Thermo(p, s, f, n, o)
n = tonumber(n)
if Thermometre[n].opacite == nil then
Thermometre[n].opacite = o
Thermometre[n].taille = s
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/Thermo"..n..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/Thermo"..n..".png"
end
end
function conky_Images_ThermoRond(p, s, f, n, o, a, b, c, d)
--p=position s=taille f=frequence de rafraichissement n=num therm o=opacité a=info 1 b=info 2 c=info 3 d=info 4
n = tonumber(n)
if ThermometresRond[n] == nil then
ThermometresRond[n] = {}
Nb_ThermRond = n
local pos
if a ~= nil then
a = string.gsub(a, "-", " ")
if string.find(a, 'a=') ~= nil then
pos = string.find(a, '=')
ThermometresRond[n].aiguille = string.sub(a, pos+1)
elseif string.find(a, 'b=') ~= nil then
pos = string.find(a, '=')
ThermometresRond[n].bleu = string.sub(a, pos+1)
elseif string.find(a, 'r=') ~= nil then
pos = string.find(a, '=')
ThermometresRond[n].rouge = string.sub(a, pos+1)
elseif string.find(a, 'v=') ~= nil then
pos = string.find(a, '=')
ThermometresRond[n].vert = string.sub(a, pos+1)
elseif string.find(a, 'j=') ~= nil then
pos = string.find(a, '=')
ThermometresRond[n].jaune = string.sub(a, pos+1)
elseif string.find(a, 'w=') ~= nil then
pos = string.find(a, '=')
ThermometresRond[n].blanc = string.sub(a, pos+1)
end
end
if b ~= nil then
b = string.gsub(b, "-", " ")
if string.find(b, 'a=') ~= nil then
pos = string.find(b, '=')
ThermometresRond[n].aiguille = string.sub(b, pos+1)
elseif string.find(b, 'b=') ~= nil then
pos = string.find(b, '=')
ThermometresRond[n].bleu = string.sub(b, pos+1)
elseif string.find(b, 'r=') ~= nil then
pos = string.find(b, '=')
ThermometresRond[n].rouge = string.sub(b, pos+1)
elseif string.find(b, 'v=') ~= nil then
pos = string.find(b, '=')
ThermometresRond[n].vert = string.sub(b, pos+1)
elseif string.find(b, 'j=') ~= nil then
pos = string.find(b, '=')
ThermometresRond[n].jaune = string.sub(b, pos+1)
elseif string.find(b, 'w=') ~= nil then
pos = string.find(b, '=')
ThermometresRond[n].blanc = string.sub(b, pos+1)
end
end
if c ~= nil then
c = string.gsub(c, "-", " ")
if string.find(c, 'a=') ~= nil then
pos = string.find(c, '=')
ThermometresRond[n].aiguille = string.sub(c, pos+1)
elseif string.find(c, 'b=') ~= nil then
pos = string.find(c, '=')
ThermometresRond[n].bleu = string.sub(c, pos+1)
elseif string.find(c, 'r=') ~= nil then
pos = string.find(c, '=')
ThermometresRond[n].rouge = string.sub(c, pos+1)
elseif string.find(c, 'v=') ~= nil then
pos = string.find(c, '=')
ThermometresRond[n].vert = string.sub(c, pos+1)
elseif string.find(c, 'j=') ~= nil then
pos = string.find(c, '=')
ThermometresRond[n].jaune = string.sub(c, pos+1)
elseif string.find(c, 'w=') ~= nil then
pos = string.find(c, '=')
ThermometresRond[n].blanc = string.sub(c, pos+1)
end
end
if d ~= nil then
d = string.gsub(d, "-", " ")
if string.find(d, 'a=') ~= nil then
pos = string.find(d, '=')
ThermometresRond[n].aiguille = string.sub(d, pos+1)
elseif string.find(d, 'b=') ~= nil then
pos = string.find(d, '=')
ThermometresRond[n].bleu = string.sub(d, pos+1)
elseif string.find(d, 'r=') ~= nil then
pos = string.find(d, '=')
ThermometresRond[n].rouge = string.sub(d, pos+1)
elseif string.find(d, 'v=') ~= nil then
pos = string.find(d, '=')
ThermometresRond[n].vert = string.sub(d, pos+1)
elseif string.find(a, 'j=') ~= nil then
pos = string.find(d, '=')
ThermometresRond[n].jaune = string.sub(d, pos+1)
elseif string.find(d, 'w=') ~= nil then
pos = string.find(d, '=')
ThermometresRond[n].blanc = string.sub(d, pos+1)
end
end
ThermometresRond[n].taille = s
ThermometresRond[n].opacite = o
CreaThermometreRond(n)
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/Thermorond"..n..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/Thermorond"..n..".png"
end
end
-----Affichage rose des sables
--Condition courante
function conky_Images_Rose(p, s, f, o)
j = 1
if init_rose[j].CondCour == nil then
Rose(conditioncourante.VentDir, conditioncourante.VentPlein, conditioncourante.VentForce, "Rose", s, o)
init_rose[j].CondCour = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/Rose.png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/Rose.png"
end
end
--Prévision sur la journée
function conky_Images_Jour_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].Jour == nil then
Rose(conditionJour[j].VentDir, conditionJour[j].VentP, conditionJour[j].VentForce, "RoseJour"..j, s, o)
init_rose[j].Jour = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseJour"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseJour"..j..".png"
end
end
function conky_Images_Jour_RoseR(p, s, f, j, o)
j = tonumber(j)
if init_rose_raf[j].Jour == nil then
Rose(conditionJour[j].VentDir, conditionJour[j].VentP, conditionJour[j].VentRafales, "RoseJourR"..j, s, o)
init_rose_raf[j].Jour = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseJourR"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseJourR"..j..".png"
end
end
--Prévision sur la nuit
function conky_Images_Nuit_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].Nuit == nil then
Rose(conditionNuit[j].VentDir, conditionNuit[j].VentP, conditionNuit[j].VentForce, "RoseNuit"..j, s, o)
init_rose[j].Nuit = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseNuit"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseNuit"..j..".png"
end
end
function conky_Images_Nuit_RoseR(p, s, f, j, o)
j = tonumber(j)
if init_rose_raf[j].Nuit == nil then
Rose(conditionNuit[j].VentDir, conditionNuit[j].VentP, conditionNuit[j].VentRafales, "RoseNuitR"..j, s, o)
init_rose_raf[j].Nuit = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseNuitR"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseNuitR"..j..".png"
end
end
--Condition Matinée
function conky_Images_Matin_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].Matin == nil then
Rose(conditionMatin[j].VentDir, conditionMatin[j].VentP, conditionMatin[j].VentForce, "RoseMatin"..j, s, o)
init_rose[j].Matin = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseMatin"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseMatin"..j..".png"
end
end
--Condition Après midi
function conky_Images_AM_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].AM == nil then
Rose(conditionAM[j].VentDir, conditionAM[j].VentP, conditionAM[j].VentForce, "RoseAM"..j, s, o)
init_rose[j].AM = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseAM"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseAM"..j..".png"
end
end
--Condition soirée
function conky_Images_Soiree_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].Soiree == nil then
Rose(conditionSoiree[j].VentDir, conditionSoiree[j].VentP, conditionSoiree[j].VentForce, "RoseSoiree"..j, s, o)
init_rose[j].Soiree = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseSoiree"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseSoiree"..j..".png"
end
end
--Condition Nuit
function conky_Images_Noct_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].Noct == nil then
Rose(conditionNoct[j].VentDir, conditionNoct[j].VentP, conditionNoct[j].VentForce, "RoseNoct"..j, s, o)
init_rose[j].Noct = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RoseNoct"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RoseNoct"..j..".png"
end
end
--huitHeures
function conky_Images_huitHeures_Rose(p, s, f, j, o)
j = tonumber(j)
if init_rose[j].huitHeures == nil then
Rose(huitHeures[j].VentDir, huitHeures[j].VentP, huitHeures[j].VentForce, "RosehuitHeures"..j, s, o)
init_rose[j].huitHeures = 1
end
if Mode ~= "fondecran" then
return "${image "..Rep.."/RosehuitHeures"..j..".png -p "..p.." -s "..s.." -f "..f.."}"
else
return Rep.."/RosehuitHeures"..j..".png"
end
end
--Récupération de données
function conky_Images_MAJ(cfg)
local s = '${lua Meteo_etat_MAJ}'
local MAJ = conky_parse( s )
if maj1 == nil then
init(cfg)
maj1 = "ok"
MAJHold = MAJ+1
end
if MAJ ~= MAJHold then
MAJHold = MAJ
--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", "latitude", "longitude"}
for i = 1,22 do
conditioncourante[t[i]] = donee[i]
end
time = donee[23]
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
if huit == "oui" then
for j = 1,8 do
local file = assert(io.open(repsauv.."/huitHeures"..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 = {"Heure", "Icone", "TempMax", "TempMaxR", "VentDir", "VentForce", "Humidite", "CouvNuage", "PointRosee", "UV", "Pluie", "Neige", "Verglas", "VentP", "VentIcone"}
huitHeures[j] = {}
local info3 = {}
for i = 1, 15 do
info3[t[i]] = donee[i]
end
huitHeures[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 Barometre.taille ~= nil then Baro() end
if lunaison.taille ~= nil then lune() end
fonc_init_rose()
local i = 0
while i ~= Nb_Thermo do
i = i+1
CreaThermometre(i)
end
i = 0
while i ~= Nb_ThermRond do
i = i+1
CreaThermometreRond(i)
end
if Mode == "fondecran" then
FondEcran_init()
end
if Mode == "fondinactif" then
FondInactif_init()
end
collectgarbage()
end
return ""
end
--initialisation paramètres
function init(cfg)
local home = os.getenv("HOME")
cfg = string.gsub(cfg, "~", home)
cfg = string.gsub(cfg, "$HOME", home)
imagecfg = cfg
Nb_Thermo = 0
Nb_ThermRond = 0
local Thermo = false
local ThermRond = false
local file = assert(io.open(cfg, "rb") )
local line = file:read()
for line in file:lines() do
local pos1 = string.find(line, '#')
if pos1 ~= nil then
line = string.sub(line, 1, pos1-1)
end
pos1 = string.find(line, '=')
if string.find(line, 'Therm=') ~= nil then
Rep_Therm = string.sub(line, pos1+1)
elseif string.find(line, 'repfonts=') ~= nil then
repfonts = string.sub(line, pos1+1)
elseif string.find(line, 'ThermRond=') ~= nil then
Rep_ThermRond = string.sub(line, pos1+1)
elseif string.find(line, 'Rose=') ~= nil then
Rep_Rose = string.sub(line, pos1+1)
elseif string.find(line, 'palier1=') ~= nil then
palier1 = string.sub(line, pos1+1)
elseif string.find(line, 'palier2=') ~= nil then
palier2 = string.sub(line, pos1+1)
elseif string.find(line, 'palier3=') ~= nil then
palier3 = string.sub(line, pos1+1)
elseif string.find(line, 'palier4=') ~= nil then
palier4 = string.sub(line, pos1+1)
elseif string.find(line, 'palier1coulfont=') ~= nil then
palier1coulfont = string.sub(line, pos1+1)
elseif string.find(line, 'palier2coulfont=') ~= nil then
palier2coulfont = string.sub(line, pos1+1)
elseif string.find(line, 'palier3coulfont=') ~= nil then
palier3coulfont = string.sub(line, pos1+1)
elseif string.find(line, 'palier4coulfont=') ~= nil then
palier4coulfont = string.sub(line, pos1+1)
elseif string.find(line, 'Lune=') ~= nil then
Rep_Lune = string.sub(line, pos1+1)
elseif string.find(line, 'Barometre=') ~= nil then
Rep_Barometre = string.sub(line, pos1+1)
elseif string.find(line, 'repmeteo=') ~= nil then
repmeteo = string.sub(line, pos1+1)
elseif string.find(line, 'IconesRep=') ~= nil then
IconesRep = string.sub(line, pos1+1)
elseif string.find(line, 'Mode=') ~= nil then
Mode = string.sub(line, pos1+1)
elseif string.find(line, 'MiseEnPage=') ~= nil then
mise_en_page = string.sub(line, pos1+1)
mise_en_page = string.gsub(mise_en_page, "~", home)
mise_en_page = string.gsub(mise_en_page, "$HOME", home)
pos = string.find(mise_en_page, "creationmodules")
fich_creationmodule = string.sub(mise_en_page, pos)..".sh"
end
--debut thermomètre mercure
if string.find(line, 'Thermometres=') ~= nil then
Thermo = true
Nb_Thermo = Nb_Thermo+1
Thermometre[tonumber(Nb_Thermo)] = {}
end
if Thermo ~= false then
if string.find(line, 'base=') ~= nil then
Thermometre[Nb_Thermo].base = string.sub(line, pos1+1)
elseif string.find(line, 'mercure=') ~= nil then
Thermometre[Nb_Thermo].mercure = string.sub(line, pos1+1)
elseif string.find(line, 'mercure_info=') ~= nil then
local pos2 = string.find(line, '}')
if pos2 ~= nil then
Thermometre[Nb_Thermo].mercure_info = string.sub(line, pos1+1, pos2-1)
else
Thermometre[Nb_Thermo].mercure_info = string.sub(line, pos1+1)
end
elseif string.find(line, 'plot=') ~= nil then
Thermometre[Nb_Thermo].plot = string.sub(line, pos1+1)
elseif string.find(line, 'plot_info=') ~= nil then
local pos2 = string.find(line, '}')
Thermometre[Nb_Thermo].plot_info = string.sub(line, pos1+1, pos2-1)
end
pos1 = string.find(line, '}')
if pos1 ~= nil then
line = string.sub(line, pos1)
if string.find(line, ',') == nil then
Thermo = false
else
Nb_Thermo = Nb_Thermo+1
Thermometre[Nb_Thermo] = {}
end
end
end
--fin thermomètre
end
io.close(file)
local fichier_init = conky_parse( "${lua Meteo_fichier_init}" )
meteocfg=fichier_init
local file = assert(io.open(fichier_init, "rb") )
local line = file:read()
for line in file:lines() do
local 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, 'Prev8heures=') ~= nil then
huit = string.sub(line, pos1+1)
elseif string.find(line, 'Therm=') ~= nil then
Rep_Therm = string.sub(line, pos1+1)
elseif string.find(line, 'Rose=') ~= nil then
Rep_Rose = 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 = string.gsub(r, "~", home)
r = string.gsub(r, "$HOME", home)
repsauv = string.gsub(repsauv, "~", home)
repsauv = string.gsub(repsauv, "$HOME", home)
--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
MAJHold = "10"
return ""
end
------------------------------------------------------------- Fond ecran --------------------------------------------------
function FondEcran_init()
if not existe(repsauv.."/fond-meteo.png") then
boucle = boucle+1
end
if boucle ~= 0 then
print("","Mode = "..Mode)
-- sauvegarde fond ecran
os.execute(repmeteo..'/scripts/fond-gestion.sh sauvegarde')
-- creation des modules externes
creation_module(mise_en_page)
-- Maj du fond d'écran
os.execute(repmeteo..'/scripts/fond-gestion.sh integration ')
end
boucle = boucle+1
end
function FondInactif_init()
print("","Mode = "..Mode)
-- creation des modules externes
creation_module(mise_en_page)
end
function conky_extinction()
-- remise en place fond ecran-ori
os.execute(repmeteo..'/scripts/fond-gestion.sh restauration')
end
function mise_en_forme(x)
local pos = string.find(x, "{{")
local Nb = 0
local info, pos1
while pos ~= nil do
Nb = Nb+1
if Nb == 1 then
code = string.sub(x, 0, pos-1)
else
code = code..string.sub(x, pos1+2, pos-1)
end
pos1 = string.find(x, "}}", pos+2)
info = string.sub(x, pos+2, pos1-1)
code = code..Recup_info(info)
pos = string.find(x, "{{", pos1+2)
end
if pos1 ~= nil then
code = code..string.sub(x, pos1+2)
else
code = x
end
return code
end
function creation_module(creationmodules)
------------copie et recuperation du fichier
local file = io.open(creationmodules)
local line = file:read()
local file1 = io.open(Rep.."/"..fich_creationmodule, "w+" )
------------- mise en place fichier + entête
file1:write ("#!/bin/bash \n\n##########################################\ncheminref="..repmeteo.."\nsource "..imagecfg.." 2>/dev/null\nsource "..meteocfg.." 2>/dev/null\n")
------------------------------------------------------------------------
for line in file:lines() do
---------------------------------------------------------
file1:write (mise_en_forme(line), "\n")
---------------------------------------------------------
end
------ fermeture et ecriture
io.close(file1)
io.close(file)
------ execution du fichier bash
os.execute('chmod +x '..Rep..'/'..fich_creationmodule..' && '..Rep..'/'..fich_creationmodule)
end
function Recup_info(x)
local info, pos1, pos
pos = string.find(x, " ")
if pos ~= nil then
info = string.sub(x, 0, pos-1)
pos1 = string.find(x, " ", pos+1)
else
info = x
end
if pos ~= nil then
if pos1 ~= nil then
arg1 = string.sub(x, pos+1, pos1-1)
pos = string.find(x, " ", pos1+1)
else
arg1 = string.sub(x, pos+1)
end
if pos1 ~= nil then
if pos ~= nil then
arg2 = string.sub(x, pos1+1, pos-1)
pos1 = string.find(x, " ", pos+1)
else
arg2 = string.sub(x, pos1+1)
end
if pos ~= nil then
if pos1 ~= nil then
arg3 = string.sub(x, pos+1, pos1-1)
pos = string.find(x, " ", pos1+1)
else
arg3 = string.sub(x, pos+1)
end
if pos1 ~= nil then
if pos ~= nil then
arg4 = string.sub(x, pos1+1, pos-1)
pos1 = string.find(x, " ", pos+1)
else
arg4 = string.sub(x, pos1+1)
end
if pos ~= nil then
if pos1 ~= nil then
arg5 = string.sub(x, pos+1, pos1-1)
pos = string.find(x, " ", pos1+1)
else
arg5 = string.sub(x, pos+1)
end
if pos1 ~= nil then
if pos ~= nil then
arg6 = string.sub(x, pos1+1, pos-1)
pos1 = string.find(x, " ", pos+1)
else
arg6 = string.sub(x, pos1+1)
end
if pos ~= nil then
if pos1 ~= nil then
arg7 = string.sub(x, pos+1, pos1-1)
pos = string.find(x, " ", pos1+1)
else
arg7 = string.sub(x, pos+1)
end
if pos1 ~= nil then
if pos ~= nil then
arg8 = string.sub(x, pos1+1, pos-1)
pos1 = string.find(x, " ", pos+1)
else
arg8 = string.sub(x, pos1+1)
end
if pos ~= nil then
if pos1 ~= nil then
arg9 = string.sub(x, pos+1, pos1-1)
pos = string.find(x, " ", pos1+1)
else
arg9 = string.sub(x, pos+1)
end
if pos1 ~= nil then
if pos ~= nil then
arg10 = string.sub(x, pos1+1, pos-1)
pos1 = string.find(x, " ", pos+1)
else
arg10 = string.sub(x, pos1+1)
end
if pos ~= nil then
if pos1 ~= nil then
arg11 = string.sub(x, pos+1, pos1-1)
pos = string.find(x, " ", pos1+1)
else
arg11 = string.sub(x, pos+1)
end
end
end
end
end
end
end
end
end
end
end
end
if info == "Meteo_TempRes" then
return conditioncourante.Tempr
elseif info == "Meteo_TempAct" then
return conditioncourante.Temp
elseif info == "Meteo_CondMeteo" then
return conditioncourante.Cond
elseif info == "Meteo_CondMeteo1" then
return conditioncourante.CondMeteo1
elseif info == "Meteo_CondMeteo2" then
return conditioncourante.CondMeteo2
elseif info == "Meteo_CondMeteo1se" then
return conditioncourante.CondMeteo1se
elseif info == "Meteo_CondMeteo2se" then
return conditioncourante.CondMeteo2se
elseif info == "Meteo_VentDir" then
return conditioncourante.VentDir
elseif info == "Meteo_VentDirP" then
return conditioncourante.VentPlein
elseif info == "Meteo_VentForce" then
return conditioncourante.VentForce
elseif info == "Meteo_Humidite" then
return conditioncourante.Humidite
elseif info == "Meteo_Rose" then
return conditioncourante.PointRosee
elseif info == "Meteo_Pression" then
return conditioncourante.Pression
elseif info == "Meteo_Visibilite" then
return conditioncourante.Visibilite
elseif info == "Meteo_CouvNuage" then
return conditioncourante.CouvNuage
elseif info == "Meteo_Uv" then
return conditioncourante.Uv
elseif info == "Meteo_IconeM" then
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 arg1.."/jour/"..conditioncourante.Icone..".png"
else
return arg1.."/nuit/"..conditioncourante.Icone..".png"
end
elseif info == "Meteo_IconeV" then
return arg1.."/"..conditioncourante.VentIcone
elseif info == "Meteo_Ville" then
return conditioncourante.Ville
elseif info == "Meteo_latitude" then
return conditioncourante.latitude
elseif info == "Meteo_longitude" then
return conditioncourante.longitude
elseif info == "Image_version" then
return Version
--prévision journée
elseif info == "Meteo_Jour_CondMeteo" then
return conditionJour[tonumber(arg1)].CondMeteo
elseif info == "Meteo_Jour_CondMeteo1" then
return conditionJour[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_Jour_CondMeteo2" then
return conditionJour[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_Jour_CondMeteo1se" then
return conditionJour[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_Jour_CondMeteo2se" then
return conditionJour[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_Jour_Temp" then
return conditionJour[tonumber(arg1)].Temp
elseif info == "Meteo_Jour_TempRes" then
return conditionJour[tonumber(arg1)].TempRes
elseif info == "Meteo_Jour_ProbPrec" then
return conditionJour[tonumber(arg1)].ProbPrec
elseif info == "Meteo_Jour_VentDir" then
return conditionJour[tonumber(arg1)].VentDir
elseif info == "Meteo_Jour_VentDirP" then
return conditionJour[tonumber(arg1)].VentP
elseif info == "Meteo_Jour_VentForce" then
return conditionJour[tonumber(arg1)].VentForce
elseif info == "Meteo_Jour_VentRafales" then
return conditionJour[tonumber(arg1)].VentRafales
elseif info == "Meteo_Jour_Uv" then
return conditionJour[tonumber(arg1)].Uv
elseif info == "Meteo_Jour_ProbOrage" then
return conditionJour[tonumber(arg1)].ProbOrage
elseif info == "Meteo_Jour_NivPrec" then
return conditionJour[tonumber(arg1)].NivPrec
elseif info == "Meteo_Jour_QPluie" then
return conditionJour[tonumber(arg1)].QPluie
elseif info == "Meteo_Jour_QNeige" then
return conditionJour[tonumber(arg1)].QNeige
elseif info == "Meteo_Jour_EVerglas" then
return conditionJour[tonumber(arg1)].EVerglas
elseif info == "Meteo_Jour_IconeM" then
return arg1.."/jour/"..conditionJour[tonumber(arg5)].Icone..".png"
elseif info == "Meteo_Jour_IconeV" then
return arg1.."/"..conditionJour[tonumber(arg5)].VentIcone
elseif info == "Meteo_Jour_IconeR" then
return arg1.."/"..conditionJour[tonumber(arg5)].RafalesIcone
--prévision Nuit
elseif info == "Meteo_Nuit_CondMeteo" then
return conditionNuit[tonumber(arg1)].CondMeteo
elseif info == "Meteo_Nuit_CondMeteo1" then
return conditionNuit[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_Nuit_CondMeteo2" then
return conditionNuit[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_Nuit_CondMeteo1se" then
return conditionNuit[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_Nuit_CondMeteo2se" then
return conditionNuit[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_Nuit_Temp" then
return conditionNuit[tonumber(arg1)].Temp
elseif info == "Meteo_Nuit_TempRes" then
return conditionNuit[tonumber(arg1)].TempRes
elseif info == "Meteo_Nuit_ProbPrec" then
return conditionNuit[tonumber(arg1)].ProbPrec
elseif info == "Meteo_Nuit_VentDir" then
return conditionNuit[tonumber(arg1)].VentDir
elseif info == "Meteo_Nuit_VentDirP" then
return conditionNuit[tonumber(arg1)].VentP
elseif info == "Meteo_Nuit_VentForce" then
return conditionNuit[tonumber(arg1)].VentForce
elseif info == "Meteo_Nuit_VentRafales" then
return conditionNuit[tonumber(arg1)].VentRafales
elseif info == "Meteo_Nuit_Uv" then
return conditionNuit[tonumber(arg1)].Uv
elseif info == "Meteo_Nuit_ProbOrage" then
return conditionNuit[tonumber(arg1)].ProbOrage
elseif info == "Meteo_Nuit_NivPrec" then
return conditionNuit[tonumber(arg1)].NivPrec
elseif info == "Meteo_Nuit_QPluie" then
return conditionNuit[tonumber(arg1)].QPluie
elseif info == "Meteo_Nuit_QNeige" then
return conditionNuit[tonumber(arg1)].QNeige
elseif info == "Meteo_Nuit_EVerglas" then
return conditionNuit[tonumber(arg1)].EVerglas
elseif info == "Meteo_Nuit_IconeM" then
return arg1.."/nuit/"..conditionNuit[tonumber(arg5)].Icone..".png"
elseif info == "Meteo_Nuit_IconeV" then
return arg1.."/"..conditionNuit[tonumber(arg5)].VentIcone
elseif info == "Meteo_Nuit_IconeR" then
return arg1.."/"..conditionNuit[tonumber(arg5)].RafalesIcone
----Prévision quart de journée
--Matin
elseif info == "Meteo_Matin_CondMeteo " then
return conditionMatin[tonumber(arg1)].CondMeteo
elseif info == "Meteo_Matin_CondMeteo1" then
return conditionMatin[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_Matin_CondMeteo2" then
return conditionMatin[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_Matin_CondMeteo1se" then
return conditionMatin[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_Matin_CondMeteo2se" then
return conditionMatin[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_Matin_TempMax" then
return conditionMatin[tonumber(arg1)].TempMax
elseif info == "Meteo_Matin_TempMin" then
return conditionMatin[tonumber(arg1)].TempMin
elseif info == "Meteo_Matin_TempMaxRes" then
return conditionMatin[tonumber(arg1)].TempMaxR
elseif info == "Meteo_Matin_TempMinRes" then
return conditionMatin[tonumber(arg1)].TempMinR
elseif info == "Meteo_Matin_ProbPrec" then
return conditionMatin[tonumber(arg1)].ProbPrec
elseif info == "Meteo_Matin_VentDir" then
return conditionMatin[tonumber(arg1)].VentDir
elseif info == "Meteo_Matin_VentP" then
return conditionMatin[tonumber(arg1)].VentP
elseif info == "Meteo_Matin_VentForce" then
return conditionMatin[tonumber(arg1)].VentForce
elseif info == "Meteo_Matin_QPluie" then
return conditionMatin[tonumber(arg1)].QPluie
elseif info == "Meteo_Matin_QNeige" then
return conditionMatin[tonumber(arg1)].QNeige
elseif info == "Meteo_Matin_Humidite" then
return conditionMatin[tonumber(arg1)].Humidite
elseif info == "Meteo_Matin_CouvNuage" then
return conditionMatin[tonumber(arg1)].CouvNuage
elseif info == "Meteo_Matin_Rose" then
return conditionMatin[tonumber(arg1)].PointRosee
elseif info == "Meteo_Matin_Visibilite" then
return conditionMatin[tonumber(arg1)].Visibilite
elseif info == "Meteo_Matin_IconeM" then
return arg1.."/jour/"..conditionMatin[tonumber(arg5)].Icone..".png"
elseif info == "Meteo_Matin_IconeV" then
return arg1.."/"..conditionMatin[tonumber(arg5)].VentIcone
--Après midi
elseif info == "Meteo_AM_CondMeteo " then
return conditionAM[tonumber(arg1)].CondMeteo
elseif info == "Meteo_AM_CondMeteo1" then
return conditionAM[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_AM_CondMeteo2" then
return conditionAM[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_AM_CondMeteo1se" then
return conditionAM[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_AM_CondMeteo2se" then
return conditionAM[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_AM_TempMax" then
return conditionAM[tonumber(arg1)].TempMax
elseif info == "Meteo_AM_TempMin" then
return conditionAM[tonumber(arg1)].TempMin
elseif info == "Meteo_AM_TempMaxRes" then
return conditionAM[tonumber(arg1)].TempMaxR
elseif info == "Meteo_AM_TempMinRes" then
return conditionAM[tonumber(arg1)].TempMinR
elseif info == "Meteo_AM_ProbPrec" then
return conditionAM[tonumber(arg1)].ProbPrec
elseif info == "Meteo_AM_VentDir" then
return conditionAM[tonumber(arg1)].VentDir
elseif info == "Meteo_AM_VentP" then
return conditionAM[tonumber(arg1)].VentP
elseif info == "Meteo_AM_VentForce" then
return conditionAM[tonumber(arg1)].VentForce
elseif info == "Meteo_AM_QPluie" then
return conditionAM[tonumber(arg1)].QPluie
elseif info == "Meteo_AM_QNeige" then
return conditionAM[tonumber(arg1)].QNeige
elseif info == "Meteo_AM_Humidite" then
return conditionAM[tonumber(arg1)].Humidite
elseif info == "Meteo_AM_CouvNuage" then
return conditionAM[tonumber(arg1)].CouvNuage
elseif info == "Meteo_AM_Rose" then
return conditionAM[tonumber(arg1)].PointRosee
elseif info == "Meteo_AM_Visibilite" then
return conditionAM[tonumber(arg1)].Visibilite
elseif info == "Meteo_AM_IconeM" then
return arg1.."/jour/"..conditionAM[tonumber(arg5)].Icone..".png"
elseif info == "Meteo_AM_IconeV" then
return arg1.."/"..conditionAM[tonumber(arg5)].VentIcone
--Soirée
elseif info == "Meteo_Soiree_CondMeteo " then
return conditionSoiree[tonumber(arg1)].CondMeteo
elseif info == "Meteo_Soiree_CondMeteo1" then
return conditionSoiree[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_Soiree_CondMeteo2" then
return conditionSoiree[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_Soiree_CondMeteo1se" then
return conditionSoiree[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_Soiree_CondMeteo2se" then
return conditionSoiree[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_Soiree_TempMax" then
return conditionSoiree[tonumber(arg1)].TempMax
elseif info == "Meteo_Soiree_TempMin" then
return conditionSoiree[tonumber(arg1)].TempMin
elseif info == "Meteo_Soiree_TempMaxRes" then
return conditionSoiree[tonumber(arg1)].TempMaxR
elseif info == "Meteo_Soiree_TempMinRes" then
return conditionSoiree[tonumber(arg1)].TempMinR
elseif info == "Meteo_Soiree_ProbPrec" then
return conditionSoiree[tonumber(arg1)].ProbPrec
elseif info == "Meteo_Soiree_VentDir" then
return conditionSoiree[tonumber(arg1)].VentDir
elseif info == "Meteo_Soiree_VentP" then
return conditionSoiree[tonumber(arg1)].VentP
elseif info == "Meteo_Soiree_VentForce" then
return conditionSoiree[tonumber(arg1)].VentForce
elseif info == "Meteo_Soiree_QPluie" then
return conditionSoiree[tonumber(arg1)].QPluie
elseif info == "Meteo_Soiree_QNeige" then
return conditionSoiree[tonumber(arg1)].QNeige
elseif info == "Meteo_Soiree_Humidite" then
return conditionSoiree[tonumber(arg1)].Humidite
elseif info == "Meteo_Soiree_CouvNuage" then
return conditionSoiree[tonumber(arg1)].CouvNuage
elseif info == "Meteo_Soiree_Rose" then
return conditionSoiree[tonumber(arg1)].PointRosee
elseif info == "Meteo_Soiree_Visibilite" then
return conditionSoiree[tonumber(arg1)].Visibilite
elseif info == "Meteo_Soiree_IconeM" then
return arg1.."/nuit/"..conditionSoiree[tonumber(arg5)].Icone..".png"
elseif info == "Meteo_Soiree_IconeV" then
return arg1.."/"..conditionSoiree[tonumber(arg5)].VentIcone
--nuit
elseif info == "Meteo_Noct_CondMeteo " then
return conditionNoct[tonumber(arg1)].CondMeteo
elseif info == "Meteo_Noct_CondMeteo1" then
return conditionNoct[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_Noct_CondMeteo2" then
return conditionNoct[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_Noct_CondMeteo1se" then
return conditionNoct[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_Noct_CondMeteo2se" then
return conditionNoct[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_Noct_TempMax" then
return conditionNoct[tonumber(arg1)].TempMax
elseif info == "Meteo_Noct_TempMin" then
return conditionNoct[tonumber(arg1)].TempMin
elseif info == "Meteo_Noct_TempMaxRes" then
return conditionNoct[tonumber(arg1)].TempMaxR
elseif info == "Meteo_Noct_TempMinRes" then
return conditionNoct[tonumber(arg1)].TempMinR
elseif info == "Meteo_Noct_ProbPrec" then
return conditionNoct[tonumber(arg1)].ProbPrec
elseif info == "Meteo_Noct_VentDir" then
return conditionNoct[tonumber(arg1)].VentDir
elseif info == "Meteo_Noct_VentP" then
return conditionNoct[tonumber(arg1)].VentP
elseif info == "Meteo_Noct_VentForce" then
return conditionNoct[tonumber(arg1)].VentForce
elseif info == "Meteo_Noct_QPluie" then
return conditionNoct[tonumber(arg1)].QPluie
elseif info == "Meteo_Noct_QNeige" then
return conditionNoct[tonumber(arg1)].QNeige
elseif info == "Meteo_Noct_Humidite" then
return conditionNoct[tonumber(arg1)].Humidite
elseif info == "Meteo_Noct_CouvNuage" then
return conditionNoct[tonumber(arg1)].CouvNuage
elseif info == "Meteo_Noct_Rose" then
return conditionNoct[tonumber(arg1)].PointRosee
elseif info == "Meteo_Noct_Visibilite" then
return conditionNoct[tonumber(arg1)].Visibilite
elseif info == "Meteo_Noct_IconeM" then
return arg1.."/nuit/"..conditionNoct[tonumber(arg5)].Icone..".png"
elseif info == "Meteo_Noct_IconeV" then
return arg1.."/"..conditionNoct[tonumber(arg5)].VentIcone
--huitHeures
elseif info == "Meteo_huitHeures_CondMeteo " then
return huitHeures[tonumber(arg1)].CondMeteo
elseif info == "Meteo_huitHeures_CondMeteo1" then
return huitHeures[tonumber(arg1)].CondMeteo1
elseif info == "Meteo_huitHeures_CondMeteo2" then
return huitHeures[tonumber(arg1)].CondMeteo2
elseif info == "Meteo_huitHeures_CondMeteo1se" then
return huitHeures[tonumber(arg1)].CondMeteo1se
elseif info == "Meteo_huitHeures_CondMeteo2se" then
return huitHeures[tonumber(arg1)].CondMeteo2se
elseif info == "Meteo_huitHeures_TempMax" then
return huitHeures[tonumber(arg1)].TempMax
elseif info == "Meteo_huitHeures_TempMin" then
return huitHeures[tonumber(arg1)].TempMin
elseif info == "Meteo_huitHeures_TempMaxRes" then
return huitHeures[tonumber(arg1)].TempMaxR
elseif info == "Meteo_huitHeures_TempMinRes" then
return huitHeures[tonumber(arg1)].TempMinR
elseif info == "Meteo_huitHeures_ProbPrec" then
return huitHeures[tonumber(arg1)].ProbPrec
elseif info == "Meteo_huitHeures_VentDir" then
return huitHeures[tonumber(arg1)].VentDir
elseif info == "Meteo_huitHeures_VentP" then
return huitHeures[tonumber(arg1)].VentP
elseif info == "Meteo_huitHeures_VentForce" then
return huitHeures[tonumber(arg1)].VentForce
elseif info == "Meteo_huitHeures_QPluie" then
return huitHeures[tonumber(arg1)].QPluie
elseif info == "Meteo_huitHeures_QNeige" then
return huitHeures[tonumber(arg1)].QNeige
elseif info == "Meteo_huitHeures_Humidite" then
return huitHeures[tonumber(arg1)].Humidite
elseif info == "Meteo_huitHeures_CouvNuage" then
return huitHeures[tonumber(arg1)].CouvNuage
elseif info == "Meteo_huitHeures_Rose" then
return huitHeures[tonumber(arg1)].PointRosee
elseif info == "Meteo_huitHeures_Visibilite" then
return huitHeures[tonumber(arg1)].Visibilite
elseif info == "Meteo_huitHeures_IconeV" then
return arg1.."/"..huitHeures[tonumber(arg5)].VentIcone
elseif info == "Meteo_huitHeures_IconeM" then
if huitHeures[tonumber(arg5)].Heure <= InfoJour[1].CoucherSoleilH and huitHeures[tonumber(arg5)].Heure >= InfoJour[1].LeverSoleilH then
return arg1.."/jour/"..huitHeures[tonumber(arg5)].Icone..".png"
else
return arg1.."/nuit/"..huitHeures[tonumber(arg5)].Icone..".png"
end
--lunaison
elseif info == "Lune_ephemerides" then
return ephemerides
elseif info == "Lune_ephemerides1" then
return ephemerides1
elseif info == "Lune_ephemerides2" then
return ephemerides2
elseif info == "Lune_Visibilite" then
return Visibilite
elseif info == "Lune_Phases" then
return Phases
elseif info == "Lune_Phases1" then
return Phases1
elseif info == "Lune_Phases2" then
return Phases2
elseif info == "Lune_Noeudlunaire" then
return Noeud_lunaire
elseif info == "Lune_Apogee" then
return Apogee
elseif info == "Lune_Perigee" then
return Perigee
elseif info == "Lune_Distance" then
return Distance
elseif info == "Lune_Age" then
return Age
elseif info == "Lune_HLeverLune" then
return Lever_LuneHeure
elseif info == "Lune_MLeverLune" then
return Lever_LuneMinute
elseif info == "Lune_HCoucherLune" then
return Coucher_LuneHeure
elseif info == "Lune_MCoucherLune" then
return Coucher_LuneMinute
elseif info == "Lune_EclipsePartielle" then
return Eclipse_partielle
elseif info == "Lune_EclipseTotal" then
return Eclipse_total
elseif info == "Images_Barometre" then
return conky_Images_Barometre(arg1, arg2, arg3, arg4)
elseif info == "Images_Lunaison" then
return conky_Images_Lunaison(arg1, arg2, arg3, arg4)
elseif info == "Images_Thermo" then
return conky_Images_Thermo(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_ThermoRond" then
return conky_Images_ThermoRond(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11)
elseif info == "Images_Rose" then
return conky_Images_Rose(arg1, arg2, arg3, arg4)
elseif info == "Images_Jour_Rose" then
return conky_Images_Jour_Rose(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_Jour_RoseR" then
return conky_Images_Jour_RoseR(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_Nuit_Rose" then
return conky_Images_Nuit_Rose(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_Nuit_RoseR" then
return conky_Images_Nuit_RoseR(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_Matin_Rose" then
return conky_Images_Matin_Rose(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_AM_Rose" then
return conky_Images_AM_Rose(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_Soiree_Rose" then
return conky_Images_Soiree_Rose(arg1, arg2, arg3, arg4, arg5)
elseif info == "Images_Noct_Rose" then
return conky_Images_Noct_Rose(arg1, arg2, arg3, arg4, arg5)
else
return conky_parse( "${lua "..x.."}" )
end
end
ca c'est fait je vais pouvoir m'attaquer a l'esthétique