j'ai modifié le template pour le script v9000 afin d'avoir des thermomètres qui changent de couleur en fonction de la T°:

Il vous faudra aussi les fontes arrows et lobster ou mettez celles que vous voulez 🙂 [url=
http://www.dafont.com /fr/search.php?q=arrows]arrows-font[/url]
lobster-font
template_v9000.lua:
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbang.org/forums/viewtopic.php?id=16100
the file:
http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz
mrppeachys LUA Tutorial
http://crunchbang.org/forums/viewtopic.php?id=17246
--====================Modified---script---by---ragamatrix---===========================================--
--==================== ===========================================--
_________________________________________________________________________________________________________
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Droid-Sans-Bold"--font must be in quotes
default_font_size=9
default_color=0xffffff --white
default_alpha=1 --fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER
--[[
set a string named val to the valyue you want to display first, then use that string in the following 2 functions
use tonumber so that the output is a number
--]]
val=tonumber(now["temp"])
--val=tonumber(os.date("%S"))-10
--[[
get_color settings - this calculates the color of the thermometer inside
settings are inside ({ and }) and seperated by commas
val needs to always be the first things set. following val sub tables containing a number and a hex color are set
sub tables set between { and } with the 2 values separated by a comma
each sub table {},{} must be seperated from another sub table using a comma
the first number is the number at which the thermometer is that color
eg... {0,0x00ff00} means that at value 0 the thermometer would be green
by setting multiple colors you can have the thermometer change according to a gradient
{0,0x00ff00},{100,0xff0000} would be green a 0, red at 100 and a gracient between the two colors at values in between
the get_color function outputs a lua formatted table containing the rgba color
tcol=get_color({}) stores that color in the tcol variable which is then used in the drawing function below
--]]
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
--[[
thermometer settings - this draws the thermometer
settings are inside ({ and }) and seperated by commas
x=x position (center of thermometer circle)
y=y position
lines=1 or 0 , 1 for scale lines, 0 for no scale lines
f=font (font name in quotes)
fs=font size
label=text to display on side, must be in brackets. Do not set or set label=nil for no label
scale=size of thermometer, this affects all sizes including font size
units="C" or "F"
val=val, leave this as it is, val is set above
tcol=tcol, leave this as it is to get the correct color change, tcol is set above
---##############################################################################################example#####################################
################################################################################################# #####################################
val=tonumber(high_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=100.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})
val=tonumber(low_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=200.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})
val=tonumber(high_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=300.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})
val=tonumber(low_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=400,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})
etc
--]]
--##thermo actuel##--
thermometer ({x=720,y=123,numbers=1,lines=1,f="Mono",fs=12,label=weather_location,scale=0.6,units="C",tcol=tcol,val=val})
--Thermo j+10
val=tonumber(high_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1785.5,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1780,y=25,txt="c"})
val=tonumber(low_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1855,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1850,y=25,txt="d"})
--Thermo j+9
val=tonumber(high_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1660,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1655,y=25,txt="c"})
val=tonumber(low_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1730,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1725,y=25,txt="d"})
--Thermo j+8
val=tonumber(high_temp[8])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1535,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1530,y=25,txt="c"})
val=tonumber(low_temp[8])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1605,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1600,y=25,txt="d"})
--Thermo j+7
val=tonumber(high_temp[7])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1410,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1405,y=25,txt="c"})
val=tonumber(low_temp[7])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1480,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1475,y=25,txt="d"})
--Thermo j+6
val=tonumber(high_temp[6])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1285,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1280,y=25,txt="c"})
val=tonumber(low_temp[6])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1355,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1350,y=25,txt="d"})
--Thermo j+5
val=tonumber(high_temp[5])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1160,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1155,y=25,txt="c"})
val=tonumber(low_temp[5])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1230,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1225,y=25,txt="d"})
--Thermo j+4
val=tonumber(high_temp[4])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1035,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1030,y=25,txt="c"})
val=tonumber(low_temp[4])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1105,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1100,y=25,txt="d"})
--Thermo j+3
val=tonumber(high_temp[3])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=910,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=905,y=25,txt="c"})
val=tonumber(low_temp[3])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=980,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=975,y=25,txt="d"})
--Thermo j+2
val=tonumber(high_temp[2])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=785,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=780,y=25,txt="c"})
val=tonumber(low_temp[2])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=855,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=850,y=25,txt="d"})
--####End set thermo
--[[ forecast
datay=450 --375
datayy=15 --datay+(datayy*1)
datafx1=20
imgx=35
imgy=575
imgyy=60 -- imgy+(imgyy*1)
]]
-- forecast
datay=450
datayy=15 --datay+(datayy*1)
datafx1=20
imgx=45
imgy=575
imgyy=60 -- imgy+(imgyy*1)
ih=60
iw=60
-- ======================================================================
-- CURRENT FOR TODAY - SEE TOP LEFT -------------------------------------
out({c=0xffd433,a=1,f="Lobster1.4",fs=20,x=30,y=26,txt="Horgen"})
image({x=30,y=30,w=60,h=60,file=now["weather_icon"]})
--image({x=20,y=25,w=87,h=130,file="/home/raphix/v9000/additional_files/s12.png"})
out({c=0xFAFAEC,a=1,x=40,y=135,fs=15,txt="T° "})
out({c=0xFF8C00,fs=15,a=1,x=63,y=135,txt=now["temp"].."°"})
out({c=0xC0C0C0,a=1,x=40,y=115,fs=15,txt="± "})
out({c=0xC0C0C0,fs=15,a=1,x=63,y=115,txt=now["feels_like"].."°"})
-- FORECAST TODAY - SEE TOP RIGHT ---------------------------------------
out({c=silver,fs=15,a=1,x=320,y=25,txt="Tendance"})
image({x=325,y=30,w=60,h=60,file=weather_icon[1]})
-- image({x=285,y=100,w=60,h=60,file="/media/5/Conky/images/red+.png"})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=590,y=26,txt="c"})
out({c=0xff0000,fs=15,a=1,x=603,y=25,txt=high_temp[1].."°"})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=645,y=26,txt="d"})
out({c=0x00ffff,fs=15,a=1,x=658,y=25,txt=low_temp[1].."°"})
-- ======================================================================
-- MOON------------------------------------------------------
--out({c=0xFAFAEC,a=1,x=20,y=35,txt="Lever Soleil "})
--out({c=0x00BFFF,a=1,x=30,y=50,txt=sun_rise_24[1]})
-- MOON PHASE - CENTRE --------------------------------------------------
out({c=0xffd433,a=1,f="Lobster1.4",fs=20,x=150,y=26,txt="Ephéméride"})
image({x=165,y=30,w=60,h=60,file=moon_icon[1]})
-- image({x=170,y=170,w=120,h=120,file="/media/5/Conky/images/red+.png"})
--out({c=0xFFFFFF,a=1.0,x=190,y=235,txt=moon_phase[1]})
--out({c=0xFAFAEC,a=1,x=90,y=35,txt=" Lever Lune"})
out({c=0x00BFFF,fs=15,a=1,x=170,y=115,txt=moon_rise_24[1]})
--out({c=0xFAFAEC,a=1,x=100,y=65,txt=" Coucher Lune"})
out({c=0xFF8C00,fs=15,a=1,x=170,y=135,txt=moon_set_24[1]})
-- SUN-------------------------------------------------------
--out({c=0x00BFFF,a=1,x=275,y=115,fs=15,txt="Lever :"})
out({c=0x00BFFF,a=1,x=330,y=115,fs=15,txt=sun_rise_24[1]})
--out({c=0xFF8C00,a=1,x=254,y=135,fs=15,txt="Coucher :"})
out({c=0xFF8C00,a=1,x=330,y=135,fs=15,txt=sun_set_24[1]})
-- ======================================================================
-- ======================================================================x=465,y=25
-- WIND INFORMATION - SEE BOTTOM ----------------------------------------
image({x=665,y=103,w=30,h=30,file=now["wind_icon"]})
-- image({x=185,y=290,w=90,h=90,file="/media/5/Conky/images/red+.png"})
out({c=0xffffff,a=1,x=642,y=115,txt=now["wind_deg"]})
out({c=0xffffff,a=1,x=642,y=125,txt=now["wind_nesw"]})
-- out({c=0xffffff,a=1,x=333,y=295,txt="@"})
out({c=0xFF8C00,a=1,x=660,y=140,txt=now["wind_km"]..""})
-- ======================================================================
-- Barometric Pressure
out({c=0xFAFAEC,a=1,x=590,y=45,txt="Pression:"})
out({c=0xFF8C00,a=1,x=635,y=45,txt=now["pressure_mb"].." mb"})
-- Humidity -------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=590,y=55,txt="Humidité:"})
out({c=0x00BFFF,a=1,x=640,y=55,txt=now["humidity"].."%"})
-- Dew Point ------------------------------------------------------------
--out({c=0xFAFAEC,a=1,x=90,y=520,txt="DP:"})
--out({c=0xC0C0C0,a=1,x=135,y=520,txt=now["dew_point"].."°"})
-- ======================================================================
-- BOTTOM RIGHT
-- Ceiling
out({c=0xFAFAEC,a=1,x=590,y=65,txt="Plafond:"})
out({c=0x00BFFF,a=1,x=640,y=65,txt=now["ceiling"]})
-- Chance of Rain -------------------------------------------------------
out({c=0xFAFAEC,a=1,x=590,y=75,txt="Prob Préc:"})
out({c=0x00BFFF,a=1,x=640,y=75,txt=precipitation[1].."%"})
-- Cloud Cover
out({c=0xFAFAEC,a=1,x=590,y=85,txt="Couv Nuages:"})
out({c=0x00BFFF,a=1,x=658,y=85,txt=cloud_cover[1].."%"})
-- ======================================================================
-- BOTTOM CENTRE
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=590,y=96,txt="UV :"})
out({c=0xFF8C00,a=1,x=615,y=96,txt=uv_index_num[1]})
out({c=0xFF8C00,a=1,x=625,y=96,txt=uv_index_txt[1]})
-- ======================================================================
-- FORECAST FOR NEXT 3 HOURS --------------------------------------------
--image({x=450,y=50,w=240,h=2,file="/home/climatix/.conky/conky37/red_1.png"})
--out({c=0xFAFAEC,a=1,f="Droid-Sans-Bold",fs=10,x=415,y=55,txt="prochaines heures"})
--out({c=0x227992,a=1,f="Arial",fs=16,x=400,y=30,txt="Hours"})
-- 1st hour
out({c=0xFF9600,x=425,y=25,fs=15,txt=now["fc_hour1_time_24"]..":00"})
image({w=60,h=60,x=425,y=30,file=now["fc_hour1_wicon"]})
--image({w=60,h=60,x=20,y=475,file="/media/5/Conky/images/red+.png"})
out({c=silver,fs=15,x=435,y=105,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
--out({c=0xFF9600,x=212,y=470,txt=now["fc_hour2_time_24"]..":00"})
--image({w=60,h=60,x=200,y=475,file=now["fc_hour2_wicon"]})
-- image({w=60,h=60,x=200,y=475,file="/media/5/Conky/images/red+.png"})
--out({c=0xAFAFAF,x=221,y=550,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xFF9600,x=520,y=25,fs=15,txt=now["fc_hour3_time_24"]..":00"})
image({w=60,h=60,x=510,y=30,file=now["fc_hour3_wicon"]})
-- image({w=60,h=60,x=380,y=475,file="/media/5/Conky/images/red+.png"})
out({c=silver,fs=15,x=525,y=105,txt=now["fc_hour3_temp"] .."°"})
-- ======================================================================
-- FORECAST for the next 9 days
-- Forecast day 2 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=800,y=17,txt=forecast_day_short[2]})
out({c=0x9ACD32,a=1,x=825,y=17,txt=forecast_date[2]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=800,y=21,file=weather_icon[2]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=805,y=72,txt=sun_rise_24[2]})
out({c=0xFF8C00,a=1,x=805,y=82,txt=sun_set_24[2]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=805,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=825,y=92,txt=uv_index_num[2]})
--Wind ------------------------------------------------------------------
image({x=805,y=103,w=30,h=30,file=wind_icon[2]})
out({c=0xffffff,a=1,x=807,y=103,txt=wind_nesw[2]})
out({c=0xFF8C00,a=1,x=801,y=141,txt=wind_km[2].." Km/h"})
-- ======================================================================
-- Forecast day 3 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=925,y=17,txt=forecast_day_short[3]})
out({c=0x9ACD32,a=1,x=950,y=17,txt=forecast_date[3]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=925,y=21,file=weather_icon[3]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=930,y=72,txt=sun_rise_24[3]})
out({c=0xFF8C00,a=1,x=930,y=82,txt=sun_set_24[3]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=930,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=950,y=92,txt=uv_index_num[3]})
--Wind ------------------------------------------------------------------
image({x=930,y=103,w=30,h=30,file=wind_icon[3]})
out({c=0xffffff,a=1,x=932,y=103,txt=wind_nesw[3]})
out({c=0xFF8C00,a=1,x=926,y=141,txt=wind_km[3].." Km/h"})
-- ======================================================================
-- Forecast day 4 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1050,y=17,txt=forecast_day_short[4]})
out({c=0x9ACD32,a=1,x=1075,y=17,txt=forecast_date[4]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1050,y=21,file=weather_icon[4]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=1055,y=72,txt=sun_rise_24[4]})
out({c=0xFF8C00,a=1,x=1055,y=82,txt=sun_set_24[4]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1055,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1075,y=92,txt=uv_index_num[4]})
--Wind ------------------------------------------------------------------
image({x=1055,y=103,w=30,h=30,file=wind_icon[4]})
out({c=0xffffff,a=1,x=1057,y=103,txt=wind_nesw[4]})
out({c=0xFF8C00,a=1,x=1051,y=141,txt=wind_km[4].." Km/h"})
-- ======================================================================
-- ======================================================================
-- Forecast day 5 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1175,y=17,txt=forecast_day_short[5]})
out({c=0x9ACD32,a=1,x=1200,y=17,txt=forecast_date[5]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1175,y=21,file=weather_icon[5]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=1180,y=72,txt=sun_rise_24[5]})
out({c=0xFF8C00,a=1,x=1180,y=82,txt=sun_set_24[5]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1180,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1200,y=92,txt=uv_index_num[5]})
--Wind ------------------------------------------------------------------
image({x=1180,y=103,w=30,h=30,file=wind_icon[5]})
out({c=0xffffff,a=1,x=1182,y=103,txt=wind_nesw[5]})
out({c=0xFF8C00,a=1,x=1176,y=141,txt=wind_km[5].." Km/h"})
-- ======================================================================
-- Forecast day 6 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1300,y=17,txt=forecast_day_short[6]})
out({c=0x9ACD32,a=1,x=1325,y=17,txt=forecast_date[6]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1300,y=21,file=weather_icon[6]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=1305,y=72,txt=sun_rise_24[6]})
out({c=0xFF8C00,a=1,x=1305,y=82,txt=sun_set_24[6]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1305,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1325,y=92,txt=uv_index_num[6]})
--Wind ------------------------------------------------------------------
image({x=1305,y=103,w=30,h=30,file=wind_icon[6]})
out({c=0xffffff,a=1,x=1307,y=103,txt=wind_nesw[6]})
out({c=0xFF8C00,a=1,x=1301,y=141,txt=wind_km[6].." Km/h"})
-- ======================================================================
-- Forecast day 7 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1425,y=17,txt=forecast_day_short[7]})
out({c=0x9ACD32,a=1,x=1450,y=17,txt=forecast_date[7]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1425,y=21,file=weather_icon[7]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=1430,y=72,txt=sun_rise_24[7]})
out({c=0xFF8C00,a=1,x=1430,y=82,txt=sun_set_24[7]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1430,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1450,y=92,txt=uv_index_num[7]})
--Wind ------------------------------------------------------------------
image({x=1430,y=103,w=30,h=30,file=wind_icon[7]})
out({c=0xffffff,a=1,x=1432,y=103,txt=wind_nesw[7]})
out({c=0xFF8C00,a=1,x=1426,y=141,txt=wind_km[7].." Km/h"})
-- ======================================================================
-- Forecast day 8 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1550,y=17,txt=forecast_day_short[8]})
out({c=0x9ACD32,a=1,x=1575,y=17,txt=forecast_date[8]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1550,y=21,file=weather_icon[8]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=1555,y=72,txt=sun_rise_24[8]})
out({c=0xFF8C00,a=1,x=1555,y=82,txt=sun_set_24[8]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1555,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1575,y=92,txt=uv_index_num[8]})
--Wind ------------------------------------------------------------------
image({x=1555,y=103,w=30,h=30,file=wind_icon[8]})
out({c=0xffffff,a=1,x=1557,y=103,txt=wind_nesw[8]})
out({c=0xFF8C00,a=1,x=1551,y=141,txt=wind_km[8].." Km/h"})
-- Forecast day 9 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1675,y=17,txt=forecast_day_short[9]})
out({c=0x9ACD32,a=1,x=1700,y=17,txt=forecast_date[9]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1675,y=21,file=weather_icon[9]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1207,y=35,txt=high_temp[9].."°"})
--out({c=0x00BFFF,a=1,x=1207,y=55,txt=low_temp[9].."°"})
out({c=0x00BFFF,a=1,x=1680,y=72,txt=sun_rise_24[9]})
out({c=0xFF8C00,a=1,x=1680,y=82,txt=sun_set_24[9]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1680,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1700,y=92,txt=uv_index_num[9]})
--Wind ------------------------------------------------------------------
image({x=1680,y=103,w=30,h=30,file=wind_icon[9]})
out({c=0xffffff,a=1,x=1682,y=103,txt=wind_nesw[9]})
out({c=0xFF8C00,a=1,x=1676,y=141,txt=wind_km[9].." Km/h"})
-- Forecast day 10 -- x = l|r y = u|d
out({c=0x9ACD32,a=1,x=1800,y=17,txt=forecast_day_short[10]})
out({c=0x9ACD32,a=1,x=1825,y=17,txt=forecast_date[10]})
--out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1800,y=21,file=weather_icon[10]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
out({c=0x00BFFF,a=1,x=1805,y=72,txt=sun_rise_24[10]})
out({c=0xFF8C00,a=1,x=1805,y=82,txt=sun_set_24[10]})
-- UV -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=1805,y=92,txt="UV:"})
out({c=0xC0C0C0,a=1,x=1825,y=92,txt=uv_index_num[10]})
--Wind ------------------------------------------------------------------
image({x=1805,y=103,w=30,h=30,file=wind_icon[10]})
out({c=0xffffff,a=1,x=1810,y=103,txt=wind_nesw[10]})
out({c=0xFF8C00,a=1,x=1800,y=141,txt=wind_km[10].." Km/h"})
--]]
--#######################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
function get_color(ctab)
--by mrpeachy 04/2013
local function color(col)
return {((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, 1}
end
local ncol=#ctab
local val=ctab[1]
local lownum=(ctab[2])[1]
local lowcol=color((ctab[2])[2])
local highnum=(ctab[ncol])[1]
local highcol=color((ctab[ncol])[2])
if val<=lownum then
color=lowcol
elseif val>=highnum then
color=highcol
else
for i=2,ncol do
entry1=ctab[i]
entry2=ctab[i+1] or ctab[i]
lower=entry1[1]
upper=entry2[1]
if val>=lower and val<=upper then
nentry=i
end
end
ctop=color((ctab[nentry+1] or nentry)[2])
ntop=(ctab[nentry+1] or nentry)[1]
clow=color((ctab[nentry])[2])
nlow=(ctab[nentry])[1]
i1=ntop-nlow
i2=val-nlow
c1=clow[1]+((ctop[1]-clow[1])*i2/i1)
c2=clow[2]+((ctop[2]-clow[2])*i2/i1)
c3=clow[3]+((ctop[3]-clow[3])*i2/i1)
c4=clow[4]+((ctop[4]-clow[4])*i2/i1)
color={c1,c2,c3,c4}
end
ctab=nil
return color
end--function
--#############################################################################################################################################################
--##--##--thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer
function thermometer(therm)
--by mrpeachy 04/2013
local mx=therm.x or 0
local my=therm.y or 0
local tcol=therm.tcol
local temp=therm.val or 0
local label=therm.label or nil
local scale=therm.scale or 1
local units=therm.units or "F"
local font=therm.f or "Mono"
local fsize=therm.fs or "10"
local lines=therm.lines or 1
local numbers=therm.numbers or 1
therm=nil
--by mrpeachy 2011
if units=="F" then height=150 elseif units=="C" then height=160 end
local mx=mx*(1/scale)
local my=my*(1/scale)
cairo_scale (cr,scale,scale)
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,1)
--graphics outer
--bottom circle
r_outer=25
local lang_outer=335
local rang_outer=0+(360-lang_outer)
local h_outer=height-4--maybe make this a percentage?###########
cairo_arc (cr,mx,my,r_outer,(math.pi/180)*(rang_outer-90),(math.pi/180)*(lang_outer-90))
--coordinates,left line
local arc=(math.pi/180)*lang_outer
local lxo=0+r_outer*(math.sin(arc))
local lyo=0-r_outer*(math.cos(arc))
cairo_line_to (cr,mx+lxo,my+lyo-h_outer)
--coordinates,left line
local arc=(math.pi/180)*rang_outer
local rxo=0+r_outer*(math.sin(arc))
local ryo=0-r_outer*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxo+((rxo-lxo)/2),my+lyo-h_outer,(rxo-lxo)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxo+((rxo-lxo)),my+lyo)
cairo_stroke (cr)
----------------------------------------------
--graphics inner
--####################################################
if units=="F" then
cairo_set_source_rgba (cr,tcol[1],tcol[2],tcol[3],tcol[4])
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=temp+30
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if lines==1 then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=15
local lnx=mx+lxo
local lnw=(rxo-lxo)
for i=1,lnn do
lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)
if i==lnn then
lnx=lnx+2
lnw=lnw-4
end
cairo_move_to (cr,lnx,lny)
cairo_rel_line_to (cr,lnw,0)
cairo_stroke (cr)
end
end--if lines
if numbers==1 then
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=8
local lnx=mx+lxo+(rxo-lxo)+4
num={-20,"0°"..units,20,40,60,80,100,120}
for i=1,lnn do
lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label
end--if units=F
--#################################################
if units=="C" then
cairo_set_source_rgba (cr,tcol[1],tcol[2],tcol[3],tcol[4])
--cairo_set_source_rgba (cr,0,1,1,1)
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=(temp*2)+60
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if lines==1 then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=17
local lnx=mx+lxo
local lnw=(rxo-lxo)
for i=1,lnn do
lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)
if i==lnn then
lnx=lnx+2
lnw=lnw-4
end
cairo_move_to (cr,lnx,lny)
cairo_rel_line_to (cr,lnw,0)
cairo_stroke (cr)
end
end--if lines
if numbers==1 then
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=9
local lnx=mx+lxo+(rxo-lxo)+4
num={-30,-20,-10,"0°"..units,10,20,30,40,50}
for i=1,lnn do
lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label=none
end--if units=C
--#################################################
--label
if label~=nil then
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local lbx=mx+lxo-5
local lby=my-r_inner-10-((rxi-lxi)/2)
cairo_move_to (cr,lbx,lby)
cairo_rotate (cr,(math.pi/180)*(-90))
cairo_show_text (cr,label)
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(90))
--temperature readout
cairo_set_source_rgba (cr,0,0,0,1)
local text=temp.."°"..units
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,mx-(width/2),my+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end--if label
------------------------------------
cairo_scale (cr,1/scale,1/scale)
end--thermometer function
--#################################################################################################
edit ljere: je me suis permis une correction de ta balise image