meteo.lua
-- Créé par Didier-T (forum.ubuntu-fr.org)
-- Nécessite imagemagique
require "io"
function lune(r)
s = "${exec wget -q -O "..r.."/cal_lunaire http://www.calendrier-lunaire.net/}"
conky_parse( s )
local file = assert(io.open(r..'/cal_lunaire', "rb") )
local line = file:read()
for line in file:lines() do
local pos1 = string.find(line, '">')
local pos2 = string.find(line, "</", pos1)
if string.find(line, "ephemerides_1") ~= nil then
pos1 = string.find(line, 'src="')
pos2 = string.find(line, '" /')
s = "${exec wget -q -O "..r.."/lune.png http://www.calendrier-lunaire.net/"..string.sub(line, pos1+5, pos2-1).."}"
conky_parse( s )
conky_parse( "${exec convert "..r.."/lune.png -transparent '#091a2a' "..r.."/lune.png}" )
elseif string.find(line, "<h2>") ~= nil then
ephemerides1 = string.sub(line, pos1+2, pos2-1)
local pos3 = string.find(line, 'n>', pos2)
local pos4 = string.find(line, "</", pos2+3)
ephemerides2 = string.sub(line, pos3+3, pos4-1)
ephemerides = ephemerides1.." "..ephemerides2
elseif string.find(line, "Visibilit") ~= nil then
Visibilite = string.sub(line, pos1+2, pos2-3)
elseif string.find(line, "Phases") ~= nil then
Phases = string.gsub(string.sub(line, pos1+2, pos2-1), "é", "é")
local pos3 = string.find(Phases, ',')
Phases1 = string.sub(Phases, 0, pos3-1)
Phases2 = string.sub(Phases, pos3+2)
elseif string.find(line, "Noeud lunaire") ~= nil then
local a = string.gsub(string.sub(line, pos1+2, pos2-1), "Dans ", "")
Noeud_lunaire = string.gsub(a, " Jours", "")
elseif string.find(line, "Apog") ~= nil then
local a = string.gsub(string.sub(line, pos1+2, pos2-1), "Dans ", "")
Apogee = string.gsub(a, " Jours", "")
elseif string.find(line, "Perig") ~= nil then
local a = string.gsub(string.sub(line, pos1+2, pos2-1), "Dans ", "")
Perigee = string.gsub(a, " Jours", "")
elseif string.find(line, "Distance") ~= nil then
Distance = string.sub(line, pos1+2, pos2-4)
elseif string.find(line, "Age de la Lune") ~= nil then
Age = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "La Lune se") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(a, ":")
Lever_LuneHeure = string.sub(a, 0, pos3-1)
Lever_LuneMinute = string.sub(a, pos3+1)
local pos3 = string.find(line, '">', pos2)
local pos4 = string.find(line, "</", pos3+3)
a = string.sub(line, pos3+2, pos4-1)
local pos5 = string.find(a, ":")
Coucher_LuneHeure = string.sub(a, 0, pos5-1)
Coucher_LuneMinute = string.sub(a, pos5+1)
elseif string.find(line, "eclipse_partielle") ~= nil then
local pos3 = string.find(line, '">', pos1+3)
local a = string.gsub(string.sub(line, pos3+2, pos2-1), "<br />", "à")
Eclipse_partielle = a
elseif string.find(line, "eclipse_totale") ~= nil then
local pos3 = string.find(line, '">', pos1+3)
local a = string.gsub(string.sub(line, pos3+2, pos2-1), "<br />", "à")
Eclipse_total = a
end
end
io.close(file)
end
function test_image(i)
if i == "1" then
return "1su.png"
elseif i == "2" then
return "2msu.png"
elseif i == "3" then
return "3psu.png"
elseif i == "4" then
return "4ic.png"
elseif i == "5" then
return "5h.png"
elseif i == "6" then
return "6mc.png"
elseif i == "7" then
return "7c.png"
elseif i == "8" then
return "8d.png"
elseif i == "11" then
return "9f.png"
elseif i == "12" then
return "10s.png"
elseif i == "13" then
return "11mcs.png"
elseif i == "14" then
return "12psus.png"
elseif i == "15" then
return "13t.png"
elseif i == "16" then
return "14mct.png"
elseif i == "17" then
return "15psut.png"
elseif i == "18" then
return "16r.png"
elseif i == "19" then
return "17fl.png"
elseif i == "20" then
return "18mcfl.png"
elseif i == "21" then
return "19psfl.png"
elseif i == "22" then
return "20sn.png"
elseif i == "23" then
return "21mcsn.png"
elseif i == "24" then
return "22i.png"
elseif i == "25" then
return "23sl.png"
elseif i == "26" then
return "24fr.png"
elseif i == "29" then
return "25rsn.png"
elseif i == "30" then
return "27ho.png"
elseif i == "31" then
return "28co.png"
elseif i == "32" then
return "26w.png"
elseif i == "33" then
return "29cl.png"
elseif i == "34" then
return "31mcl.png"
elseif i == "35" then
return "32pc.png"
elseif i == "36" then
return "33ic.png"
elseif i == "37" then
return "34h.png"
elseif i == "38" then
return "35mc.png"
elseif i == "39" then
return "36pcs.png"
elseif i == "40" then
return "37mcs.png"
elseif i == "41" then
return "38pct.png"
elseif i == "42" then
return "39mct.png"
elseif i == "43" then
return "40mcfl.png"
elseif i == "44" then
return "41mcsn.png"
end
end
function direction_vent(i)
if i == "Calme" then
return 0
elseif i == "N" then
return 10
elseif i == "NNE" then
return 11
elseif i == "NE" then
return 12
elseif i == "ENE" then
return 13
elseif i == "E" then
return 14
elseif i == "ESE" then
return 15
elseif i == "SE" then
return 16
elseif i == "SSE" then
return 17
elseif i == "S" then
return 2
elseif i == "SSO" then
return 3
elseif i == "SO" then
return 4
elseif i == "OSO" then
return 5
elseif i == "O" then
return 6
elseif i == "ONO" then
return 7
elseif i == "NO" then
return 8
elseif i == "NNO" then
return 9
else
return 1
end
end
function vent_plein(d)
local b
if string.len(d) == 1 then
if string.find(d, "N") ~= nil then
b = string.gsub(d, "N", "Nord")
elseif string.find(d, "S") ~= nil then
b = string.gsub(d, "S", "Sud")
elseif string.find(d, "E") ~= nil then
b = string.gsub(d, "E", "Est")
elseif string.find(d, "O") ~= nil then
b = string.gsub(d, "O", "Ouest")
end
else
b = d
end
return b
end
function icone_vent(d, fo)
local f = tonumber(fo)
local n
if f <= 25 then
n = d
elseif f <= 50 then
n = d + 17
elseif f <= 75 then
n = d + 34
elseif f >= 76 then
n = d + 51
end
if n <= 9 then
n = "0"..n
end
return n..".png"
end
function decoupage(d)
local l1, l2, n, p1, p2, n1, n2, l1b, l2b
if string.len(d) >= 21 then
n = math.ceil(string.len(d)/2)
p1 = string.find(d, " ", n)
p2 = string.find(d, " ", -n)
if p1 >= p2 then
l1b = string.sub(d, 1, p2-1)
l2b = string.sub(d, p2+1)
else
l1b = string.sub(d, 1, p1-1)
l2b = string.sub(d, p1+1)
end
else
l1b = d
l2b = " "
end
n1 = math.ceil((21 - string.len(l1b))/2)
l1 = string.rep(" ", n1)..l1b
n2 = math.ceil((21 - string.len(l2b))/2)
l2 = string.rep(" ", n2)..l2b
return l1, l2, l1b, l2b
end
function jour_n(a, j, x)
local pos3, iconej,Jour, CondMeteoj, CondMeteoj1, CondMeteoj2, Temp, TempjRes, Vent, VentDirj, VentForcej, iconev, VentP, Uv, ProbOrage, NivPrec, QPluie, QNeige, DPrecHeure, DPluieHeure, DPrecNuit, DPluieNuit, niconej, nCondMeteoj, nCondMeteoj1, nCondMeteoj2, nTemp, nTempjRes, nVent, nVentDirj, nVentForcej, niconev, nVentP, nUv, nProbOrage, nNivPrec, nQPluie, nQNeige, nDPrecHeure, nDPluieHeure, nDPrecMinute, nDPluieMinute, LeverSoleilHeure, CoucherSoleilHeure, LeverLuneHeure, CoucherLuneHeure, DureeJourHeure, DureeNuitHeure, LeverSoleilMinute, CoucherSoleilMinute, LeverLuneMinute, CoucherLuneMinute, DureeJourMinute, DureeNuitMinute, ABJour, CondMeteoj1se, CondMeteoj2se, nCondMeteoj1se, nCondMeteoj2se
local i = j+x
local s = '${exec wget -q --load-cookies '..Rep..'/cookie -O '..Rep..'/details'..j..' '..a..'details'..i..'.aspx}'
conky_parse( s )
local file = assert(io.open(Rep..'/details'..j, "rb") )
local line = file:read()
for line in file:lines() do
line = string.gsub(line, ",", ".")
local pos1 = string.find(line, '">', 40)
local pos2 = string.find(line, "</")
if string.find(line, "imgDayIcon") ~= nil then
pos1 = string.find(line, 'blue/')
pos2 = string.find(line, "_int")
iconej = test_image(string.sub(line, pos1+5, pos2-1))
elseif string.find(line, "lblDetails") ~= nil then
pos3 = string.find(line, "pour")
Jour = string.sub(line, pos3+5, pos2-1)
ABJour = string.sub(line, pos3+5, pos3+7) --jour abrege
elseif string.find(line, "lblDayText") ~= nil then
CondMeteoj = string.sub(line, pos1+2, pos2-1)
CondMeteoj1, CondMeteoj2, CondMeteoj1se, CondMeteoj2se = decoupage(CondMeteoj)
elseif string.find(line, "lblHighValue") ~= nil then Temp = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblRealFeelValue") ~= nil then TempjRes = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblWindsValue") ~= nil then
Vent = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(Vent, " ")
VentDirj = string.gsub(string.sub(Vent, 1, pos3-1), "W", "O")
VentForcej = string.sub(Vent, pos3+1)
iconev = icone_vent(direction_vent(VentDirj), VentForcej)
VentP = vent_plein(VentDirj)
elseif string.find(line, "lblMaxUVValue") ~= nil then Uv = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblTStormProbValue") ~= nil then ProbOrage = string.sub(line, pos1+2, pos2-2)
elseif string.find(line, "lblPrecipValue") ~= nil then NivPrec = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblRainValue") ~= nil then QPluie = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblSnowValue") ~= nil then QNeige = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblHoursPrecipValue") ~= nil then
DPrecHeure = string.sub(line, pos1+2, pos2-8)
DPrecMinute = "00"
elseif string.find(line, "lblHoursOfRainValue") ~= nil then
DPluieHeure = string.sub(line, pos1+2, pos2-8)
DPluieMinute = "00"
elseif string.find(line, "imgNightIcon") ~= nil then
pos1 = string.find(line, 'blue/')
pos2 = string.find(line, "_int")
niconej = test_image(string.sub(line, pos1+5, pos2-1))
elseif string.find(line, "lblNightText") ~= nil then
nCondMeteoj = string.sub(line, pos1+2, pos2-1)
nCondMeteoj1, nCondMeteoj2, nCondMeteoj1se, nCondMeteoj2se = decoupage(nCondMeteoj)
elseif string.find(line, "lblLowValue") ~= nil then nTemp = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblRealFeelNValue") ~= nil then nTempjRes = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblWindsNValue") ~= nil then
nVent = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(Vent, " ")
nVentDirj = string.gsub(string.sub(Vent, 1, pos3-1), "W", "O")
nVentForcej = string.sub(Vent, pos3+1)
niconev = icone_vent(direction_vent(VentDirj), VentForcej)
nVentP = vent_plein(VentDirj)
elseif string.find(line, "lblTStormProbNValue") ~= nil then nProbOrage = string.sub(line, pos1+2, pos2-2)
elseif string.find(line, "lblPrecipNValue") ~= nil then nNivPrec = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblRainNValue") ~= nil then nQPluie = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblSnowNValue") ~= nil then nQNeige = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lblHoursPrecipNValue") ~= nil then
nDPrecHeure = string.sub(line, pos1+2, pos2-8)
nDPrecMinute = "00"
elseif string.find(line, "lblHoursOfRainNValue") ~= nil then
nDPluieHeure = string.sub(line, pos1+2, pos2-8)
nDPluieMinute = "00"
end
pos1 = string.find(line, ': ')
if string.find(line, "lblSunrise") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(a, ":")
LeverSoleilHeure = string.sub(a, 0, pos3-1)
LeverSoleilMinute = string.sub(a, pos3+1)
elseif string.find(line, "lblSunset") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(a, ":")
CoucherSoleilHeure = string.sub(a, 0, pos3-1)
CoucherSoleilMinute = string.sub(a, pos3+1)
elseif string.find(line, "lblMoonrise") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(a, ":")
LeverLuneHeure = string.sub(a, 0, pos3-1)
LeverLuneMinute = string.sub(a, pos3+1)
elseif string.find(line, "lblMoonset") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
pos3 = string.find(a, ":")
CoucherLuneHeure = string.sub(a, 0, pos3-1)
CoucherLuneMinute = string.sub(a, pos3+1)
elseif string.find(line, "lblDaylight") ~= nil then
DureeJourHeure = string.sub(line, pos1+2, pos2-1)
DureeJourMinute = "00"
elseif string.find(line, "lblDarkness") ~= nil then
DureeNuitHeure = string.sub(line, pos1+2, pos2-1)
DureeNuitMinute = "00"
end
end
conditionJour[j] = { CondMeteo=CondMeteoj, Temp=Temp, TempRes=TempjRes, VentDir=VentDirj, VentForce=VentForcej, Uv=Uv, ProbOrage=ProbOrage, NivPrec=NivPrec, QPluie=QPluie, QNeige=QNeige, DPrecHeure=DPrecHeure, DPluieHeure=DPluieHeure, DPrecMinute=DPrecMinute, DPluieMinute=DPluieMinute, IconeM=iconej, IconeV=iconev, VentP=VentP, CondMeteo1=CondMeteoj1, CondMeteo2=CondMeteoj2, CondMeteo1se=CondMeteoj1se, CondMeteo2se=CondMeteoj2se }
conditionNuit[j] = { CondMeteo=nCondMeteoj, Temp=nTemp, TempRes=nTempjRes, VentDir=nVentDirj, VentForce=nVentForcej, ProbOrage=nProbOrage, NivPrec=nNivPrec, QPluie=nQPluie, QNeige=nQNeige, DPrecHeure=nDPrecHeure, DPluieHeure=nDPluieHeure, DPrecMinute=nDPrecMinute, DPluieMinute=nDPluieMinute, IconeM=niconej, IconeV=niconev, VentP=nVentP, CondMeteo1=nCondMeteoj1, CondMeteo2=nCondMeteoj2, CondMeteo1se=nCondMeteoj1se, CondMeteo2se=nCondMeteoj2se }
InfoJour[j] = { Jour=Jour, LeverSoleilHeure=LeverSoleilHeure, CoucherSoleilHeure=CoucherSoleilHeure, LeverLuneHeure=LeverLuneHeure, CoucherLuneHeure=CoucherLuneHeure, DureeJourHeure=DureeJourHeure, DureeNuitHeure=DureeNuitHeure, LeverSoleilMinute=LeverSoleilMinute, CoucherSoleilMinute=CoucherSoleilMinute, LeverLuneMinute=LeverLuneMinute, CoucherLuneMinute=CoucherLuneMinute, DureeJourMinute=DureeJourMinute, DureeNuitMinute=DureeNuitMinute,ABJour=ABJour }
io.close(file)
end
function conky_Meteo_Maj(cmd, jours, delais, r)
if t == nil then
local bar, bar1
local l = string.sub(cmd, 0, string.find(cmd, '/quick.')-1)
local a = 1
while bar == nil do
a = a+1
bar = string.find(l, '/', -a)
end
local l1 = string.sub(cmd, 0, bar-1)
local b = 1
while bar1 == nil do
b = b+1
bar1 = string.find(l1, '/', -b)
end
l = string.sub(cmd, bar1, string.find(cmd, '/quick.')-1)
Rep = r..l
if os.execute("cd "..Rep) ~= 0 then
os.execute("mkdir "..r..string.sub(cmd, bar1, bar-1))
os.execute("mkdir "..Rep)
end
t = os.time()-delais
start = 1
end
if tonumber(delais) <= os.difftime(os.time(), t) then
if os.execute("ping -c 1 www.google.com") == 0 then
Heure = nil
while Heure == nil do
local s = '${exec wget -q --save-cookies '..Rep..'/cookie -O '..Rep..'/curr_cond_raw '..cmd..'}'
local addr_week = string.sub(cmd, 0, string.find(cmd, 'quick.')-1)
conky_parse( s )
if not conditionJour then
conditionJour = {}
conditionNuit = {}
InfoJour= {}
end
local file = assert(io.open(Rep.."/curr_cond_raw", "rb") )
local line = file:read()
for line in file:lines() do
local pos1 = string.find(line, '">')
local pos2 = string.find(line, "</")
if string.find(line, "imgCurConCondition") ~= nil then
pos1 = string.find(line, 'blue/')
pos2 = string.find(line, "_int")
icone = test_image(string.sub(line, pos1+5, pos2-1))
elseif string.find(line, "lblRealFeelValue") ~= nil then TempRes = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblCurrentTemp") ~= nil then TempAct = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblCurrentTime") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
local pos3 = string.find(a, ":")
Heure = string.sub(a, 0, pos3-1)
Minute = string.sub(a, pos3+1)
elseif string.find(line, "lblCurrentText") ~= nil then
CondMeteo = string.sub(line, pos1+2, pos2-1)
CondMeteo1, CondMeteo2, CondMeteo1se, CondMeteo2se = decoupage(CondMeteo)
elseif string.find(line, "lblWindsValue") ~= nil then
local Vent = string.sub(line, pos1+2, pos2-1)
local pos3 = string.find(Vent, " ")
VentDir = string.gsub(string.sub(Vent, 1, pos3-1), "W", "O")
VentForce = string.sub(Vent, pos3+1, -6)
IconeV = icone_vent(direction_vent(VentDir), VentForce)
VentPlein = vent_plein(VentDir)
elseif string.find(line, "lblHumidityValue") ~= nil then Humidite = string.sub(line, pos1+2, pos2-2)
elseif string.find(line, "lblDewPointValue") ~= nil then Rose = string.sub(line, pos1+2, pos2-7)
elseif string.find(line, "lblPressureValue") ~= nil then Pression = string.sub(line, pos1+2, pos2-4)
elseif string.find(line, "lblPressureTenValue") ~= nil then EvoPression = string.sub(line, pos1+2, pos2-2)
elseif string.find(line, "lblVisibilityValue") ~= nil then Visibilite = string.sub(line, pos1+2, pos2-4)
elseif string.find(line, "lblSunRiseValue") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
local pos3 = string.find(a, ":")
LeverSoleilHeure = string.sub(a, 0, pos3-1)
LeverSoleilMinute = string.sub(a, pos3+1)
elseif string.find(line, "lblSunSetValue") ~= nil then
local a = string.sub(line, pos1+2, pos2-1)
local pos3 = string.find(a, ":")
CoucherSoleilHeure = string.sub(a, 0, pos3-1)
CoucherSoleilMinute = string.sub(a, pos3+1)
elseif string.find(line, "lblDate") ~= nil then Date = string.sub(line, pos1+2, pos2-1)
elseif string.find(line, "lnkLocation") ~= nil then Ville = string.sub(line, pos1+2, pos2-9)
end
end
io.close(file)
t = os.time()
if 14400 <= os.difftime(os.time(), t) or start == 1 then
local Jour
local s = '${exec wget -q --load-cookies '..Rep..'/cookie -O '..Rep..'/details1 '..addr_week..'details1.aspx}'
conky_parse( s )
local file = assert(io.open(Rep..'/details1', "rb") )
local line = file:read()
for line in file:lines() do
line = string.gsub(line, ",", ".")
local pos1 = string.find(line, "pour", 40)
local pos2 = string.find(line, "</")
if string.find(line, "lblDetails") ~= nil then
Jour = string.sub(line, pos1+5, pos2-1)
end
end
io.close(file)
if Date == Jour then
for i = 1,jours do jour_n(addr_week, i, 0) end
else
for i = 1,jours do jour_n(addr_week, i, 1) end
end
start = 2
end
end
lune(r)
end
collectgarbage()
end
return " "
end
--Retour d'information météo
--Condition courrante
function conky_Meteo_IconeM(r, p, s, f)
return "${image "..r.."/"..icone.." -p "..p.." -s "..s.." -f "..f.."}"
end
function conky_Meteo_TempRes()
return tonumber(TempRes)
end
function conky_Meteo_TempAct()
return tonumber(TempAct)
end
function conky_Meteo_Heure()
return Heure
end
function conky_Meteo_Minute()
return Minute
end
function conky_Meteo_CondMeteo()
return CondMeteo
end
function conky_Meteo_CondMeteo1()
return CondMeteo1
end
function conky_Meteo_CondMeteo2()
return CondMeteo2
end
function conky_Meteo_CondMeteo1se()
return CondMeteo1se
end
function conky_Meteo_CondMeteo2se()
return CondMeteo2se
end
function conky_Meteo_VentDir()
return VentDir
end
function conky_Meteo_VentDirP()
return VentPlein
end
function conky_Meteo_VentForce()
return tonumber(VentForce)
end
function conky_Meteo_IconeV(r, p, s, f)
return "${image "..r.."/"..IconeV.." -p "..p.." -s "..s.." -f "..f.."}"
end
function conky_Meteo_Humidite()
return tonumber(Humidite)
end
function conky_Meteo_Rose()
return tonumber(Rose)
end
function conky_Meteo_Pression()
return tonumber(Pression)
end
function conky_Meteo_EvoPression()
return EvoPression
end
function conky_Meteo_Visibilite()
return tonumber(Visibilite)
end
function conky_Meteo_HLeverSoleilC()
return LeverSoleilHeure
end
function conky_Meteo_MLeverSoleilC()
return LeverSoleilMinute
end
function conky_Meteo_HCoucherSoleilC()
return CoucherSoleilHeure
end
function conky_Meteo_MCoucherSoleilC()
return CoucherSoleilMinute
end
function conky_Meteo_Date()
return Date
end
function conky_Meteo_Ville()
return Ville
end
--Prévision Météo
--Jour
function conky_Meteo_Jour_CondMeteo(j)
return conditionJour[tonumber(j)].CondMeteo
end
function conky_Meteo_Jour_CondMeteo1(j)
return conditionJour[tonumber(j)].CondMeteo1
end
function conky_Meteo_Jour_CondMeteo2(j)
return conditionJour[tonumber(j)].CondMeteo2
end
function conky_Meteo_Jour_CondMeteo1se(j)
return conditionJour[tonumber(j)].CondMeteo1se
end
function conky_Meteo_Jour_CondMeteo2se(j)
return conditionJour[tonumber(j)].CondMeteo2se
end
function conky_Meteo_Jour_Temp(j)
return tonumber(conditionJour[tonumber(j)].Temp)
end
function conky_Meteo_Jour_TempRes(j)
return tonumber(conditionJour[tonumber(j)].TempRes)
end
function conky_Meteo_Jour_VentDir(j)
return conditionJour[tonumber(j)].VentDir
end
function conky_Meteo_Jour_VentDirP(j)
return conditionJour[tonumber(j)].VentP
end
function conky_Meteo_Jour_VentForce(j)
return tonumber(conditionJour[tonumber(j)].VentForce)
end
function conky_Meteo_Jour_Uv(j)
return tonumber(conditionJour[tonumber(j)].Uv)
end
function conky_Meteo_Jour_ProbOrage(j)
return tonumber(conditionJour[tonumber(j)].ProbOrage)
end
function conky_Meteo_Jour_NivPrec(j)
return tonumber(conditionJour[tonumber(j)].NivPrec)
end
function conky_Meteo_Jour_QPluie(j)
return tonumber(conditionJour[tonumber(j)].QPluie)
end
function conky_Meteo_Jour_QNeige(j)
return tonumber(conditionJour[tonumber(j)].QNeige)
end
function conky_Meteo_Jour_HDureePrec(j)
return conditionJour[tonumber(j)].DPrecHeure
end
function conky_Meteo_Jour_MDureePrec(j)
return conditionJour[tonumber(j)].DPrecMinute
end
function conky_Meteo_Jour_HDureePluie(j)
return conditionJour[tonumber(j)].DPluieHeure
end
function conky_Meteo_Jour_MDureePluie(j)
return conditionJour[tonumber(j)].DPluieMinute
end
function conky_Meteo_Jour_IconeM(r, p, s, f, j)
return "${image "..r.."/"..conditionJour[tonumber(j)].IconeM.." -p "..p.." -s "..s.." -f "..f.."}"
end
function conky_Meteo_Jour_IconeV(r, p, s, f, j)
return "${image "..r.."/"..conditionJour[tonumber(j)].IconeV.." -p "..p.." -s "..s.." -f "..f.."}"
end
--Nuit
function conky_Meteo_Nuit_CondMeteo(j)
return conditionNuit[tonumber(j)].CondMeteo
end
function conky_Meteo_Nuit_CondMeteo1(j)
return conditionNuit[tonumber(j)].CondMeteo1
end
function conky_Meteo_Nuit_CondMeteo2(j)
return conditionNuit[tonumber(j)].CondMeteo2
end
function conky_Meteo_Nuit_CondMeteo1se(j)
return conditionNuit[tonumber(j)].CondMeteo1se
end
function conky_Meteo_Nuit_CondMeteo2se(j)
return conditionNuit[tonumber(j)].CondMeteo2se
end
function conky_Meteo_Nuit_Temp(j)
return tonumber(conditionNuit[tonumber(j)].Temp)
end
function conky_Meteo_Nuit_TempRes(j)
return tonumber(conditionNuit[tonumber(j)].TempRes)
end
function conky_Meteo_Nuit_VentDir(j)
return conditionNuit[tonumber(j)].VentDir
end
function conky_Meteo_Nuit_VentDirP(j)
return conditionNuit[tonumber(j)].VentP
end
function conky_Meteo_Nuit_VentForce(j)
return tonumber(conditionNuit[tonumber(j)].VentForce)
end
function conky_Meteo_Nuit_ProbOrage(j)
return tonumber(conditionNuit[tonumber(j)].ProbOrage)
end
function conky_Meteo_Nuit_NivPrec(j)
return tonumber(conditionNuit[tonumber(j)].NivPrec)
end
function conky_Meteo_Nuit_QPluie(j)
return tonumber(conditionNuit[tonumber(j)].QPluie)
end
function conky_Meteo_Nuit_QNeige(j)
return tonumber(conditionNuit[tonumber(j)].QNeige)
end
function conky_Meteo_Nuit_HDureePrec(j)
return conditionNuit[tonumber(j)].DPrecHeure
end
function conky_Meteo_Nuit_MDureePrec(j)
return conditionNuit[tonumber(j)].DPrecMinute
end
function conky_Meteo_Nuit_HDureePluie(j)
return conditionNuit[tonumber(j)].DPluieHeure
end
function conky_Meteo_Nuit_MDureePluie(j)
return conditionNuit[tonumber(j)].DPluieMinute
end
function conky_Meteo_Nuit_IconeM(r, p, s, f, j)
return "${image "..r.."/"..conditionNuit[tonumber(j)].IconeM.." -p "..p.." -s "..s.." -f "..f.."}"
end
function conky_Meteo_Nuit_IconeV(r, p, s, f, j)
return "${image "..r.."/"..conditionNuit[tonumber(j)].IconeV.." -p "..p.." -s "..s.." -f "..f.."}"
end
--Infos sur la journée
function conky_Meteo_Jour(j)
return InfoJour[tonumber(j)].Jour
end
function conky_Meteo_ABJour(j)
return InfoJour[tonumber(j)].ABJour --jour abrege
end
function conky_Meteo_HLeverSoleil(j)
return InfoJour[tonumber(j)].LeverSoleilHeure
end
function conky_Meteo_MLeverSoleil(j)
return InfoJour[tonumber(j)].LeverSoleilMinute
end
function conky_Meteo_HCoucherSoleil(j)
return InfoJour[tonumber(j)].CoucherSoleilHeure
end
function conky_Meteo_MCoucherSoleil(j)
return InfoJour[tonumber(j)].CoucherSoleilMinute
end
function conky_Meteo_HLeverLune(j)
return InfoJour[tonumber(j)].LeverLuneHeure
end
function conky_Meteo_MLeverLune(j)
return InfoJour[tonumber(j)].LeverLuneMinute
end
function conky_Meteo_HCoucherLune(j)
return InfoJour[tonumber(j)].CoucherLuneHeure
end
function conky_Meteo_MCoucherLune(j)
return InfoJour[tonumber(j)].CoucherLuneMinute
end
function conky_Meteo_HDureeJour(j)
return InfoJour[tonumber(j)].DureeJourHeure
end
function conky_Meteo_MDureeJour(j)
return InfoJour[tonumber(j)].DureeJourMinute
end
function conky_Meteo_HDureeNuit(j)
return InfoJour[tonumber(j)].DureeNuitHeure
end
function conky_Meteo_MDureeNuit(j)
return InfoJour[tonumber(j)].DureeNuitMinute
end
--Lunaison
function conky_Lune_ephemerides()
return ephemerides
end
function conky_Lune_ephemerides1()
return ephemerides1
end
function conky_Lune_ephemerides2()
return ephemerides2
end
function conky_Lune_Visibilite()
return Visibilite
end
function conky_Lune_Phases()
return Phases
end
function conky_Lune_Phases1()
return Phases1
end
function conky_Lune_Phases2()
return Phases2
end
function conky_Lune_Noeudlunaire()
return Noeud_lunaire
end
function conky_Lune_Apogee()
return Apogee
end
function conky_Lune_Perigee()
return Perigee
end
function conky_Lune_Distance()
return Distance
end
function conky_Lune_Age()
return Age
end
function conky_Lune_HLeverLune()
return Lever_LuneHeure
end
function conky_Lune_MLeverLune()
return Lever_LuneMinute
end
function conky_Lune_HCoucherLune()
return Coucher_LuneHeure
end
function conky_Lune_MCoucherLune()
return Coucher_LuneMinute
end
function conky_Lune_EclipsePartielle()
return Eclipse_partielle
end
function conky_Lune_EclipseTotal()
return Eclipse_total
end