Didier-T a écritBonjour jpdipsy,
Je doit avouer que ça me plaît bien
Merci
tiens je te met image météo modifié avec la correction de bug concernant l'affichage des icônes jour la nuit pour les deux scripts
en cause
if os.date("%H%M", os.time()) <= InfoJour[1].CoucherSoleilH..InfoJour[1].CoucherSoleilM and os.date("%H%M", os.time()) >= "0"..InfoJour[1].LeverSoleilH..InfoJour[1].LeverSoleilM then
voir post
corrections
-- 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"
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, fich_creationmodule
-- 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')
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')
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')
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)
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
--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", "QPrec", "latitude", "longitude"}
for i = 1,23 do
conditioncourante[t[i]] = donee[i]
end
time = donee[24]
io.close(file)
--Récupération prévision
for j = 1,jours do
local file = assert(io.open(repsauv.."prevision"..j, "r"))
local line = file:read()
local i = 0
local donee = {}
for line in file:lines() do
i = i+1
donee[i] = line
end
local info = {}
local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "Temp", "TempRes", "ProbPrec", "VentDir", "VentP", "VentForce", "VentRafales", "Uv", "ProbOrage", "NivPrec", "QPluie", "QNeige", "Icone", "VentIcone", "RafalesIcone", "EVerglas"}
conditionJour[j] = {}
for i = 1, 21 do
info[t[i]] = donee[i]
end
conditionJour[j] = info
local info1 = {}
t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "Temp", "TempRes", "ProbPrec", "VentDir", "VentP", "VentForce", "VentRafales", "ProbOrage", "NivPrec", "QPluie", "QNeige", "Icone", "VentIcone", "RafalesIcone", "EVerglas"}
conditionNuit[j] = {}
for i = 22, 41 do
info1[t[i-21]] = donee[i]
end
conditionNuit[j] = info1
local info2 = {}
t= {"Jour", "LeverSoleilH", "LeverSoleilM", "CoucherSoleilH", "CoucherSoleilM", "Histo_Max", "Histo_Min"}
InfoJour[j] = {}
for i = 42, 48 do
info2[t[i-41]] = donee[i]
end
InfoJour[j] = info2
io.close(file)
if matin == "oui" then
local file = assert(io.open(repsauv.."matin"..j, "r"))
local line = file:read()
local i = 0
local donee = {}
for line in file:lines() do
i = i+1
donee[i] = line
end
local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
conditionMatin[j] = {}
local info3 = {}
for i = 1, 21 do
info3[t[i]] = donee[i]
end
conditionMatin[j] = info3
io.close(file)
end
if apresmidi == "oui" then
local file = assert(io.open(repsauv.."ApresMidi"..j, "r"))
local line = file:read()
local i = 0
local donee = {}
for line in file:lines() do
i = i+1
donee[i] = line
end
local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
conditionAM[j] = {}
local info3 = {}
for i = 1, 21 do
info3[t[i]] = donee[i]
end
conditionAM[j] = info3
io.close(file)
end
if soiree == "oui" then
local file = assert(io.open(repsauv.."Soiree"..j, "r"))
local line = file:read()
local i = 0
local donee = {}
for line in file:lines() do
i = i+1
donee[i] = line
end
local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
conditionSoiree[j] = {}
local info3 = {}
for i = 1, 21 do
info3[t[i]] = donee[i]
end
conditionSoiree[j] = info3
io.close(file)
end
if nuit == "oui" then
local file = assert(io.open(repsauv.."Nuit"..j, "r"))
local line = file:read()
local i = 0
local donee = {}
for line in file:lines() do
i = i+1
donee[i] = line
end
local t = {"CondMeteo", "CondMeteo1", "CondMeteo2", "CondMeteo1se", "CondMeteo2se", "TempMax", "TempMin", "TempMaxR", "TempMinR", "ProbPrec", "VentDir", "VentP", "VentForce", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite", "Icone", "VentIcone"}
conditionNoct[j] = {}
local info3 = {}
for i = 1, 21 do
info3[t[i]] = donee[i]
end
conditionNoct[j] = info3
io.close(file)
end
end
--Récupération lunaison
local file = assert(io.open(repsauv.."lunaison", "r"))
local line = file:read()
local i = 0
local donee = {}
for line in file:lines() do
i = i+1
donee[i] = line
end
ephemerides = donee[1]
ephemerides1 = donee[2]
ephemerides2 = donee[3]
Visibilite = donee[4]
Phases = donee[5]
Phases1 = donee[6]
Phases2 = donee[7]
Noeud_lunaire = donee[8]
Apogee = donee[9]
Perigee = donee[10]
Distance = donee[11]
Age = donee[12]
Lever_LuneHeure = donee[13]
Lever_LuneMinute = donee[14]
Coucher_LuneHeure = donee[15]
Coucher_LuneMinute = donee[16]
Eclipse_partielle = donee[17]
Eclipse_total = donee[18]
io.close(file)
if 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)
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}" )
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.."\n", "creationmodule = "..fich_creationmodule)
-- etat du script pour verif_fond
os.execute('echo "Maj" >'..Rep..'/statut.txt ')
-- Sauvegarde fond ecran
os.execute(repmeteo..'/scripts/fond.ori.sh sauvegarde')
-- creation des modules externes
creation_module(mise_en_page)
-- Maj du fond d'écran
os.execute(repmeteo..'/scripts/integration.sh')
end
function FondInactif_init()
print("","Mode = "..Mode.."\n", "creationmodule = "..fich_creationmodule)
-- creation des modules externes
creation_module(mise_en_page)
end
function conky_extinction()
-- remise en place fond ecran-effacement des balises
os.execute('rm -f '..Rep..'/pidfond && rm -f '..Rep..'/statut.txt && '..repmeteo..'/scripts/fond.ori.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")
------------------------------------------------------------------------
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.Cond1
elseif info == "Meteo_CondMeteo2" then
return conditioncourante.Cond2
elseif info == "Meteo_CondMeteo1se" then
return conditioncourante.Cond1se
elseif info == "Meteo_CondMeteo2se" then
return conditioncourante.Cond2se
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_QPrec" then
return conditioncourante.QPrec
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
--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
--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
les changements en gros
********************************************************************************************
if Mode == "fondecran" then
FondEcran_init()
end
if Mode == "fondinactif" then
FondInactif_init()
end
*********************************************************************************************
*********************************************************************************************
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
*******************************************************************************************
function FondEcran_init()
print("","Mode = "..Mode.."\n", "creationmodule = "..fich_creationmodule)
-- etat du script pour verif_fond
os.execute('echo "Maj" >'..Rep..'/statut.txt ')
-- Sauvegarde fond ecran
os.execute(repmeteo..'/scripts/fond.ori.sh sauvegarde')
-- creation des modules externes
creation_module(mise_en_page)
-- Maj du fond d'écran
os.execute(repmeteo..'/scripts/integration.sh')
end
function FondInactif_init()
print("","Mode = "..Mode.."\n", "creationmodule = "..fich_creationmodule)
-- creation des modules externes
creation_module(mise_en_page)
end
abandon du fichier mise_enforme il ne reste que creationmodule
et l'exemple du script creationmodule (achtung c'est touffu)
#!/bin/bash
###############################################################################
# Modifiez si besoin est les références à vos répertoires
cheminref=~/.conky/Meteo-Lua
source $cheminref/configs/test_images_meteo.cfg 2>/dev/null
source $cheminref/configs/meteo.cfg 2>/dev/null
repville=`echo $web | cut -d / -f6-7`
# initialisation variables ----------------------------------------------------
repertimages=$TempShell/$repville
reptemp=$repertimages/cartouches
imagetemp=$repertimages/cartouches/temp.png
imagetemp1=$repertimages/cartouches/temp1.png
fondbase=$repsauv/fond-base.png
fondtravail=$repsauv/fond-travaille.png
fonte=Helvetica-LT-Std-Bold
fonte1=URW-Chancery-Medium-Italic
fonte2=Times-Bold
couleur1=white ; couleur2=yellow
#------------------------------------------------------------------------------
if [[ ! -d $reptemp ]]; then
mkdir $repertimages/cartouches
fi
# lunaison --------------------------------------------------------------------
convert -size 110x110 xc:transparent /tmp/lune.png -gravity center -geometry 50x50+0+0 -composite $reptemp/lune.png
convert -background transparent -gravity center -font $fonte -pointsize 11 -fill $couleur1 \
label:"{{Lune_ephemerides1}}\n{{Lune_ephemerides2}}" -trim \
\( +clone -background black -shadow 80x3 \) +swap +repage -gravity center -geometry -2-2 -composite $imagetemp
composite -gravity center -background transparent -geometry +0+40 $imagetemp $reptemp/lune.png $reptemp/lune.png
# ville -----------------------------------------------------------------------
convert -background transparent -font $fonte1 -pointsize 80 -fill dodgerblue label:"{{Meteo_Ville}}" \
\( +clone -background Darkblue -shadow 120x1+2+2 \) +swap -background transparent -compose over -layers merge +repage \
$imagetemp
convert $imagetemp -channel A -blur 0x4 +channel -fill skyblue -colorize 100% $imagetemp1
convert -size 300x100 xc:transparent $imagetemp1 -background transparent -gravity center -geometry +0-0 -composite \
$imagetemp -background transparent -gravity center -composite $reptemp/ville.png
# conditions actuelles --------------------------------------------------------
convert -font $fonte2 -pointsize 25 \
-background none label:"{{Meteo_CondMeteo}}" \
\( +clone -sparse-color barycentric '0,%h orange %w,0 red' \) \
\( +clone -background grey20 -shadow 120x1+2+2 \) +swap -background transparent -compose over -layers merge +repage $imagetemp
convert -size 450x50 xc:transparent $imagetemp -background transparent -gravity center -composite $reptemp/condactuel.png
bord=12
#creation cartouche -----------------------------------------------------------
convert -size 178x104 xc:none -fill none -strokewidth 1 -stroke orange -draw "roundrectangle 1,1 177,103 5,5" $imagetemp
# données meteo cartouche 1 ---------------------------------------------------
bord=5 ;pos1=85 ;pos2=92 ;posdepart=5 ;ecart=12
convert $imagetemp -background transparent \
-gravity Northwest -font $fonte -pointsize 11 -fill $couleur1 -annotate +$bord+$posdepart "Prob. Précip." -annotate +$pos1+$posdepart ":" -annotate +$pos2+$posdepart "{{Meteo_Jour_ProbPrec 1}} %" \
-annotate +$bord+$(((ecart*1)+posdepart)) "Humidité" -annotate +$pos1+$(((ecart*1)+posdepart)) ":" -annotate +$pos2+$(((ecart*1)+posdepart)) "{{Meteo_Humidite}} %" \
-annotate +$bord+$(((ecart*2)+posdepart)) "Pluie / Neige" -annotate +$pos1+$(((ecart*2)+posdepart)) ":" -annotate +$pos2+$(((ecart*2)+posdepart)) "{{Meteo_Jour_QPluie 1}} mm / {{Meteo_Jour_QNeige 1}} cm" \
-annotate +$bord+$(((ecart*3)+posdepart)) "Verglas" -annotate +$pos1+$(((ecart*3)+posdepart)) ":" -annotate +$pos2+$(((ecart*3)+posdepart)) "{{Meteo_Jour_EVerglas 1}} mm" \
-annotate +$bord+$(((ecart*4)+posdepart)) "Pression" -annotate +$pos1+$(((ecart*4)+posdepart)) ":" -annotate +$pos2+$(((ecart*4)+posdepart)) "{{Meteo_Pression}} mb" \
-annotate +$bord+$(((ecart*5)+posdepart)) "Visibilité" -annotate +$pos1+$(((ecart*5)+posdepart)) ":" -annotate +$pos2+$(((ecart*5)+posdepart)) "{{Meteo_Visibilite}} km U.V : {{Meteo_Uv}}" \
-annotate +$bord+$(((ecart*6)+posdepart)) "Levé / Couché" -annotate +$pos1+$(((ecart*6)+posdepart)) ":" -annotate +$pos2+$(((ecart*6)+posdepart)) "{{Meteo_HLeverSoleil 1}}h{{Meteo_MLeverSoleil 1}} / {{Meteo_HCoucherSoleil 1}}h{{Meteo_MCoucherSoleil 1}}" \
-annotate +$bord+$(((ecart*7)+posdepart)) "Durée du jour" -annotate +$pos1+$(((ecart*7)+posdepart)) ":" -annotate +$pos2+$(((ecart*7)+posdepart)) "{{Meteo_HDureeJour 1}}h{{Meteo_MDureeJour 1}}" \
$imagetemp
#------------------------------------------------------------------------------
# ombres cartouche
convert $imagetemp -bordercolor None -border 10x10 \( +clone -background black -shadow 100x2+2+2 \) \
-compose DstOver -composite -compose Over $reptemp/actuel.png
# version ---------------------------------------------------------------------
convert -background none -fill orange -font $fonte -pointsize 10 \
label:"Météo-Lua {{Version}} - Dernière mise à jour météo : {{Meteo_Jour %a_%d_%b_%Y 1}} à {{Meteo_Heure}}h{{Meteo_Minute}}" -trim \
\( +clone -background grey19 -shadow 100x1+0+0 -channel A -level 0,5% +channel \) +swap +repage -gravity center -composite $reptemp/version.png
# temperatures ----------------------------------------------------------------
function coultemp
{
if (($temp < -5 )); then
coul=blue4
elif (($temp < 1 && $temp > -6 )); then
coul=blue
elif (($temp < 6 && $temp > 0)); then
coul=dodgerblue3
elif (($temp < 20 && $temp > 5 )); then
coul=white
elif (($temp < 25 && $temp > 19 )); then
coul=yellow
elif (($temp > 24 )); then
coul=red
else coul=black
fi
}
temp={{Meteo_TempAct}} ; coultemp
convert -background transparent -font $fonte -pointsize 28 -fill $coul label:$temp"°" /tmp/max.png
temp={{Meteo_TempRes}} ; coultemp
convert -background transparent -font $fonte -pointsize 14 -fill $couleur1 label:"/" -fill $coul label:$temp"°" +append /tmp/min.png
temp={{Meteo_Jour_Temp 1}} ; coultemp
convert -background transparent -font Helvetica-LT-Std-Bold -pointsize 14 -fill $couleur1 label:"Max : " -fill $coul label:$temp"°" +append /tmp/max1.png
convert -size 120x120 xc:transparent \
/tmp/max.png -background transparent -gravity NorthEast -geometry +48+8 -composite \
/tmp/min.png -background transparent -gravity Northwest -geometry +58+19 -composite \
/tmp/max1.png -background transparent -gravity North -geometry +0+37 -composite \
$reptemp/temps.png
#rm /tmp/max.png ; rm /tmp/min.png ; rm /tmp/max1.png
# Historique ------------------------------------------------------------------
convert $reptemp/temps.png -background transparent -gravity North -font $fonte -pointsize 13 -fill $couleur1 \
-annotate +0+55 "Historique" \
-pointsize 16 -fill $couleur1 -annotate +0+87 "{{Meteo_Histo_Max 1}}° / {{Meteo_Histo_Min 1}}°" $reptemp/temps.png
# incruste année --------------------------------------------------------------
an=`date +"%Y"`
convert -background transparent -fill $couleur2 -font $fonte -stroke black -pointsize 18 label:$[$an-1] $imagetemp
composite -compose Over -gravity North -geometry +0+70 -dissolve 40,100 $imagetemp $reptemp/temps.png $reptemp/temps.png
# icone-vent ------------------------------------------------------------------
convert -size 100x100 xc:transparent -background transparent -gravity center -font $fonte -pointsize 13 -fill $couleur2 \
-annotate +0-32 "{{Meteo_VentDirP}}" \
-annotate +0+32 "{{Meteo_VentForce}} km/h" $reptemp/vent.png
composite -gravity center -background transparent -geometry 54x54+0+0 -dissolve 60% {{Meteo_IconeV $IconesRep/vent 0,0 0x0 60}} $reptemp/vent.png $reptemp/vent.png
# Prévisions cartouche 1 ------------------------------------------------------
convert -size 200x200 xc:none -fill none -strokewidth 1 -stroke orange -draw "roundrectangle 1,5,199,195,5,5" $imagetemp
# Prévisions ------------------------------------------------------------------
echo -n "Prévisions" | sed 's/./&@/g; s/@$//' | tr '@' '\012' |\
convert -background none -fill blue -font $fonte2 -pointsize 14 -gravity center label:@- -trim \
\( +clone -background skyblue -shadow 100x1+0+0 -channel A -level 0,6% +channel \) +swap +repage -gravity center -composite $imagetemp1
composite -gravity west -background transparent -geometry +4+0 -dissolve 65% $imagetemp1 $imagetemp $imagetemp
rot=353 ; pos1=23 ; pos2=138 ; pos3=145 ; posdepart=20 ; posdepart1=37 ;ecart=35
convert $imagetemp -background transparent \
-gravity Northwest -font $fonte -pointsize 11 -fill $couleur2 \
-annotate +$pos1+$posdepart "{{Meteo_Jour %a 2}}" \
-annotate +$pos1+$(((ecart*1)+posdepart)) "{{Meteo_Jour %a 3}}" \
-annotate +$pos1+$(((ecart*2)+posdepart)) "{{Meteo_Jour %a 4}}" \
-annotate +$pos1+$(((ecart*3)+posdepart)) "{{Meteo_Jour %a 5}}" \
-annotate +$pos1+$(((ecart*4)+posdepart)) "{{Meteo_Jour %a 6}}" \
-annotate +$pos2+$posdepart "{{Meteo_Jour_VentDirP 2}}" \
-annotate +$pos2+$(((ecart*1)+posdepart)) "{{Meteo_Jour_VentDirP 3}}" \
-annotate +$pos2+$(((ecart*2)+posdepart)) "{{Meteo_Jour_VentDirP 4}}" \
-annotate +$pos2+$(((ecart*3)+posdepart)) "{{Meteo_Jour_VentDirP 5}}" \
-annotate +$pos2+$(((ecart*4)+posdepart)) "{{Meteo_Jour_VentDirP 6}}" \
-gravity Northwest -font $fonte -pointsize 11 -fill $couleur1 \
-annotate +$pos1+$posdepart1 "{{Meteo_Jour_Temp 2}}°/{{Meteo_Nuit_Temp 2}}°" \
-annotate +$pos1+$(((ecart*1)+posdepart1)) "{{Meteo_Jour_Temp 3}}°/{{Meteo_Nuit_Temp 3}}°" \
-annotate +$pos1+$(((ecart*2)+posdepart1)) "{{Meteo_Jour_Temp 4}}°/{{Meteo_Nuit_Temp 4}}°" \
-annotate +$pos1+$(((ecart*3)+posdepart1)) "{{Meteo_Jour_Temp 5}}°/{{Meteo_Nuit_Temp 5}}°" \
-annotate +$pos1+$(((ecart*4)+posdepart1)) "{{Meteo_Jour_Temp 6}}°/{{Meteo_Nuit_Temp 6}}°" \
-annotate "$rot"x"$rot"+$pos3+$posdepart1 "{{Meteo_Jour_VentForce 2}} km/h" \
-annotate "$rot"x"$rot"+$pos3+$(((ecart*1)+posdepart1)) "{{Meteo_Jour_VentForce 3}} km/h" \
-annotate "$rot"x"$rot"+$pos3+$(((ecart*2)+posdepart1)) "{{Meteo_Jour_VentForce 4}} km/h" \
-annotate "$rot"x"$rot"+$pos3+$(((ecart*3)+posdepart1)) "{{Meteo_Jour_VentForce 5}} km/h" \
-annotate "$rot"x"$rot"+$pos3+$(((ecart*4)+posdepart1)) "{{Meteo_Jour_VentForce 6}} km/h" \
$imagetemp
# icones ----------------------------------------------------------------------
tailleic=51x30 ; pos=55 ; tailleic1=30x30 ; pos1=100 ; posdepart=17
convert $imagetemp \
{{Meteo_Jour_IconeM $IconesRep 0,0 0x0 60 2}} -background transparent -geometry $tailleic+$pos+$posdepart -composite \
{{Meteo_Jour_IconeM $IconesRep 0,0 0x0 60 3}} -background transparent -geometry $tailleic+$pos+$(((ecart*1)+posdepart)) -composite \
{{Meteo_Jour_IconeM $IconesRep 0,0 0x0 60 4}} -background transparent -geometry $tailleic+$pos+$(((ecart*2)+posdepart)) -composite \
{{Meteo_Jour_IconeM $IconesRep 0,0 0x0 60 5}} -background transparent -geometry $tailleic+$pos+$(((ecart*3)+posdepart)) -composite \
{{Meteo_Jour_IconeM $IconesRep 0,0 0x0 60 6}} -background transparent -geometry $tailleic+$pos+$(((ecart*4)+posdepart)) -composite \
{{Meteo_Jour_IconeV $IconesRep/vent 0,0 0x0 60 2}} -background transparent -geometry $tailleic1+$pos1+$posdepart -composite \
{{Meteo_Jour_IconeV $IconesRep/vent 0,0 0x0 60 3}} -background transparent -geometry $tailleic1+$pos1+$(((ecart*1)+posdepart)) -composite \
{{Meteo_Jour_IconeV $IconesRep/vent 0,0 0x0 60 4}} -background transparent -geometry $tailleic1+$pos1+$(((ecart*2)+posdepart)) -composite \
{{Meteo_Jour_IconeV $IconesRep/vent 0,0 0x0 60 5}} -background transparent -geometry $tailleic1+$pos1+$(((ecart*3)+posdepart)) -composite \
{{Meteo_Jour_IconeV $IconesRep/vent 0,0 0x0 60 6}} -background transparent -geometry $tailleic1+$pos1+$(((ecart*4)+posdepart)) -composite \
$imagetemp
# ombres cartouche ------------------------------------------------------------
convert $imagetemp -bordercolor None -border 11x11 \( +clone -background black -shadow 100x2+2+2 \) -compose DstOver -composite -compose Over $reptemp/previsions.png
# nettoyage -------------------------------------------------------------------
rm $imagetemp1; rm $imagetemp
# icone conditions actuell
convert {{Meteo_IconeM $IconesRep 0,0 0x0 60}} -resize 60% \( +clone -background black -shadow 100x2+2+2 \) -compose DstOver -composite -compose Over $reptemp/ico_cond.png
# Mise en forme
convert -resize $ecran! $repsauv/fond-base.png $repsauv/fond-base.png
convert $fondbase \
$reptemp/ico_cond.png -background transparent -gravity North -geometry -210+30 -composite \
$reptemp/lune.png -background transparent -gravity North -geometry +250+20 -composite \
$reptemp/ville.png -background transparent -gravity North -geometry +0+10 -composite \
$reptemp/condactuel.png -background transparent -gravity North -geometry +0+90 -composite \
$reptemp/temps.png -background transparent -gravity North -geometry -50+130 -composite \
$reptemp/vent.png -background transparent -gravity North -geometry +50+130 -composite \
$reptemp/actuel.png -background transparent -gravity North -geometry -200+120 -composite \
$reptemp/previsions.png -background transparent -gravity North -geometry +200+115 -composite \
$reptemp/version.png -background transparent -gravity North -geometry -120+240 -composite \
$fondtravail
# sauvegarde et intégration
maintenant c'est lui qui gère toute la mise en forme donc un seul script à modifier sans compter la config
# utilisé par images_meteo_lua
# choix du type d'affichage
# Mode=fondecran Mode=fondinactif ou Mode=classique
Mode=fondecran
# le format de votre ecran important
ecran=1440x900
#Repertoire orig Meteo-Lua
repmeteo=~/.conky/Meteo-Lua
MiseEnPage=~/.conky/Meteo-Lua/scripts/creationmodules-new
#Repertoire fonts pour convert
repfonts=~/.conky/Meteo-Lua/fonts
#Images de base Thermomètre
Therm=~/.conky/Meteo-Lua/icones/Themes/JPDipsy/Classique/Thermometre
ThermRond=~/.conky/Meteo-Lua/icones/Themes/JPDipsy/Metal/Thermometre
#Images de base Rose des vents
Rose=~/.conky/Meteo-Lua/icones/Themes/JPDipsy/Metal/Rose-des-vents
##Définition des images pour les paliers
palier1=dir-vert.png
palier2=dir-bleu.png
palier3=dir-rouge.png
palier4=dir-vert.png
##définition des couleurs de fontes pour les paliers
palier1coulfont=blue
palier2coulfont=white
palier3coulfont=white
palier4coulfont=black
IconesRep=~/.conky/Meteo-Lua/icones
#Images de base cycle lunaire
Lune=~/.conky/Meteo-Lua/icones/Themes/JPDipsy/Metal/Lune
#Images de base cycle lunaire
Barometre=~/.conky/Meteo-Lua/icones/Themes/JPDipsy/Metal/Barometre
##### Paramètres Thermomètres #####
#Thermometres={
#Image de base
#base=chrome.png
#Image mercure
#mercure=bleu.png
#Info affichée par le mercure
#mercure_info=TempAct
#Image(s) plot(s)
#plot=rouge.png, noir.png
#Info(s) affichée par le(s) plot(s)
#plot_info=TempRes, Jour_Temp 1},
#{base=marbre.png
#mercure=bleu.png
#mercure_info=Jour_Temp 2
#plot=noir.png, rouge.png, gris.png
#plot_info=Jour_TempRes 1, Nuit_Temp 2, Nuit_TempRes 2}
Ne valide rien pour le moment sauf la correction de bug (vérifies quand même) je vais faire un pack complet conky classique ,conky fond inactif, conky fond d'écran scripts pour xplanetFX (la totale quoi 🙂 )avec la doc et tout ce qui va pour être utiliser dans voyager avec ce que vous mettez au point en ce moment et je ferai signe.
A+