@ jpdipsy,
voici le script modifié
je mettrai le pack a jours ce soir
version 1.4 beta
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 = "v1.4 beta"
local conditionJour = {}
local conditionNuit = {}
local conditionMatin = {}
local conditionAM = {}
local conditionSoiree = {}
local conditionNoct = {}
local InfoJour = {}
local conditioncourante = {}
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
-- 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 = palier3coulfont
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')
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')
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
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')
end
function CreaThermometreRond(TherNb)
local val
os.execute(' cp '..Rep_ThermRond..'/base.png '..Rep..'/Thermorond'..TherNb..'.png')
-- humiditée cond courante ---------
-- os.execute(' convert '..Rep..'/Thermorond'..TherNb..'.png -font '..repfonts..'/AlteHaasGroteskBold.ttf -fill blue -pointsize 40 -gravity center -annotate +0+110 "Humiditée : '..conditioncourante.Humidite..'%" '..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].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')
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')
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')
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}
init_rose_raf[j]= {CondCour=nil, Jour=nil, Nuit=nil, Matin=nil, AM=nil, Soiree=nil, Noct=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)
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)
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)
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)
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
--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
conditioncourante.Icone = donee[1]
conditioncourante.Tempr = donee[2]
conditioncourante.Temp = donee[3]
conditioncourante.Cond = donee[4]
conditioncourante.CondMeteo1 = donee[5]
conditioncourante.CondMeteo2 = donee[6]
conditioncourante.CondMeteo1se = donee[7]
conditioncourante.CondMeteo2se = donee[8]
conditioncourante.VentDir = donee[9]
conditioncourante.VentPlein = donee[10]
conditioncourante.VentForce = donee[11]
conditioncourante.VentIcone = donee[12]
conditioncourante.Humidite = donee[13]
conditioncourante.PointRosee = donee[14]
conditioncourante.Pression = donee[15]
conditioncourante.Visibilite = donee[16]
conditioncourante.Date = donee[17]
conditioncourante.Ville = donee[18]
conditioncourante.CouvNuage = donee[19]
conditioncourante.Uv = donee[20]
conditioncourante.QPrec = donee[21]
conditioncourante.latitude = donee[22]
conditioncourante.longitude = donee[23]
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
conditionJour[j] = {}
conditionJour[j].CondMeteo = donee[1]
conditionJour[j].CondMeteo1 = donee[2]
conditionJour[j].CondMeteo2 = donee[3]
conditionJour[j].CondMeteo1se = donee[4]
conditionJour[j].CondMeteo2se = donee[5]
conditionJour[j].Temp = donee[6]
conditionJour[j].TempRes = donee[7]
conditionJour[j].ProbPrec = donee[8]
conditionJour[j].VentDir = donee[9]
conditionJour[j].VentP = donee[10]
conditionJour[j].VentForce = donee[11]
conditionJour[j].VentRafales = donee[12]
conditionJour[j].Uv = donee[13]
conditionJour[j].ProbOrage = donee[14]
conditionJour[j].NivPrec = donee[15]
conditionJour[j].QPluie = donee[16]
conditionJour[j].QNeige = donee[17]
conditionJour[j].Icone = donee[18]
conditionJour[j].VentIcone = donee[19]
conditionJour[j].RafalesIcone = donee[43]
conditionJour[j].EVerglas = donee[45]
conditionNuit[j] = {}
conditionNuit[j].CondMeteo = donee[20]
conditionNuit[j].CondMeteo1 = donee[21]
conditionNuit[j].CondMeteo2 = donee[22]
conditionNuit[j].CondMeteo1se = donee[23]
conditionNuit[j].CondMeteo2se = donee[24]
conditionNuit[j].Temp = donee[25]
conditionNuit[j].TempRes = donee[26]
conditionNuit[j].ProbPrec = donee[27]
conditionNuit[j].VentDir = donee[28]
conditionNuit[j].VentP = donee[29]
conditionNuit[j].VentForce = donee[30]
conditionNuit[j].VentRafales = donee[31]
conditionNuit[j].ProbOrage = donee[32]
conditionNuit[j].NivPrec = donee[33]
conditionNuit[j].QPluie = donee[34]
conditionNuit[j].QNeige = donee[35]
conditionNuit[j].Icone = donee[36]
conditionNuit[j].VentIcone = donee[37]
conditionNuit[j].RafalesIcone = donee[44]
conditionNuit[j].EVerglas = donee[46]
InfoJour[j] = {}
InfoJour[j].Jour = donee[38]
InfoJour[j].LeverSoleilH = donee[39]
InfoJour[j].LeverSoleilM = donee[40]
InfoJour[j].CoucherSoleilH = donee[41]
InfoJour[j].CoucherSoleilM = donee[42]
InfoJour[j].Histo_Max = donee[47]
InfoJour[j].Histo_Min = donee[48]
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
conditionMatin[j] = {}
conditionMatin[j].CondMeteo = donee[1]
conditionMatin[j].CondMeteo1 = donee[2]
conditionMatin[j].CondMeteo2 = donee[3]
conditionMatin[j].CondMeteo1se = donee[4]
conditionMatin[j].CondMeteo2se = donee[5]
conditionMatin[j].TempMax = donee[6]
conditionMatin[j].TempMin = donee[7]
conditionMatin[j].TempMaxR = donee[8]
conditionMatin[j].TempMinR = donee[9]
conditionMatin[j].ProbPrec = donee[10]
conditionMatin[j].VentDir = donee[11]
conditionMatin[j].VentP = donee[12]
conditionMatin[j].VentForce = donee[13]
conditionMatin[j].QPluie = donee[14]
conditionMatin[j].QNeige = donee[15]
conditionMatin[j].Humidite = donee[16]
conditionMatin[j].CouvNuage = donee[17]
conditionMatin[j].PointRosee = donee[18]
conditionMatin[j].Visibilite = donee[19]
conditionMatin[j].Icone = donee[20]
conditionMatin[j].VentIcone = donee[21]
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
conditionAM[j] = {}
conditionAM[j].CondMeteo = donee[1]
conditionAM[j].CondMeteo1 = donee[2]
conditionAM[j].CondMeteo2 = donee[3]
conditionAM[j].CondMeteo1se = donee[4]
conditionAM[j].CondMeteo2se = donee[5]
conditionAM[j].TempMax = donee[6]
conditionAM[j].TempMin = donee[7]
conditionAM[j].TempMaxR = donee[8]
conditionAM[j].TempMinR = donee[9]
conditionAM[j].ProbPrec = donee[10]
conditionAM[j].VentDir = donee[11]
conditionAM[j].VentP = donee[12]
conditionAM[j].VentForce = donee[13]
conditionAM[j].QPluie = donee[14]
conditionAM[j].QNeige = donee[15]
conditionAM[j].Humidite = donee[16]
conditionAM[j].CouvNuage = donee[17]
conditionAM[j].PointRosee = donee[18]
conditionAM[j].Visibilite = donee[19]
conditionAM[j].Icone = donee[20]
conditionAM[j].VentIcone = donee[21]
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
conditionSoiree[j] = {}
conditionSoiree[j].CondMeteo = donee[1]
conditionSoiree[j].CondMeteo1 = donee[2]
conditionSoiree[j].CondMeteo2 = donee[3]
conditionSoiree[j].CondMeteo1se = donee[4]
conditionSoiree[j].CondMeteo2se = donee[5]
conditionSoiree[j].TempMax = donee[6]
conditionSoiree[j].TempMin = donee[7]
conditionSoiree[j].TempMaxR = donee[8]
conditionSoiree[j].TempMinR = donee[9]
conditionSoiree[j].ProbPrec = donee[10]
conditionSoiree[j].VentDir = donee[11]
conditionSoiree[j].VentP = donee[12]
conditionSoiree[j].VentForce = donee[13]
conditionSoiree[j].QPluie = donee[14]
conditionSoiree[j].QNeige = donee[15]
conditionSoiree[j].Humidite = donee[16]
conditionSoiree[j].CouvNuage = donee[17]
conditionSoiree[j].PointRosee = donee[18]
conditionSoiree[j].Visibilite = donee[19]
conditionSoiree[j].Icone = donee[20]
conditionSoiree[j].VentIcone = donee[21]
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
conditionNoct[j] = {}
conditionNoct[j].CondMeteo = donee[1]
conditionNoct[j].CondMeteo1 = donee[2]
conditionNoct[j].CondMeteo2 = donee[3]
conditionNoct[j].CondMeteo1se = donee[4]
conditionNoct[j].CondMeteo2se = donee[5]
conditionNoct[j].TempMax = donee[6]
conditionNoct[j].TempMin = donee[7]
conditionNoct[j].TempMaxR = donee[8]
conditionNoct[j].TempMinR = donee[9]
conditionNoct[j].ProbPrec = donee[10]
conditionNoct[j].VentDir = donee[11]
conditionNoct[j].VentP = donee[12]
conditionNoct[j].VentForce = donee[13]
conditionNoct[j].QPluie = donee[14]
conditionNoct[j].QNeige = donee[15]
conditionNoct[j].Humidite = donee[16]
conditionNoct[j].CouvNuage = donee[17]
conditionNoct[j].PointRosee = donee[18]
conditionNoct[j].Visibilite = donee[19]
conditionNoct[j].Icone = donee[20]
conditionNoct[j].VentIcone = donee[21]
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
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)
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)
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}" )
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, '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)
repsauv = 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
MAJHold = "10"
return ""
end
------------------------------------------------------------- Fond ecran --------------------------------------------------
function FondEcran_init()
print("Mode = "..Mode)
--[[FondEcran_recupcond()
FondEcran_recupprev()
FondEcran_recupmatin()
FondEcran_recupam()
FondEcran_recupsoiree()
FondEcran_recupnuit()]]--
--- Mise en forme modules
FondEcran_lune()
FondEcran_baro()
FondEcran_ThermRond()
FondEcran_Jour_RoseR()
--os.execute('echo "'..os.date("%Hh%M", time)..'">'..repsauv..'donnee/condactuel/Heure-Maj.txt')
creation_module(mise_en_page)
-- Maj du fond d'écran
os.execute('echo "'..os.date("%Hh%M", time)..'">'..repsauv..'donnee/condactuel/Heure-Maj.txt && '..repmeteo..'/scripts/mise_en_forme.sh')
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 = "${lua "..string.sub(x, pos+2, pos1-1).."}"
code = code..conky_parse( 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(repsauv.."creationmodules.sh", "w+" )
------------- mise en place fichier + entête
file1:write ("#!/bin/bash \n\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 '..repsauv..'creationmodules.sh && '..repsauv..'creationmodules.sh' )
end
---- Constuction modules
function FondEcran_baro()
conky_Images_Barometre("0,0", "650x650", "60", "100")
end
function FondEcran_lune()
conky_Images_Lunaison("0,0", "650x650", "60", "100")
end
function FondEcran_ThermRond()
conky_Images_ThermoRond("2,260", "650x650", "60", "1", "100", "-a=Jour_Temp-1", "-b=Nuit_Temp-1")
end
function FondEcran_Jour_RoseR()
conky_Images_Jour_RoseR("0,0", "650x650", "60", "1", "100")
end
-----------------------------------
--- recuperation des données
function FondEcran_recupcond()
if Mode == "fondecran" then
if os.execute("cd "..repsauv.."donnee") ~= 0 then
os.execute("mkdir "..repsauv.."donnee && mkdir "..repsauv.."donnee/condactuel" )
end
os.execute('echo "'..conditioncourante.Icone..'.png">'..repsauv..'donnee/condactuel/Ico-Condition.txt \
echo "'..conditioncourante.Icone..'">'..repsauv..'donnee/condactuel/Ico-condition.txt \
echo "'..conditioncourante.Tempr..'">'..repsauv..'donnee/condactuel/Tempr.txt \
echo "'..conditioncourante.Temp..'">'..repsauv..'donnee/condactuel/Temp.txt \
echo "'..conditioncourante.Cond..'">'..repsauv..'donnee/condactuel/Condition.txt \
echo "'..conditioncourante.CondMeteo1..'">'..repsauv..'donnee/condactuel/CondMeteo1.txt \
echo "'..conditioncourante.CondMeteo2..'">'..repsauv..'donnee/condactuel/CondMeteo2.txt \
echo "'..conditioncourante.CondMeteo1se..'">'..repsauv..'donnee/condactuel/CondMeteo1se.txt \
echo "'..conditioncourante.CondMeteo2se..'">'..repsauv..'donnee/condactuel/CondMeteo2se.txt \
echo "'..conditioncourante.VentDir..'">'..repsauv..'donnee/condactuel/VentDir.txt \
echo "'..conditioncourante.VentPlein..'">'..repsauv..'donnee/condactuel/VenPlein.txt \
echo "'..conditioncourante.VentForce..'">'..repsauv..'donnee/condactuel/VenForce.txt \
echo "'..conditioncourante.VentIcone..'">'..repsauv..'donnee/condactuel/Ico-Vent.txt \
echo "'..conditioncourante.Humidite..'">'..repsauv..'donnee/condactuel/Humidite.txt \
echo "'..conditioncourante.PointRosee..'">'..repsauv..'donnee/condactuel/PointRosee.txt \
echo "'..conditioncourante.Pression..'">'..repsauv..'donnee/condactuel/Pression.txt \
echo "'..conditioncourante.Visibilite..'">'..repsauv..'donnee/condactuel/Visibilite.txt \
echo "'..conditioncourante.Date..'">'..repsauv..'donnee/condactuel/Date.txt \
echo "'..conditioncourante.Ville..'">'..repsauv..'donnee/condactuel/Ville.txt \
echo "'..conditioncourante.CouvNuage..'">'..repsauv..'donnee/condactuel/CouvNuage.txt \
echo "'..conditioncourante.Uv..'">'..repsauv..'donnee/condactuel/Uv.txt \
echo "'..conditioncourante.QPrec..'">'..repsauv..'donnee/condactuel/QPrec.txt \
echo "'..conditioncourante.latitude..'">'..repsauv..'donnee/condactuel/latitude.txt \
echo "'..conditioncourante.longitude..'">'..repsauv..'donnee/condactuel/longitude.txt \
echo "'..time..'">'..repsauv..'donnee/condactuel/time.txt')
end
end
function FondEcran_recupprev()
for j = 1,jours do
--os.execute('echo "'..conditionNuit[j].RafalesIcone..'">'..repsauv..'donnee/jour-'..j..'/Nuit-Ico-Rafales.txt'
if Mode == "fondecran" then
if os.execute("cd "..repsauv.."donnee/jour-"..j) ~= 0 then
os.execute("mkdir "..repsauv.."donnee/jour-"..j)
end
if os.execute("cd "..repsauv.."donnee/jour-"..j.."/Nuit") ~= 0 then
os.execute("mkdir "..repsauv.."donnee/jour-"..j.."/Nuit")
end
local HDureeJour = os.date("%H", ((((InfoJour[tonumber(j)].CoucherSoleilH*3600)-3600)+(InfoJour[tonumber(j)].CoucherSoleilM*60))-(((InfoJour[tonumber(j)].LeverSoleilH*3600))+(InfoJour[tonumber(j)].LeverSoleilM*60))))
local MDureeJour= os.date("%M", ((((InfoJour[tonumber(j)].CoucherSoleilH*3600)-3600)+(InfoJour[tonumber(j)].CoucherSoleilM*60))-(((InfoJour[tonumber(j)].LeverSoleilH*3600))+(InfoJour[tonumber(j)].LeverSoleilM*60))))
os.execute('echo "'..HDureeJour..'">'..repsauv..'donnee/jour-'..j..'/HDureeJour.txt && echo "'..MDureeJour..'">'..repsauv..'donnee/jour-'..j..'/MDureeJour.txt')
os.execute('echo "'..conditionJour[j].CondMeteo..'">'..repsauv..'donnee/jour-'..j..'/CondMeteo.txt \
echo "'..conditionJour[j].CondMeteo1..'">'..repsauv..'donnee/jour-'..j..'/CondMeteo1.txt \
echo "'..conditionJour[j].CondMeteo2..'">'..repsauv..'donnee/jour-'..j..'/CondMeteo2.txt \
echo "'..conditionJour[j].Temp..'">'..repsauv..'donnee/jour-'..j..'/Temp.txt \
echo "'..conditionJour[j].TempRes..'">'..repsauv..'donnee/jour-'..j..'/TempRes.txt \
echo "'..conditionJour[j].ProbPrec..'">'..repsauv..'donnee/jour-'..j..'/ProbPrec.txt \
echo "'..conditionJour[j].VentDir..'">'..repsauv..'donnee/jour-'..j..'/VentDir.txt \
echo "'..conditionJour[j].VentP..'">'..repsauv..'donnee/jour-'..j..'/VentP.txt \
echo "'..conditionJour[j].VentForce..'">'..repsauv..'donnee/jour-'..j..'/VentForce.txt \
echo "'..conditionJour[j].VentRafales..'">'..repsauv..'donnee/jour-'..j..'/VentRafales.txt \
echo "'..conditionJour[j].Uv..'">'..repsauv..'donnee/jour-'..j..'/Uv.txt \
echo "'..conditionJour[j].ProbOrage..'">'..repsauv..'donnee/jour-'..j..'/ProbOrage.txt \
echo "'..conditionJour[j].NivPrec..'">'..repsauv..'donnee/jour-'..j..'/NivPrec.txt \
echo "'..conditionJour[j].QPluie..'">'..repsauv..'donnee/jour-'..j..'/QPluie.txt \
echo "'..conditionJour[j].QNeige..'">'..repsauv..'donnee/jour-'..j..'/QNeige.txt \
echo "'..conditionJour[j].Icone..'.png">'..repsauv..'donnee/jour-'..j..'/Ico-condition.txt \
echo "'..conditionJour[j].VentIcone..'">'..repsauv..'donnee/jour-'..j..'/Ico-Vent.txt \
echo "'..conditionJour[j].RafalesIcone..'">'..repsauv..'donnee/jour-'..j..'/Ico-Rafales.txt \
echo "'..conditionJour[j].EVerglas..'">'..repsauv..'donnee/jour-'..j..'/EVerglas.txt \
echo "'..conditionNuit[j].CondMeteo..'">'..repsauv..'donnee/jour-'..j..'/Nuit/CondMeteo.txt \
echo "'..conditionNuit[j].CondMeteo1..'">'..repsauv..'donnee/jour-'..j..'/Nuit/CondMeteo1.txt \
echo "'..conditionNuit[j].CondMeteo2..'">'..repsauv..'donnee/jour-'..j..'/Nuit/CondMeteo2.txt \
echo "'..conditionNuit[j].Temp..'">'..repsauv..'donnee/jour-'..j..'/Nuit/Temp.txt \
echo "'..conditionNuit[j].TempRes..'">'..repsauv..'donnee/jour-'..j..'/Nuit/TempRes.txt \
echo "'..conditionNuit[j].ProbPrec..'">'..repsauv..'donnee/jour-'..j..'/Nuit/ProbPrec.txt \
echo "'..conditionNuit[j].VentDir..'">'..repsauv..'donnee/jour-'..j..'/Nuit/VentDir.txt \
echo "'..conditionNuit[j].VentP..'">'..repsauv..'donnee/jour-'..j..'/Nuit/VentP.txt \
echo "'..conditionNuit[j].VentForce..'">'..repsauv..'donnee/jour-'..j..'/Nuit/VentForce.txt \
echo "'..conditionNuit[j].VentRafales..'">'..repsauv..'donnee/jour-'..j..'/Nuit/VentRafales.txt \
echo "'..conditionNuit[j].ProbOrage..'">'..repsauv..'donnee/jour-'..j..'/Nuit/ProbOrage.txt \
echo "'..conditionNuit[j].QPluie..'">'..repsauv..'donnee/jour-'..j..'/Nuit/QPluie.txt \
echo "'..conditionNuit[j].Icone..'.png">'..repsauv..'donnee/jour-'..j..'/Nuit/Ico-condition.txt')
os.execute(' echo "'..conditionNuit[j].QNeige..'">'..repsauv..'donnee/jour-'..j..'/Nuit/QNeige.txt \
echo "'..conditionNuit[j].VentIcone..'">'..repsauv..'donnee/jour-'..j..'/Nuit/Ico-Vent.txt \
echo "'..conditionNuit[j].EVerglas..'">'..repsauv..'donnee/jour-'..j..'/Nuit/EVerglas.txt \
echo "'..conditionNuit[j].NivPrec..'">'..repsauv..'donnee/jour-'..j..'/Nuit/NivPrec.txt \
echo "'..InfoJour[j].Jour..'">'..repsauv..'donnee/jour-'..j..'/Jour.txt \
echo "'..InfoJour[j].LeverSoleilH..'">'..repsauv..'donnee/jour-'..j..'/LeverSoleilH.txt \
echo "'..InfoJour[j].LeverSoleilM..'">'..repsauv..'donnee/jour-'..j..'/LeverSoleilM.txt \
echo "'..InfoJour[j].CoucherSoleilH..'">'..repsauv..'donnee/jour-'..j..'/CoucherSoleilH.txt \
echo "'..InfoJour[j].CoucherSoleilM..'">'..repsauv..'donnee/jour-'..j..'/CoucherSoleilM.txt \
echo "'..InfoJour[j].Histo_Max..'">'..repsauv..'donnee/jour-'..j..'/Histo_Max.txt \
echo "'..InfoJour[j].Histo_Min..'">'..repsauv..'donnee/jour-'..j..'/Histo_Min.txt')
end
end
end
function FondEcran_recupmatin()
for j = 1,jours do
if matin == "oui" then
if Mode == "fondecran" then
if os.execute("cd "..repsauv.."donnee/jour-"..j.."/Matin") ~= 0 then
os.execute("mkdir "..repsauv.."donnee/jour-"..j.."/Matin")
end
os.execute('echo "'..conditionMatin[j].CondMeteo..'">'..repsauv..'donnee/jour-'..j..'/Matin/CondMeteo.txt \
echo "'..conditionMatin[j].CondMeteo1..'">'..repsauv..'donnee/jour-'..j..'/Matin/CondMeteo1.txt \
echo "'..conditionMatin[j].CondMeteo2..'">'..repsauv..'donnee/jour-'..j..'/Matin/CondMeteo2.txt \
echo "'..conditionMatin[j].TempMax..'">'..repsauv..'donnee/jour-'..j..'/Matin/TempMax.txt \
echo "'..conditionMatin[j].TempMin..'">'..repsauv..'donnee/jour-'..j..'/Matin/TempMin.txt \
echo "'..conditionMatin[j].TempMaxR..'">'..repsauv..'donnee/jour-'..j..'/Matin/TempMaxR.txt \
echo "'..conditionMatin[j].TempMinR..'">'..repsauv..'donnee/jour-'..j..'/Matin/TempMinR.txt \
echo "'..conditionMatin[j].ProbPrec..'">'..repsauv..'donnee/jour-'..j..'/Matin/ProbPrec.txt \
echo "'..conditionMatin[j].VentDir..'">'..repsauv..'donnee/jour-'..j..'/Matin/VentDir.txt \
echo "'..conditionMatin[j].VentP..'">'..repsauv..'donnee/jour-'..j..'/Matin/VentP.txt \
echo "'..conditionMatin[j].VentForce..'">'..repsauv..'donnee/jour-'..j..'/Matin/VentForce.txt \
echo "'..conditionMatin[j].QPluie..'">'..repsauv..'donnee/jour-'..j..'/Matin/QPluie.txt \
echo "'..conditionMatin[j].QNeige..'">'..repsauv..'donnee/jour-'..j..'/Matin/QNeige.txt \
echo "'..conditionMatin[j].Humidite..'">'..repsauv..'donnee/jour-'..j..'/Matin/Humidite.txt \
echo "'..conditionMatin[j].CouvNuage..'">'..repsauv..'donnee/jour-'..j..'/Matin/CouvNuage.txt \
echo "'..conditionMatin[j].PointRosee..'">'..repsauv..'donnee/jour-'..j..'/Matin/PointRosee.txt \
echo "'..conditionMatin[j].Visibilite..'">'..repsauv..'donnee/jour-'..j..'/Matin/Visibilite.txt \
echo "'..conditionMatin[j].Icone..'.png">'..repsauv..'donnee/jour-'..j..'/Matin/Ico-condition.txt \
echo "'..conditionMatin[j].VentIcone..'">'..repsauv..'donnee/jour-'..j..'/Matin/Ico-Vent.txt')
end
-- fin matin
end
end
end
function FondEcran_recupam()
for j = 1,jours do
if apresmidi == "oui" then
if Mode == "fondecran" then
if os.execute("cd "..repsauv.."donnee/jour-"..j.."/AM") ~= 0 then
os.execute("mkdir "..repsauv.."donnee/jour-"..j.."/AM")
end
os.execute('echo "'..conditionAM[j].CondMeteo..'">'..repsauv..'donnee/jour-'..j..'/AM/CondMeteo.txt \
echo "'..conditionAM[j].CondMeteo1..'">'..repsauv..'donnee/jour-'..j..'/AM/CondMeteo1.txt \
echo "'..conditionAM[j].CondMeteo2..'">'..repsauv..'donnee/jour-'..j..'/AM/CondMeteo2.txt \
echo "'..conditionAM[j].TempMax..'">'..repsauv..'donnee/jour-'..j..'/AM/TempMax.txt \
echo "'..conditionAM[j].TempMin..'">'..repsauv..'donnee/jour-'..j..'/AM/TempMin.txt \
echo "'..conditionAM[j].TempMaxR..'">'..repsauv..'donnee/jour-'..j..'/AM/TempMaxR.txt \
echo "'..conditionAM[j].TempMinR..'">'..repsauv..'donnee/jour-'..j..'/AM/TempMinR.txt \
echo "'..conditionAM[j].ProbPrec..'">'..repsauv..'donnee/jour-'..j..'/AM/ProbPrec.txt \
echo "'..conditionAM[j].VentDir..'">'..repsauv..'donnee/jour-'..j..'/AM/VentDir.txt \
echo "'..conditionAM[j].VentP..'">'..repsauv..'donnee/jour-'..j..'/AM/VentP.txt \
echo "'..conditionAM[j].VentForce..'">'..repsauv..'donnee/jour-'..j..'/AM/VentForce.txt \
echo "'..conditionAM[j].QPluie..'">'..repsauv..'donnee/jour-'..j..'/AM/QPluie.txt \
echo "'..conditionAM[j].QNeige..'">'..repsauv..'donnee/jour-'..j..'/AM/QNeige.txt \
echo "'..conditionAM[j].Humidite..'">'..repsauv..'donnee/jour-'..j..'/AM/Humidite.txt \
echo "'..conditionAM[j].CouvNuage..'">'..repsauv..'donnee/jour-'..j..'/AM/CouvNuage.txt \
echo "'..conditionAM[j].PointRosee..'">'..repsauv..'donnee/jour-'..j..'/AM/PointRosee.txt \
echo "'..conditionAM[j].Visibilite..'">'..repsauv..'donnee/jour-'..j..'/AM/Visibilite.txt \
echo "'..conditionAM[j].Icone..'.png">'..repsauv..'donnee/jour-'..j..'/AM/Ico-condition.txt \
echo "'..conditionAM[j].VentIcone..'">'..repsauv..'donnee/jour-'..j..'/AM/Ico-Vent.txt')
end
--fin am
end
end
end
function FondEcran_recupsoiree()
for j = 1,jours do
if soiree == "oui" then
if Mode == "fondecran" then
if os.execute("cd "..repsauv.."donnee/jour-"..j.."/Soirée") ~= 0 then
os.execute("mkdir "..repsauv.."donnee/jour-"..j.."/Soirée")
end
os.execute('echo "'..conditionSoiree[j].CondMeteo..'">'..repsauv..'donnee/jour-'..j..'/Soirée/CondMeteo.txt \
echo "'..conditionSoiree[j].CondMeteo1..'">'..repsauv..'donnee/jour-'..j..'/Soirée/CondMeteo1.txt \
echo "'..conditionSoiree[j].CondMeteo2..'">'..repsauv..'donnee/jour-'..j..'/Soirée/CondMeteo2.txt \
echo "'..conditionSoiree[j].TempMax..'">'..repsauv..'donnee/jour-'..j..'/Soirée/TempMax.txt \
echo "'..conditionSoiree[j].TempMin..'">'..repsauv..'donnee/jour-'..j..'/Soirée/TempMin.txt \
echo "'..conditionSoiree[j].TempMaxR..'">'..repsauv..'donnee/jour-'..j..'/Soirée/TempMaxR.txt \
echo "'..conditionSoiree[j].TempMinR..'">'..repsauv..'donnee/jour-'..j..'/Soirée/TempMinR.txt \
echo "'..conditionSoiree[j].ProbPrec..'">'..repsauv..'donnee/jour-'..j..'/Soirée/ProbPrec.txt \
echo "'..conditionSoiree[j].VentDir..'">'..repsauv..'donnee/jour-'..j..'/Soirée/VentDir.txt \
echo "'..conditionSoiree[j].VentP..'">'..repsauv..'donnee/jour-'..j..'/Soirée/VentP.txt \
echo "'..conditionSoiree[j].VentForce..'">'..repsauv..'donnee/jour-'..j..'/Soirée/VentForce.txt \
echo "'..conditionSoiree[j].QPluie..'">'..repsauv..'donnee/jour-'..j..'/Soirée/QPluie.txt \
echo "'..conditionSoiree[j].QNeige..'">'..repsauv..'donnee/jour-'..j..'/Soirée/QNeige.txt \
echo "'..conditionSoiree[j].Humidite..'">'..repsauv..'donnee/jour-'..j..'/Soirée/Humidite.txt \
echo "'..conditionSoiree[j].CouvNuage..'">'..repsauv..'donnee/jour-'..j..'/Soirée/CouvNuage.txt \
echo "'..conditionSoiree[j].PointRosee..'">'..repsauv..'donnee/jour-'..j..'/Soirée/PointRosee.txt \
echo "'..conditionSoiree[j].Visibilite..'">'..repsauv..'donnee/jour-'..j..'/Soirée/Visibilite.txt \
echo "'..conditionSoiree[j].Icone..'.png">'..repsauv..'donnee/jour-'..j..'/Soirée/Ico-condition.txt \
echo "'..conditionSoiree[j].VentIcone..'">'..repsauv..'donnee/jour-'..j..'/Soirée/Ico-Vent.txt')
end
-- fin soiree
end
end
end
function FondEcran_recupnuit()
for j = 1,jours do
if nuit == "oui" then
if Mode == "fondecran" then
if os.execute("cd "..repsauv.."donnee/jour-"..j.."/Noct") ~= 0 then
os.execute("mkdir "..repsauv.."donnee/jour-"..j.."/Noct")
end
os.execute('echo "'..conditionNoct[j].CondMeteo..'">'..repsauv..'donnee/jour-'..j..'/Noct/CondMeteo.txt \
echo "'..conditionNoct[j].CondMeteo1..'">'..repsauv..'donnee/jour-'..j..'/Noct/CondMeteo1.txt \
echo "'..conditionNoct[j].CondMeteo2..'">'..repsauv..'donnee/jour-'..j..'/Noct/CondMeteo2.txt \
echo "'..conditionNoct[j].TempMax..'">'..repsauv..'donnee/jour-'..j..'/Noct/TempMax.txt \
echo "'..conditionNoct[j].TempMin..'">'..repsauv..'donnee/jour-'..j..'/Noct/TempMin.txt \
echo "'..conditionNoct[j].TempMaxR..'">'..repsauv..'donnee/jour-'..j..'/Noct/TempMaxR.txt \
echo "'..conditionNoct[j].TempMinR..'">'..repsauv..'donnee/jour-'..j..'/Noct/TempMinR.txt \
echo "'..conditionNoct[j].ProbPrec..'">'..repsauv..'donnee/jour-'..j..'/Noct/ProbPrec.txt \
echo "'..conditionNoct[j].VentDir..'">'..repsauv..'donnee/jour-'..j..'/Noct/VentDir.txt \
echo "'..conditionNoct[j].VentP..'">'..repsauv..'donnee/jour-'..j..'/Noct/VentP.txt \
echo "'..conditionNoct[j].VentForce..'">'..repsauv..'donnee/jour-'..j..'/Noct/VentForce.txt \
echo "'..conditionNoct[j].QPluie..'">'..repsauv..'donnee/jour-'..j..'/Noct/QPluie.txt \
echo "'..conditionNoct[j].QNeige..'">'..repsauv..'donnee/jour-'..j..'/Noct/QNeige.txt \
echo "'..conditionNoct[j].Humidite..'">'..repsauv..'donnee/jour-'..j..'/Noct/Humidite.txt \
echo "'..conditionNoct[j].CouvNuage..'">'..repsauv..'donnee/jour-'..j..'/Noct/CouvNuage.txt \
echo "'..conditionNoct[j].PointRosee..'">'..repsauv..'donnee/jour-'..j..'/Noct/PointRosee.txt \
echo "'..conditionNoct[j].Visibilite..'">'..repsauv..'donnee/jour-'..j..'/Noct/Visibilite.txt \
echo "'..conditionNoct[j].Icone..'.png">'..repsauv..'donnee/jour-'..j..'/Noct/Ico-condition.txt \
echo "'..conditionNoct[j].VentIcone..'">'..repsauv..'donnee/jour-'..j..'/Noct/Ico-Vent.txt')
end
-- fin nuit
end
end
end