Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1251 Le 11/09/2012, à 06:41

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ ragamatrix,

tu pourrais montrer tous scripts servant au conky qui bug.
je crois que le soucis vient de la variable t sur la ligne 406, qui doit contenir autre chose que des caractères.
pour vérifier il suffirait de faire ceci :

now["conditions_caps"]=t

logiquement la ligne 406 ne devrait plus poser de problème, mais sa ne réglera pas réellement le soucis.

Hors ligne

#1252 Le 11/09/2012, à 08:45

ragamatrix

Re : [Conky] Alternative à weather.com (2)

falldown a écrit :
ragamatrix a écrit :

@falldown @jpdipsy: because of Star-Trek fan
What have you done !!
It's AMAZING ! Crazy well done !:P
shot1
shot2
enterprise_conky

Je vous remercie!
Je suis un grand fan de trek.
Enterprise_conky sera bientôt chose faite.
Il est entièrement tracée à l'intérieur lua / cairo .. à l'exception du vaisseau qui est un fichier png.


@falldown

Good news cool

Hors ligne

#1253 Le 11/09/2012, à 08:50

ragamatrix

Re : [Conky] Alternative à weather.com (2)

Didier-T a écrit :

@ ragamatrix,

tu pourrais montrer tous scripts servant au conky qui bug.
je crois que le soucis vient de la variable t sur la ligne 406, qui doit contenir autre chose que des caractères.
pour vérifier il suffirait de faire ceci :

now["conditions_caps"]=t

logiquement la ligne 406 ne devrait plus poser de problème, mais sa ne réglera pas réellement le soucis.

Voici les scripts :
conkyweathercirle :

  ###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override #override
own_window_transparent yes
own_window_hints below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
#own_window_colour black
own_window_class Forecast Conky
own_window_title Forecast by MrP

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### 'own_window_type override'
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 0

minimum_size 450 0     ## width, height
maximum_width 450       ## width, usually a good idea to equal minimum width

gap_x 10        ### left &right
gap_y 10        ### up & down

alignment top_left
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
# xftfont Anonymous Pro:bold:size=9
# xftfont Unispace:size=8
# xftfont Onuava:size=8
 #xftfont Inconsolata:bold:size=10
# xftfont Andale Mono:bold:size=9
xftfont DejVu Mono:size=9


# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color grey
default_outline_color black

default_color DCDCDC #Gainsboro
color0 DAA520 #Goldenrod  FFFFF0 #Ivory
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 10
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
lua_load ~/v9000/weathercircle.lua
lua_draw_hook_pre weather #starts the lua weather data gathering function, call once at top of conkyrc



# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
top_name_width 7


TEXT
 

weathercircle .lua :

 --even more weather by mrpeachy 12/31/11
require 'cairo'
require 'imlib2'
function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end

function conky_weather()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
secs=1800--set update interval
web="http://www.intellicast.com/Local/Forecast.aspx?unit=C&location=SZXX0014"--insert unit=C& after? for C
--get web address by going to the intellicast site and entering your location in the box
--for version 3 you must get click on "Extended Forecast" to get the necessary address
--set location of weather images
weathericons="~/v9000/additional_files/weathericons/"
--set defaults
default_font="mono"--font must be in quotes
default_font_size=10
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
--#########################################################################################################
--############start of timed section#######################################################################
--#########################################################################################################
local updates=tonumber(conky_parse('${updates}'))
local timer=(updates %secs)+1
--#######################################
if timer==secs or updates==6 then--######
--#######################################
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
allweather=f:read("*a")
f:close()
if allweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
allweather=f:read("*a")
f:close()
end
if allweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
allweather=f:read("*a")
f:close()
end
allweather=string.gsub(allweather,"[\n\r]","")
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
nowweather=f:read("*a")
f:close()
if nowweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
nowweather=f:read("*a")
f:close()
end
if nowweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
nowweather=f:read("*a")
f:close()
end
nowweather=string.gsub(nowweather,"[\n\r]","")
if allweather==nil then 
allweather=""
nowweather="" 
print "error curl operation failed"
end
--intellicast to conky weather icon conversion
wimage={
wx_65="32",
wx_66="30",
wx_67="26",
wx_68="32",
wx_69="28",
wx_70="20",
wx_71="32",
wx_72="21",
wx_73="36",
wx_74="14",
wx_75="28",
wx_76="18",
wx_77="14",
wx_78="23",
wx_79="05",
wx_80="15",
wx_81="15",
wx_82="11",
wx_83="16",
wx_84="00",
wx_85="32",
wx_86="25",
wx_87="09",
wx_88="05",
wx_89="18",
wx_90="18",
wx_91="39",
wx_92="39",
wx_93="39",
wx_94="39",
wx_95="37",
wx_96="37",
wx_97="31",
wx_98="29",
wx_99="27",
wx_100="47",
wx_101="47",
wx_102="33",
wx_103="26",
wx_104="20",
wx_105="45",
wx_106="45",
wx_107="11",
wx_108="46",
wx_109="46",
wx_110="06",
wx_111="18",
wx_112="06",
wx_113="46",
wx_114="46",
wx_115="31",
wx_116="47",
}--end w image table
--convert intellicast icons to weather font
wfont={
wx_65="a",
wx_66="c",
wx_67="f",
wx_68="a",
wx_69="d",
wx_70="0",
wx_71="a",
wx_72="9",
wx_73="5",
wx_74="p",
wx_75="d",
wx_76="w",
wx_77="p",
wx_78="6",
wx_79="x",
wx_80="8",
wx_81="8",
wx_82="h",
wx_83="q",
wx_84="m",
wx_85="a",
wx_86="-",
wx_87="h",
wx_88="x",
wx_89="w",
wx_90="w",
wx_91="g",
wx_92="g",
wx_93="g",
wx_94="g",
wx_95="k",
wx_96="k",
wx_97="A",
wx_98="C",
wx_99="D",
wx_100="K",
wx_101="K",
wx_102="B",
wx_103="f",
wx_104="0",
wx_105="G",
wx_106="G",
wx_107="h",
wx_108="O",
wx_109="O",
wx_110="x",
wx_111="w",
wx_112="x",
wx_113="O",
wx_114="O",
wx_115="A",
wx_116="K",
}--end w font table
--conversion day and month tables
dayshort={Monday="Mon",Tuesday="Tue",Wednesday="Wed",Thursday="Thu",Friday="Fri",Saturday="Sat",Sunday="Sun",x=""}
monthshort={January="Jan",February="Feb",March="Mar",April="Apr",May="May",June="Jun",July="Jul",August="Aug",September="Sep",October="Oct",November="Nov",December="Dec",x=""}
moonfontt={New="=",Full="@",FirstQuarter="G",LastQuarter="T",WaningGibbous="R",WaningCrescent="V",WaxingCrescent="E",WaxingGibbous="I"}
windfontt={S="9",SSW=":",SW=";",WSW="<",W="=",WNW=">",NW="?",NNW="@",N="1",NNE="2",NE="3",ENE="4",E="5",ESE="6",SE="7",SSE="8"}
--setup tables for forecast weather
forecast_day={}
forecast_day_caps={}
forecast_day_lc={}
forecast_day_short={}
forecast_day_short_caps={}
forecast_day_short_lc={}
forecast_month={}
forecast_month_caps={}
forecast_month_lc={}
forecast_month_short={}
forecast_month_short_caps={}
forecast_month_short_lc={}
forecast_date={}
weather_icon={}
weather_font={}
high_temp={}
low_temp={}
conditions={}
conditions_caps={}
conditions_lc={}
sun_rise={}
sun_rise_lc={}
moon_rise={}
moon_rise_lc={}
sun_set={}
sun_set_lc={}
moon_set={}
moon_set_lc={}
humidity={}
precipitation={}
snow={}
cloud_cover={}
moon_phase={}
moon_phase_caps={}
moon_phase_lc={}
moon_font={}
wind_mph={}
wind_km={}
wind_kts={}
wind_direction={}
wind_font={}
wind_deg={}
wind_nesw={}
uv_index_num={}
uv_index_txt={}
uv_index_txt_caps={}
uv_index_txt_lc={}
-----------------
--extract information into tables
local start=0
local f=1
while f~=nil do
--match forecast day name and date
s,f,t=string.find(allweather,"<td colspan=\"2\"><strong>([%a,%s%d]*)</strong></td>",start)
	if t~=nil then
	--split name from month and date
	a,b,day=string.find(t,"(%a*),%s")
	a,b,month=string.find(t,",%s(%a*)%s")
	a,b,date=string.find(t,"(%d*)$")
	--ser day names, regular, caps, lowercase and short
	table.insert(forecast_day,day)
	table.insert(forecast_day_caps,string.upper(day))
	table.insert(forecast_day_lc,string.lower(day))
	table.insert(forecast_day_short,dayshort[day])
	table.insert(forecast_day_short_caps,string.upper(dayshort[day]))
	table.insert(forecast_day_short_lc,string.lower(dayshort[day]))
	--set month types
	table.insert(forecast_month,month)
	table.insert(forecast_month_caps,string.upper(month))
	table.insert(forecast_month_lc,string.lower(month))
	table.insert(forecast_month_short,monthshort[month])
	table.insert(forecast_month_short_caps,string.upper(monthshort[month]))
	table.insert(forecast_month_short_lc,string.lower(monthshort[month]))
	--set date
	table.insert(forecast_date,date)
	end
--intellicast weather icon match
s,f,t=string.find(allweather,"40_white/(wx_..).png\"",start)
--convert to conkyweather icon
	if t~=nil then
	table.insert(weather_icon,weathericons..wimage[t]..".png")
	--convert to weather font
	table.insert(weather_font,wfont[t])
	end
--match conditions
s,f,t=string.find(allweather," /><br />([%a%s/]*)</td>",start)
	if t~=nil then
	table.insert(conditions,t)
	table.insert(conditions_caps,string.upper(t))
	table.insert(conditions_lc,string.lower(t))
	end
--match high temp
s,f,t=string.find(allweather,"\"Hi\">(%d*)&deg",start)
table.insert(high_temp,t)
--match low temp
s,f,t=string.find(allweather,"\"Lo\">(%d*)&deg",start)
table.insert(low_temp,t)
--match sunrise and set-- alt="Sunrise" style="vertical-align:bottom;" /><strong>Rise:</strong> 7:19 AM</td>            <td><strong>Set:</strong> 4:54 PM</td>
--match sun rise times
s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",start)
	if t~=nil then
	table.insert(sun_rise,t)
	table.insert(sun_rise_lc,string.lower(t))
	end
--match sun set times
s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then	
	table.insert(sun_set,t)
	table.insert(sun_set_lc,string.lower(t))
	end
--moon rise
s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	table.insert(moon_rise,t)
	table.insert(moon_rise_lc,string.lower(t))
	end
--moon set
s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	table.insert(moon_set,t)
	table.insert(moon_set_lc,string.lower(t))
	end
--match uv index
s,f,tuv=string.find(allweather,"UV Index:</strong> (%d%s*%(%a*%)) <br />",start)
	if tuv~=nil then
	a,b,t=string.find(tuv,"(%d*)%s*%(%a*%)")
	table.insert(uv_index_num,t)
	a,b,t=string.find(tuv,"%d*%s*%((%a*)%)")
	table.insert(uv_index_txt,t)
	table.insert(uv_index_txt_caps,string.upper(t))
	table.insert(uv_index_txt_lc,string.lower(t))
	end
--match humidity
s,f,t=string.find(allweather,"Humidity:</strong> (%d*)<br />",start)
table.insert(humidity,t)
--match ppt
s,f,t=string.find(allweather,"Precipitation:</strong> (%d*)<br />",start)
table.insert(precipitation,t)
--match snow %
s,f,t=string.find(allweather,"Snow Probability:</strong>             (%d*)<br />",start)
table.insert(snow,t)
--match cloud coveage
s,f,t=string.find(allweather,"Cloud Coverage:</strong> (%d*)<br />",start)
table.insert(cloud_cover,t)
--match moon phase
s,f,t=string.find(allweather,"Moon Phase:</strong> ([%a%s]*) <br />",start)
--set moon phase text
	if t~= nil then
	table.insert(moon_phase,t)
	table.insert(moon_phase_caps,string.upper(t))
	table.insert(moon_phase_lc,string.lower(t))
	--set moon phase font
	mp=string.gsub(t," ","")
	table.insert(moon_font,moonfontt[mp])
	end
--match wind speeds
s,f,t=string.find(allweather,"Wind Speed:</strong> (%d*)Mph",start)
table.insert(wind_mph,t)
s,f,t=string.find(allweather,"Mph%s*%((%d*)Km,",start)
table.insert(wind_km,t)
s,f,t=string.find(allweather,"Km,%s*(%d*)Kts%)",start)
table.insert(wind_kts,t)
--match wind direction
s,f,twd=string.find(allweather,"Wind Direction:</strong> ([%d&;%s%(%a%)]*)        </div>",start)
	if twd~=nil then
	a,b,t=string.find(twd,"(%d*)&deg;")
	table.insert(wind_deg,t)
	--match wind font and nesw   
	a,b,t=string.find(twd,"%((%a*)%)")
	table.insert(wind_font,windfontt[t])
	table.insert(wind_nesw,t)
	end
if f==nil then break end
start=f
end--while
--#########################################################################################################################################
--end--of timed section
--format now weather
--extract current data
now={}
monthlong={Jan="January",Feb="February",Mar="March",Apr="April",May="May",Jun="June",Jul="July",Aug="August",Sep="September",Oct="October",Nov="November",Dec="December"}
s,f,tnow=string.find(nowweather,"<div style=\"float:right;color:#666;\">  As of ([%d%p%a%s]*) %(Local Time%)")
s,f,t=string.find(tnow,"(%d*%p%d*%s%a*) on")
now["time"]=t
now["time_lc"]=string.lower(t)
s,f,t=string.find(tnow,"on (%a*)%s%d*")
now["day"]=t
now["day_caps"]=string.upper(t)
now["day_lc"]=string.lower(t)
ds=dayshort[t]
now["day_short"]=ds
now["day_short_caps"]=string.upper(ds)
now["day_short_lc"]=string.lower(ds)
s,f,t=string.find(tnow,"%s(%d%d)%s")
now["date"]=t
s,f,t=string.find(tnow,"%d%d%s(%a*)%s%d")
now["month_short"]=t
now["month_short_caps"]=string.upper(t)
now["month_short_lc"]=string.lower(t)
ml=monthlong[t]
now["month"]=ml
now["month_caps"]=string.upper(ml)
now["month_lc"]=string.lower(ml)
s,f,t=string.find(tnow,"%a%a%a%s(%d%d%d%d)")
now["year"]=t
s,f,t=string.find(nowweather,"40_white/(wx_%d%d).png")
now["weather_icon"]=weathericons..wimage[t]..".png"
now["weather_font"]=wfont[t]
s,f,t=string.find(nowweather,"class=\"Icon\" /> (%a*)%s*</td>")
now["conditions"]=t
now["conditions_caps"]=string.upper(t)
now["conditions_lc"]=string.lower(t)
s,f,t=string.find(nowweather,"Temperature\">([%p%d]*)&deg")
now["temp"]=t
s,f,t=string.find(nowweather,">Feels Like: ([%p%d]*)&deg;</a>")
now["feels_like"]=t
s,f,t=string.find(nowweather,">Wind Chill: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["wind_chill"]=t
s,f,t=string.find(nowweather,">Ceiling: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
s,f,t=string.find(t,"(%d*)")
t=t.." mi"
end
now["ceiling"]=t
now["ceiling_caps"]=string.upper(t)
now["ceiling_lc"]=string.lower(t)
s,f,t=string.find(nowweather,">Heat Index: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["heat_index"]=t
s,f,t=string.find(nowweather,">Visibility: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
s,f,t=string.find(t,"(%d*)")
t=t.." mi"
end
now["visibility"]=t
now["visibility_caps"]=string.upper(t)
s,f,t=string.find(nowweather,">Dew Point: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["dew_point"]=t
s,f,t=string.find(nowweather,">Wind: </a></td>%s*<td>(%d*)mph</td>")
now["wind_mph"]=t.." mph"
s,f,t=string.find(nowweather,">Humidity: </a></td>%s*<td>(%d*)</td>")
now["humidity"]=t
s,f,twd=string.find(nowweather,">Direction: </a></td>%s*<td style=[%p%a]*>([%d&;%s%(%a%)]*)</td>%s*</tr>")
a,b,t=string.find(twd,"(%d*)&deg;")
now["wind_deg"]=t
a,b,t=string.find(twd,"%((%a*)%)")
now["wind_nesw"]=t
now["wind_font"]=windfontt[t]
s,f,t=string.find(nowweather,">Pressure: </a></td>%s*<td>([%d%p]*)\"</td>")
now["pressure"]=t
s,f,t=string.find(nowweather,">Gusts: </a></td>%s*<td>([%d%a]*)</td>")
if t~="NA" then
s,f,t=string.find(t,"(%d*)")
t=t.." mph"
end
now["wind_gusts"]=t
now["wind_gusts_caps"]=string.upper(t)
--###############end of data processing########################
--###########################
end--of timed section########
--###########################
--write lines here to show in conky
--these tables hold the top left coordinates for each repeat as set lower, do not edit
top_left_x_coordinate={}
top_left_y_coordinate={}
--write settings, c=color,a=alpha,f=font,fs=font size,x=x position, y=y position, txt=text or data to show
--eg out({c=0xffff00,a=1,f="Sans",fs=14,x=100,y=100,txt="hello world"})
--image settings, x=top left x position, y=top left y position, w=width of image(0=full size), h=height(0=full size),file=file location
--eg image({x=0,y=35,w=60,h=60,file=now[weather_icon]})
--########################################################
--######### write or paste setups below ##################
--########################################################
midx=160
midy=160
radouter=150
radinner=50
radforecast=90
radhilo=125
radfctxt=130
radcond=110
radsmall=25
fcangle1=0
fcangle2=45
fcangle3=90
fcangle4=135
fcangle5=180
wcr,wcg,wcb,wca=1,1,1,0.3
---------------------------------------------
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
--draw outer circle
cairo_arc (cr,midx,midy,radouter,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
--draw inner circle
cairo_arc (cr,midx,midy,radinner,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
--draw forecast line and text
astr=270
aend=350
cairo_arc (cr,midx,midy,radfctxt,(math.pi/180)*(astr-90),(math.pi/180)*(aend-90))
cairo_stroke (cr)
cwt={text="FORECAST ",font="mono",fsize=16,radius=radfctxt+3,xpos=midx,ypos=midy,position=1,start=astr,finish=aend,justify=1,letterdeg=5,};cw(cwt)
--set start and end angle for conditions box
astr=205
aend=335
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
cairo_arc (cr,midx,midy,radcond,(math.pi/180)*(astr-90),(math.pi/180)*(aend-90))
cairo_stroke (cr)
cwt={text="CURRENT CONDITIONS ",font="mono",fsize=14,radius=radcond+3,xpos=midx,ypos=midy,position=1,start=astr,finish=aend,justify=1,letterdeg=5,};cw(cwt)
--print current temps
trad=radcond-16
cwt={text="TMP: "..now["temp"].."F / FL: "..now["feels_like"].."F ",font="mono",fsize=14,radius=trad,xpos=midx,ypos=midy,position=2,start=astr+5,finish=aend-5,justify=1,letterdeg=5.5,};cw(cwt)
--print current conditions wrap to length
--wrap settings
line_text=now["conditions_caps"]
max_string_len=16
indent=""
clines=to_lines(line_text,max_string_len,indent)
--set radius for conditions lines (shouldnt need more than 2)
crad1=trad-16
crad2=crad1-16
cwt={text=clines[1],font="mono",fsize=14,radius=crad1,xpos=midx,ypos=midy,position=2,start=astr+5,finish=aend-10,justify=1,letterdeg=7,};cw(cwt)
cwt={text=clines[2],font="mono",fsize=14,radius=crad2,xpos=midx,ypos=midy,position=1,start=astr+5,finish=aend-10,justify=1,letterdeg=8,};cw(cwt)
--connect lines to form curent box
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*astr
xs1=0+radcond*(math.sin(arc))
ys1=0-radcond*(math.cos(arc))
arc=(math.pi/180)*astr
xe1=0+radinner*(math.sin(arc))
ye1=0-radinner*(math.cos(arc))
cairo_move_to (cr,midx+xs1,midy+ys1)
cairo_line_to (cr,midx+xe1,midy+ye1)
cairo_stroke (cr)
arc=(math.pi/180)*aend
xs2=0+radcond*(math.sin(arc))
ys2=0-radcond*(math.cos(arc))
arc=(math.pi/180)*aend
xe2=0+radinner*(math.sin(arc))
ye2=0-radinner*(math.cos(arc))
cairo_move_to (cr,midx+xs2,midy+ys2)
cairo_line_to (cr,midx+xe2,midy+ye2)
cairo_stroke (cr)
--individual fc circles and forecast data
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle1
xfc1=0+radforecast*(math.sin(arc))
yfc1=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc1,midy+yfc1,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
radst=14
	arc=(math.pi/180)*fcangle1
	xfc1hl=0+(radsmall+radst)*(math.sin(arc))
	yfc1hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc1hl+xfc1,y=midy+yfc1hl+yfc1,txt=forecast_day_short_caps[1]})
	out({x=midx+xfc1hl+xfc1,y=midy+yfc1hl+yfc1+12,txt=high_temp[1].."F|"..low_temp[1].."F"})
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle2
xfc2=0+radforecast*(math.sin(arc))
yfc2=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc2,midy+yfc2,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle2
	xfc2hl=0+(radsmall+radst)*(math.sin(arc))
	yfc2hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc2hl+xfc2,y=midy+yfc2hl+yfc2,txt=forecast_day_short_caps[2]})
	out({x=midx+xfc2hl+xfc2,y=midy+yfc2hl+yfc2+12,txt=high_temp[2].."F|"..low_temp[2].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle3
xfc3=0+radforecast*(math.sin(arc))
yfc3=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc3,midy+yfc3,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle3
	xfc3hl=0+(radsmall+radst)*(math.sin(arc))
	yfc3hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc3hl+xfc3,y=midy+yfc3hl+yfc3,txt=forecast_day_short_caps[3]})
	out({x=midx+xfc3hl+xfc3,y=midy+yfc3hl+yfc3+12,txt=high_temp[3].."F|"..low_temp[3].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle4
xfc4=0+radforecast*(math.sin(arc))
yfc4=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc4,midy+yfc4,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle4
	xfc4hl=0+(radsmall+radst)*(math.sin(arc))
	yfc4hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc4hl+xfc4,y=midy+yfc4hl+yfc4,txt=forecast_day_short_caps[4]})
	out({x=midx+xfc4hl+xfc4,y=midy+yfc4hl+yfc4+12,txt=high_temp[4].."F|"..low_temp[4].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle5
xfc5=0+radforecast*(math.sin(arc))
yfc5=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc5,midy+yfc5,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle5
	xfc5hl=0+(radsmall+radst)*(math.sin(arc))
	yfc5hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc5hl+xfc5,y=midy+yfc5hl+yfc5,txt=forecast_day_short_caps[5]})
	out({x=midx+xfc5hl+xfc5,y=midy+yfc5hl+yfc5+12,txt=high_temp[5].."F|"..low_temp[5].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
--show weather icons
imsizel=80
image({x=midx-imsizel,y=midy-imsizel,w=imsizel,h=imsizel,file=now["weather_icon"]})
imsizes=50
image({x=midx+xfc1-imsizes,y=midy+yfc1-imsizes,w=imsizes,h=imsizes,file=weather_icon[1]})
image({x=midx+xfc2-imsizes,y=midy+yfc2-imsizes,w=imsizes,h=imsizes,file=weather_icon[2]})
image({x=midx+xfc3-imsizes,y=midy+yfc3-imsizes,w=imsizes,h=imsizes,file=weather_icon[3]})
image({x=midx+xfc4-imsizes,y=midy+yfc4-imsizes,w=imsizes,h=imsizes,file=weather_icon[4]})
image({x=midx+xfc5-imsizes,y=midy+yfc5-imsizes,w=imsizes,h=imsizes,file=weather_icon[5]})
--#########################################################
--########## end of current conditions ####################
--######### forecast weather and repeat ###################
--#########################################################
--enter number of forecast days to show
number_of_days=8
--enter coordinates of top left corner for each day
top_left_x_coordinate[1],top_left_y_coordinate[1]=270,15
top_left_x_coordinate[2],top_left_y_coordinate[2]=540,15
top_left_x_coordinate[3],top_left_y_coordinate[3]=0,190
top_left_x_coordinate[4],top_left_y_coordinate[4]=270,190
top_left_x_coordinate[5],top_left_y_coordinate[5]=540,190
top_left_x_coordinate[6],top_left_y_coordinate[6]=0,370
top_left_x_coordinate[7],top_left_y_coordinate[7]=270,370
top_left_x_coordinate[8],top_left_y_coordinate[8]=540,370
------------------------
for i=1,number_of_days do--start of day repeat, do not edit
tlx=top_left_x_coordinate[i]--sets top left position for each repeat
tly=top_left_y_coordinate[i]--sets top left position for each repeat
--write day format below, write x and y relative to top left coordinates as in the example
--write i to call day as this will be replaced with the day number for each repeat

end--of day repeat, do not edit
--##############################################################
--############## end of weather display setup ##################
--##############################################################

end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

function out(tx)
color=nil
color=tx.c
if color==nil then color=default_color end
alpha=nil
alpha=tx.a
if alpha==nil then alpha=default_alpha end
font=nil
font=tx.f
if font==nil then font=default_font end
fsize=nil
fsize=tx.fs
if fsize==nil then fsize=default_font_size end
xpos=nil
xpos=tx.x
if xpos==nil then xpos=0 end
ypos=nil
ypos=tx.y
if ypos==nil then ypos=0 end
text=nil
text=tx.txt
if text==nil then text="hello world" end
local function col(c)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,alpha
end--local function
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,col(color))
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
cairo_stroke (cr)
end--function out

function image(im)
x=nil
x=im.x
if x==nil then x=0 end
y=nil
y=im.y
if y==nil then y=0 end
w=nil
w=im.w
if w==nil then w=default_image_width end
h=nil
h=im.h
if h==nil then h=default_image_height end
file=nil
file=tostring(im.file)
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(w)
end
if tonumber(h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(h)
end
local iacross=x+(width/2)
local idown=y+(height/2)
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(iacross, idown)
imlib_free_image()
show=nil
end--function image

function cw(t)
--set variables and defualts
if t.text==nil then text="" else text=t.text end
if t.font==nil then font="mono" else font=t.font end
if t.fsize==nil then fsize=12 else fsize=t.fsize end
if t.radius==nil then radius=50 else radius=t.radius end
if t.xpos==nil then xpos=100 else xpos=t.xpos end
if t.ypos==nil then ypos=100 else ypos=t.ypos end
if t.position==nil then position=1 else position=t.position end
if t.start==nil then start=270 else start=t.start end
if t.finish==nil then finish=90 else finish=t.finish end
if t.justify==nil then justify=1 else justify=t.justify end
if t.letterdeg==nil then letterdeg=5 else letterdeg=t.letterdeg end
--end variables
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,1,1,1,1);
if finish<start then finish=finish+360 end
local inum=string.len(text)
---------------------------
if position==1 then
deg=(finish-start)/(inum-1)
elseif position==2 then
deg=letterdeg
	if justify==1 then
	start=start	
	elseif justify==2 then
	start=start-((letterdeg*inum)/2)
	elseif justify==3 then 
	start=start-(letterdeg*inum)
	end
end
----------------------------
local degrads=(math.pi/180)
local textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
for i=1,inum do
interval=(degrads*(start+(deg*(i-1))))
txs=0+radius*(math.sin(interval))
tys=0-radius*(math.cos(interval))
cairo_move_to (cr, txs+xpos, tys+ypos);
cairo_rotate (cr, interval)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval)
end
end--circlewriting
function cwd(t)
--set variables and defualts
if t.text==nil then text="" else text=t.text end
if t.font==nil then font="mono" else font=t.font end
if t.fsize==nil then fsize=12 else fsize=t.fsize end
if t.radius==nil then radius=50 else radius=t.radius end
if t.xpos==nil then xpos=100 else xpos=t.xpos end
if t.ypos==nil then ypos=100 else ypos=t.ypos end
if t.position==nil then position=1 else position=t.position end
if t.start==nil then start=270 else start=t.start end
if t.finish==nil then finish=90 else finish=t.finish end
if t.justify==nil then justify=1 else justify=t.justify end
if t.letterdeg==nil then letterdeg=5 else letterdeg=t.letterdeg end
--end variables
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,1,1,1,1);
if start<finish then start=start+360 end
local inum=string.len(text)
---------------------------
if position==1 then
deg=(start-finish)/(inum-1)
elseif position==2 then
deg=letterdeg
	if justify==1 then
	start=start	
	elseif justify==2 then
	start=start+((letterdeg*inum)/2)
	elseif justify==3 then 
	start=start+(letterdeg*inum)
	end
end
----------------------------
local degrads=(math.pi/180)
local textcut=string.gsub(text, ".", "%1<>")
texttable=string.split(textcut, "<>")
for i=1,inum do
interval=(degrads*(start-(deg*(i-1))))
txs=0+radius*(math.sin(interval))
tys=0-radius*(math.cos(interval))
cairo_move_to (cr, txs+xpos, tys+ypos);
cairo_rotate (cr, interval+(math.pi))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -1*(interval+(math.pi)))
end
end--cwd 

function to_lines(line_text,max_string_len,indent)
---------------------------------------------
--set defaults for function
local default_max_length=50
local default indent=""
---------------------------------------------
if indent==nil then indent=default_indent end
if max_string_len==nil then max_string_len=default_max_length end
local i=1
text_table={line_text}
while text_table[i]~=nil do
if max_string==nil then max_string=max_string_len end
local v=text_table[i]
	if string.len(v)>max_string_len and string.find(v," ")~=nil and string.find(string.sub(v,1,max_string)," ")~=nil then
	long=string.len(v)
	splitcha=string.sub(v,max_string,max_string)	
		if splitcha~=" " then		
			while splitcha~=" " do
				if max_string>1 then
				max_string=max_string-1
				splitcha=string.sub(v,max_string,max_string)
				else
				splitcha=" "
				end
			end
		end
		local insertit=tostring(indent..string.sub(v,max_string+1,long))
		table.insert(text_table,i+1,insertit)
		text_table[i]=tostring(string.sub(v,1,max_string-1))	
	elseif string.len(v)>max_string_len and string.find(v," ")~=nil and string.find(string.sub(v,1,max_string)," ")==nil then
	long=string.len(v)
	splitcha=string.sub(v,max_string,max_string)		
		while splitcha~=" " do
			if max_string<long then
			max_string=max_string+1
			splitcha=string.sub(v,max_string,max_string)
			else
			splitcha=" "
			end
		end
		local insertit=tostring(indent..string.sub(v,max_string+1,long))
		table.insert(text_table,i+1,insertit)
		text_table[i]=tostring(string.sub(v,1,max_string-1))	
	end
i=i+1
max_string=max_string_len
end
return text_table
end--function  

Merci à tous smile

Hors ligne

#1254 Le 11/09/2012, à 10:02

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ ragamatrix,

Le problème ce situe au niveau de ce patern, qui ne renvoi rien, seul soucis je ne suis pas du tous alaise avec les patern
ligne 405

s,f,t=string.find(nowweather,"class=\"Icon\" /> (%a*)%s*</td>")

Hors ligne

#1255 Le 11/09/2012, à 10:17

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Didier-T
Merci quand-même de te pencher sur ce script; peut-être allons nous avoir de l'aide de falldown wink
Je n'ai malheureusement pas un grand pouvoir sur les résolutions de bugs dans les scripts lua...:rolleyes:

Hors ligne

#1256 Le 11/09/2012, à 16:48

Didier-T

Re : [Conky] Alternative à weather.com (2)

ragamatrix a écrit :

@Didier-T
Merci quand-même de te pencher sur ce script; peut-être allons nous avoir de l'aide de falldown wink
Je n'ai malheureusement pas un grand pouvoir sur les résolutions de bugs dans les scripts lua...:rolleyes:

C'est l’occasion pour moi d’apprendre à me servir un peut des patterns, sa pourrais être très intéressent si je me re-penche sur le script météo.

au fait, je crois avoir trouvé l'erreur, je vérifie sa ce soir en rentrant et si c'est bon je post.

Hors ligne

#1257 Le 11/09/2012, à 18:58

falldown

Re : [Conky] Alternative à weather.com (2)

Vous messieurs travaillent bien ensemble "Comme une machine bien huilée": D

Hors ligne

#1258 Le 11/09/2012, à 19:17

Didier-T

Re : [Conky] Alternative à weather.com (2)

@ ragamatrix,

Voici le script corrigé, il s'agissait bien du pattern

la ligne corrigé donne ceci

s,f,t=string.find(nowweather,"class=\"Icon\" /> (%a*(%s%a*))%s*</td>")

pour info a l'origine cette commande cherchait un mot compris entre class="Icon" /> et plusieurs espaces </td>
le soucis est que l'info qu'il trouvait était Broken Clouds, donc un mot, un espace, un mot.
la modification que j'ai fais dit de chercher un mot seul ou un mot, un espace, un mot.
Voila pour la minute éducative.

weathercircle.lua

--even more weather by mrpeachy 12/31/11
require 'cairo'
require 'imlib2'
function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end

function conky_weather()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
local home = os.getenv("HOME")
--#########################################################################################################
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
secs=1800--set update interval
web="http://www.intellicast.com/Local/Forecast.aspx?unit=C&location=SZXX0014"--insert unit=C& after? for C
--get web address by going to the intellicast site and entering your location in the box
--for version 3 you must get click on "Extended Forecast" to get the necessary address
--set location of weather images
weathericons="~/v9000/additional_files/weathericons/"
weathericons=string.gsub(weathericons, "~", home)
--set defaults
default_font="mono"--font must be in quotes
default_font_size=10
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
--#########################################################################################################
--############start of timed section#######################################################################
--#########################################################################################################
local updates=tonumber(conky_parse('${updates}'))
local timer=(updates %secs)+1
--#######################################
if timer==secs or updates==6 then--######
--#######################################
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
allweather=f:read("*a")
f:close()
if allweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
allweather=f:read("*a")
f:close()
end
if allweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
allweather=f:read("*a")
f:close()
end
allweather=string.gsub(allweather,"[\n\r]","")
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
nowweather=f:read("*a")
f:close()
if nowweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
nowweather=f:read("*a")
f:close()
end
if nowweather==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/climatix/v9000/weather.txt")
nowweather=f:read("*a")
f:close()
end
nowweather=string.gsub(nowweather,"[\n\r]","")
if allweather==nil then 
allweather=""
nowweather="" 
print "error curl operation failed"
end
--intellicast to conky weather icon conversion
wimage={
wx_65="32",
wx_66="30",
wx_67="26",
wx_68="32",
wx_69="28",
wx_70="20",
wx_71="32",
wx_72="21",
wx_73="36",
wx_74="14",
wx_75="28",
wx_76="18",
wx_77="14",
wx_78="23",
wx_79="05",
wx_80="15",
wx_81="15",
wx_82="11",
wx_83="16",
wx_84="00",
wx_85="32",
wx_86="25",
wx_87="09",
wx_88="05",
wx_89="18",
wx_90="18",
wx_91="39",
wx_92="39",
wx_93="39",
wx_94="39",
wx_95="37",
wx_96="37",
wx_97="31",
wx_98="29",
wx_99="27",
wx_100="47",
wx_101="47",
wx_102="33",
wx_103="26",
wx_104="20",
wx_105="45",
wx_106="45",
wx_107="11",
wx_108="46",
wx_109="46",
wx_110="06",
wx_111="18",
wx_112="06",
wx_113="46",
wx_114="46",
wx_115="31",
wx_116="47",
}--end w image table
--convert intellicast icons to weather font
wfont={
wx_65="a",
wx_66="c",
wx_67="f",
wx_68="a",
wx_69="d",
wx_70="0",
wx_71="a",
wx_72="9",
wx_73="5",
wx_74="p",
wx_75="d",
wx_76="w",
wx_77="p",
wx_78="6",
wx_79="x",
wx_80="8",
wx_81="8",
wx_82="h",
wx_83="q",
wx_84="m",
wx_85="a",
wx_86="-",
wx_87="h",
wx_88="x",
wx_89="w",
wx_90="w",
wx_91="g",
wx_92="g",
wx_93="g",
wx_94="g",
wx_95="k",
wx_96="k",
wx_97="A",
wx_98="C",
wx_99="D",
wx_100="K",
wx_101="K",
wx_102="B",
wx_103="f",
wx_104="0",
wx_105="G",
wx_106="G",
wx_107="h",
wx_108="O",
wx_109="O",
wx_110="x",
wx_111="w",
wx_112="x",
wx_113="O",
wx_114="O",
wx_115="A",
wx_116="K",
}--end w font table
--conversion day and month tables
dayshort={Monday="Mon",Tuesday="Tue",Wednesday="Wed",Thursday="Thu",Friday="Fri",Saturday="Sat",Sunday="Sun",x=""}
monthshort={January="Jan",February="Feb",March="Mar",April="Apr",May="May",June="Jun",July="Jul",August="Aug",September="Sep",October="Oct",November="Nov",December="Dec",x=""}
moonfontt={New="=",Full="@",FirstQuarter="G",LastQuarter="T",WaningGibbous="R",WaningCrescent="V",WaxingCrescent="E",WaxingGibbous="I"}
windfontt={S="9",SSW=":",SW=";",WSW="<",W="=",WNW=">",NW="?",NNW="@",N="1",NNE="2",NE="3",ENE="4",E="5",ESE="6",SE="7",SSE="8"}
--setup tables for forecast weather
forecast_day={}
forecast_day_caps={}
forecast_day_lc={}
forecast_day_short={}
forecast_day_short_caps={}
forecast_day_short_lc={}
forecast_month={}
forecast_month_caps={}
forecast_month_lc={}
forecast_month_short={}
forecast_month_short_caps={}
forecast_month_short_lc={}
forecast_date={}
weather_icon={}
weather_font={}
high_temp={}
low_temp={}
conditions={}
conditions_caps={}
conditions_lc={}
sun_rise={}
sun_rise_lc={}
moon_rise={}
moon_rise_lc={}
sun_set={}
sun_set_lc={}
moon_set={}
moon_set_lc={}
humidity={}
precipitation={}
snow={}
cloud_cover={}
moon_phase={}
moon_phase_caps={}
moon_phase_lc={}
moon_font={}
wind_mph={}
wind_km={}
wind_kts={}
wind_direction={}
wind_font={}
wind_deg={}
wind_nesw={}
uv_index_num={}
uv_index_txt={}
uv_index_txt_caps={}
uv_index_txt_lc={}
-----------------
--extract information into tables
local start=0
local f=1
while f~=nil do
--match forecast day name and date
s,f,t=string.find(allweather,"<td colspan=\"2\"><strong>([%a,%s%d]*)</strong></td>",start)
	if t~=nil then
	--split name from month and date
	a,b,day=string.find(t,"(%a*),%s")
	a,b,month=string.find(t,",%s(%a*)%s")
	a,b,date=string.find(t,"(%d*)$")
	--ser day names, regular, caps, lowercase and short
	table.insert(forecast_day,day)
	table.insert(forecast_day_caps,string.upper(day))
	table.insert(forecast_day_lc,string.lower(day))
	table.insert(forecast_day_short,dayshort[day])
	table.insert(forecast_day_short_caps,string.upper(dayshort[day]))
	table.insert(forecast_day_short_lc,string.lower(dayshort[day]))
	--set month types
	table.insert(forecast_month,month)
	table.insert(forecast_month_caps,string.upper(month))
	table.insert(forecast_month_lc,string.lower(month))
	table.insert(forecast_month_short,monthshort[month])
	table.insert(forecast_month_short_caps,string.upper(monthshort[month]))
	table.insert(forecast_month_short_lc,string.lower(monthshort[month]))
	--set date
	table.insert(forecast_date,date)
	end
--intellicast weather icon match
s,f,t=string.find(allweather,"40_white/(wx_..).png\"",start)
--convert to conkyweather icon
	if t~=nil then
	table.insert(weather_icon,weathericons..wimage[t]..".png")
	--convert to weather font
	table.insert(weather_font,wfont[t])
	end
--match conditions
s,f,t=string.find(allweather," /><br />([%a%s/]*)</td>",start)
	if t~=nil then
	table.insert(conditions,t)
	table.insert(conditions_caps,string.upper(t))
	table.insert(conditions_lc,string.lower(t))
	end
--match high temp
s,f,t=string.find(allweather,"\"Hi\">(%d*)&deg",start)
table.insert(high_temp,t)
--match low temp
s,f,t=string.find(allweather,"\"Lo\">(%d*)&deg",start)
table.insert(low_temp,t)
--match sunrise and set-- alt="Sunrise" style="vertical-align:bottom;" /><strong>Rise:</strong> 7:19 AM</td>            <td><strong>Set:</strong> 4:54 PM</td>
--match sun rise times
s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",start)
	if t~=nil then
	table.insert(sun_rise,t)
	table.insert(sun_rise_lc,string.lower(t))
	end
--match sun set times
s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then	
	table.insert(sun_set,t)
	table.insert(sun_set_lc,string.lower(t))
	end
--moon rise
s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	table.insert(moon_rise,t)
	table.insert(moon_rise_lc,string.lower(t))
	end
--moon set
s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	table.insert(moon_set,t)
	table.insert(moon_set_lc,string.lower(t))
	end
--match uv index
s,f,tuv=string.find(allweather,"UV Index:</strong> (%d%s*%(%a*%)) <br />",start)
	if tuv~=nil then
	a,b,t=string.find(tuv,"(%d*)%s*%(%a*%)")
	table.insert(uv_index_num,t)
	a,b,t=string.find(tuv,"%d*%s*%((%a*)%)")
	table.insert(uv_index_txt,t)
	table.insert(uv_index_txt_caps,string.upper(t))
	table.insert(uv_index_txt_lc,string.lower(t))
	end
--match humidity
s,f,t=string.find(allweather,"Humidity:</strong> (%d*)<br />",start)
table.insert(humidity,t)
--match ppt
s,f,t=string.find(allweather,"Precipitation:</strong> (%d*)<br />",start)
table.insert(precipitation,t)
--match snow %
s,f,t=string.find(allweather,"Snow Probability:</strong>             (%d*)<br />",start)
table.insert(snow,t)
--match cloud coveage
s,f,t=string.find(allweather,"Cloud Coverage:</strong> (%d*)<br />",start)
table.insert(cloud_cover,t)
--match moon phase
s,f,t=string.find(allweather,"Moon Phase:</strong> ([%a%s]*) <br />",start)
--set moon phase text
	if t~= nil then
	table.insert(moon_phase,t)
	table.insert(moon_phase_caps,string.upper(t))
	table.insert(moon_phase_lc,string.lower(t))
	--set moon phase font
	mp=string.gsub(t," ","")
	table.insert(moon_font,moonfontt[mp])
	end
--match wind speeds
s,f,t=string.find(allweather,"Wind Speed:</strong> (%d*)Mph",start)
table.insert(wind_mph,t)
s,f,t=string.find(allweather,"Mph%s*%((%d*)Km,",start)
table.insert(wind_km,t)
s,f,t=string.find(allweather,"Km,%s*(%d*)Kts%)",start)
table.insert(wind_kts,t)
--match wind direction
s,f,twd=string.find(allweather,"Wind Direction:</strong> ([%d&;%s%(%a%)]*)        </div>",start)
	if twd~=nil then
	a,b,t=string.find(twd,"(%d*)&deg;")
	table.insert(wind_deg,t)
	--match wind font and nesw   
	a,b,t=string.find(twd,"%((%a*)%)")
	table.insert(wind_font,windfontt[t])
	table.insert(wind_nesw,t)
	end
if f==nil then break end
start=f
end--while
--#########################################################################################################################################
--end--of timed section
--format now weather
--extract current data
now={}
monthlong={Jan="January",Feb="February",Mar="March",Apr="April",May="May",Jun="June",Jul="July",Aug="August",Sep="September",Oct="October",Nov="November",Dec="December"}
s,f,tnow=string.find(nowweather,"<div style=\"float:right;color:#666;\">  As of ([%d%p%a%s]*) %(Local Time%)")
s,f,t=string.find(tnow,"(%d*%p%d*%s%a*) on")
now["time"]=t
now["time_lc"]=string.lower(t)
s,f,t=string.find(tnow,"on (%a*)%s%d*")
now["day"]=t
now["day_caps"]=string.upper(t)
now["day_lc"]=string.lower(t)
ds=dayshort[t]
now["day_short"]=ds
now["day_short_caps"]=string.upper(ds)
now["day_short_lc"]=string.lower(ds)
s,f,t=string.find(tnow,"%s(%d%d)%s")
now["date"]=t
s,f,t=string.find(tnow,"%d%d%s(%a*)%s%d")
now["month_short"]=t
now["month_short_caps"]=string.upper(t)
now["month_short_lc"]=string.lower(t)
ml=monthlong[t]
now["month"]=ml
now["month_caps"]=string.upper(ml)
now["month_lc"]=string.lower(ml)
s,f,t=string.find(tnow,"%a%a%a%s(%d%d%d%d)")
now["year"]=t
s,f,t=string.find(nowweather,"40_white/(wx_%d%d(%d)).png")
now["weather_icon"]=weathericons..wimage[t]..".png"
now["weather_font"]=wfont[t]
s,f,t=string.find(nowweather,"class=\"Icon\" /> (%a*(%s%a*))%s*</td>")
now["conditions"]=t
now["conditions_caps"]=string.upper(t)
now["conditions_lc"]=string.lower(t)
s,f,t=string.find(nowweather,"Temperature\">([%p%d]*)&deg")
now["temp"]=t
s,f,t=string.find(nowweather,">Feels Like: ([%p%d]*)&deg;</a>")
now["feels_like"]=t
s,f,t=string.find(nowweather,">Wind Chill: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["wind_chill"]=t
s,f,t=string.find(nowweather,">Ceiling: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
s,f,t=string.find(t,"(%d*)")
t=t.." mi"
end
now["ceiling"]=t
now["ceiling_caps"]=string.upper(t)
now["ceiling_lc"]=string.lower(t)
s,f,t=string.find(nowweather,">Heat Index: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["heat_index"]=t
s,f,t=string.find(nowweather,">Visibility: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
s,f,t=string.find(t,"(%d*)")
t=t.." mi"
end
now["visibility"]=t
now["visibility_caps"]=string.upper(t)
s,f,t=string.find(nowweather,">Dew Point: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["dew_point"]=t
s,f,t=string.find(nowweather,">Wind: </a></td>%s*<td>(%d*)mph</td>")
now["wind_mph"]=t.." mph"
s,f,t=string.find(nowweather,">Humidity: </a></td>%s*<td>(%d*)</td>")
now["humidity"]=t
s,f,twd=string.find(nowweather,">Direction: </a></td>%s*<td style=[%p%a]*>([%d&;%s%(%a%)]*)</td>%s*</tr>")
a,b,t=string.find(twd,"(%d*)&deg;")
now["wind_deg"]=t
a,b,t=string.find(twd,"%((%a*)%)")
now["wind_nesw"]=t
now["wind_font"]=windfontt[t]
s,f,t=string.find(nowweather,">Pressure: </a></td>%s*<td>([%d%p]*)\"</td>")
now["pressure"]=t
s,f,t=string.find(nowweather,">Gusts: </a></td>%s*<td>([%d%a]*)</td>")
if t~="NA" then
s,f,t=string.find(t,"(%d*)")
t=t.." mph"
end
now["wind_gusts"]=t
now["wind_gusts_caps"]=string.upper(t)
--###############end of data processing########################
--###########################
end--of timed section########
--###########################
--write lines here to show in conky
--these tables hold the top left coordinates for each repeat as set lower, do not edit
top_left_x_coordinate={}
top_left_y_coordinate={}
--write settings, c=color,a=alpha,f=font,fs=font size,x=x position, y=y position, txt=text or data to show
--eg out({c=0xffff00,a=1,f="Sans",fs=14,x=100,y=100,txt="hello world"})
--image settings, x=top left x position, y=top left y position, w=width of image(0=full size), h=height(0=full size),file=file location
--eg image({x=0,y=35,w=60,h=60,file=now[weather_icon]})
--########################################################
--######### write or paste setups below ##################
--########################################################
midx=160
midy=160
radouter=150
radinner=50
radforecast=90
radhilo=125
radfctxt=130
radcond=110
radsmall=25
fcangle1=0
fcangle2=45
fcangle3=90
fcangle4=135
fcangle5=180
wcr,wcg,wcb,wca=1,1,1,0.3
---------------------------------------------
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
--draw outer circle
cairo_arc (cr,midx,midy,radouter,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
--draw inner circle
cairo_arc (cr,midx,midy,radinner,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
--draw forecast line and text
astr=270
aend=350
cairo_arc (cr,midx,midy,radfctxt,(math.pi/180)*(astr-90),(math.pi/180)*(aend-90))
cairo_stroke (cr)
cwt={text="FORECAST ",font="mono",fsize=16,radius=radfctxt+3,xpos=midx,ypos=midy,position=1,start=astr,finish=aend,justify=1,letterdeg=5,};cw(cwt)
--set start and end angle for conditions box
astr=205
aend=335
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
cairo_arc (cr,midx,midy,radcond,(math.pi/180)*(astr-90),(math.pi/180)*(aend-90))
cairo_stroke (cr)
cwt={text="CURRENT CONDITIONS ",font="mono",fsize=14,radius=radcond+3,xpos=midx,ypos=midy,position=1,start=astr,finish=aend,justify=1,letterdeg=5,};cw(cwt)
--print current temps
trad=radcond-16
cwt={text="TMP: "..now["temp"].."F / FL: "..now["feels_like"].."F ",font="mono",fsize=14,radius=trad,xpos=midx,ypos=midy,position=2,start=astr+5,finish=aend-5,justify=1,letterdeg=5.5,};cw(cwt)
--print current conditions wrap to length
--wrap settings
line_text=now["conditions_caps"]
max_string_len=16
indent=""
clines=to_lines(line_text,max_string_len,indent)
--set radius for conditions lines (shouldnt need more than 2)
crad1=trad-16
crad2=crad1-16
cwt={text=clines[1],font="mono",fsize=14,radius=crad1,xpos=midx,ypos=midy,position=2,start=astr+5,finish=aend-10,justify=1,letterdeg=7,};cw(cwt)
cwt={text=clines[2],font="mono",fsize=14,radius=crad2,xpos=midx,ypos=midy,position=1,start=astr+5,finish=aend-10,justify=1,letterdeg=8,};cw(cwt)
--connect lines to form curent box
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*astr
xs1=0+radcond*(math.sin(arc))
ys1=0-radcond*(math.cos(arc))
arc=(math.pi/180)*astr
xe1=0+radinner*(math.sin(arc))
ye1=0-radinner*(math.cos(arc))
cairo_move_to (cr,midx+xs1,midy+ys1)
cairo_line_to (cr,midx+xe1,midy+ye1)
cairo_stroke (cr)
arc=(math.pi/180)*aend
xs2=0+radcond*(math.sin(arc))
ys2=0-radcond*(math.cos(arc))
arc=(math.pi/180)*aend
xe2=0+radinner*(math.sin(arc))
ye2=0-radinner*(math.cos(arc))
cairo_move_to (cr,midx+xs2,midy+ys2)
cairo_line_to (cr,midx+xe2,midy+ye2)
cairo_stroke (cr)
--individual fc circles and forecast data
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle1
xfc1=0+radforecast*(math.sin(arc))
yfc1=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc1,midy+yfc1,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
radst=14
	arc=(math.pi/180)*fcangle1
	xfc1hl=0+(radsmall+radst)*(math.sin(arc))
	yfc1hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc1hl+xfc1,y=midy+yfc1hl+yfc1,txt=forecast_day_short_caps[1]})
	out({x=midx+xfc1hl+xfc1,y=midy+yfc1hl+yfc1+12,txt=high_temp[1].."F|"..low_temp[1].."F"})
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle2
xfc2=0+radforecast*(math.sin(arc))
yfc2=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc2,midy+yfc2,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle2
	xfc2hl=0+(radsmall+radst)*(math.sin(arc))
	yfc2hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc2hl+xfc2,y=midy+yfc2hl+yfc2,txt=forecast_day_short_caps[2]})
	out({x=midx+xfc2hl+xfc2,y=midy+yfc2hl+yfc2+12,txt=high_temp[2].."F|"..low_temp[2].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle3
xfc3=0+radforecast*(math.sin(arc))
yfc3=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc3,midy+yfc3,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle3
	xfc3hl=0+(radsmall+radst)*(math.sin(arc))
	yfc3hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc3hl+xfc3,y=midy+yfc3hl+yfc3,txt=forecast_day_short_caps[3]})
	out({x=midx+xfc3hl+xfc3,y=midy+yfc3hl+yfc3+12,txt=high_temp[3].."F|"..low_temp[3].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle4
xfc4=0+radforecast*(math.sin(arc))
yfc4=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc4,midy+yfc4,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle4
	xfc4hl=0+(radsmall+radst)*(math.sin(arc))
	yfc4hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc4hl+xfc4,y=midy+yfc4hl+yfc4,txt=forecast_day_short_caps[4]})
	out({x=midx+xfc4hl+xfc4,y=midy+yfc4hl+yfc4+12,txt=high_temp[4].."F|"..low_temp[4].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
arc=(math.pi/180)*fcangle5
xfc5=0+radforecast*(math.sin(arc))
yfc5=0-radforecast*(math.cos(arc))
cairo_arc (cr,midx+xfc5,midy+yfc5,radsmall,(math.pi/180)*0,(math.pi/180)*360)
cairo_stroke (cr)
	arc=(math.pi/180)*fcangle5
	xfc5hl=0+(radsmall+radst)*(math.sin(arc))
	yfc5hl=0-(radsmall+radst)*(math.cos(arc))
	out({x=midx+xfc5hl+xfc5,y=midy+yfc5hl+yfc5,txt=forecast_day_short_caps[5]})
	out({x=midx+xfc5hl+xfc5,y=midy+yfc5hl+yfc5+12,txt=high_temp[5].."F|"..low_temp[5].."F"})	
	cairo_stroke (cr)
cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
--show weather icons
imsizel=80
image({x=midx-imsizel,y=midy-imsizel,w=imsizel,h=imsizel,file=now["weather_icon"]})
imsizes=50
image({x=midx+xfc1-imsizes,y=midy+yfc1-imsizes,w=imsizes,h=imsizes,file=weather_icon[1]})
image({x=midx+xfc2-imsizes,y=midy+yfc2-imsizes,w=imsizes,h=imsizes,file=weather_icon[2]})
image({x=midx+xfc3-imsizes,y=midy+yfc3-imsizes,w=imsizes,h=imsizes,file=weather_icon[3]})
image({x=midx+xfc4-imsizes,y=midy+yfc4-imsizes,w=imsizes,h=imsizes,file=weather_icon[4]})
image({x=midx+xfc5-imsizes,y=midy+yfc5-imsizes,w=imsizes,h=imsizes,file=weather_icon[5]})
--#########################################################
--########## end of current conditions ####################
--######### forecast weather and repeat ###################
--#########################################################
--enter number of forecast days to show
number_of_days=8
--enter coordinates of top left corner for each day
top_left_x_coordinate[1],top_left_y_coordinate[1]=270,15
top_left_x_coordinate[2],top_left_y_coordinate[2]=540,15
top_left_x_coordinate[3],top_left_y_coordinate[3]=0,190
top_left_x_coordinate[4],top_left_y_coordinate[4]=270,190
top_left_x_coordinate[5],top_left_y_coordinate[5]=540,190
top_left_x_coordinate[6],top_left_y_coordinate[6]=0,370
top_left_x_coordinate[7],top_left_y_coordinate[7]=270,370
top_left_x_coordinate[8],top_left_y_coordinate[8]=540,370
------------------------
for i=1,number_of_days do--start of day repeat, do not edit
tlx=top_left_x_coordinate[i]--sets top left position for each repeat
tly=top_left_y_coordinate[i]--sets top left position for each repeat
--write day format below, write x and y relative to top left coordinates as in the example
--write i to call day as this will be replaced with the day number for each repeat

end--of day repeat, do not edit
--##############################################################
--############## end of weather display setup ##################
--##############################################################

end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

function out(tx)
color=nil
color=tx.c
if color==nil then color=default_color end
alpha=nil
alpha=tx.a
if alpha==nil then alpha=default_alpha end
font=nil
font=tx.f
if font==nil then font=default_font end
fsize=nil
fsize=tx.fs
if fsize==nil then fsize=default_font_size end
xpos=nil
xpos=tx.x
if xpos==nil then xpos=0 end
ypos=nil
ypos=tx.y
if ypos==nil then ypos=0 end
text=nil
text=tx.txt
if text==nil then text="hello world" end
local function col(c)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,alpha
end--local function
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,col(color))
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
cairo_stroke (cr)
end--function out

function image(im)
x=nil
x=im.x
if x==nil then x=0 end
y=nil
y=im.y
if y==nil then y=0 end
w=nil
w=im.w
if w==nil then w=default_image_width end
h=nil
h=im.h
if h==nil then h=default_image_height end
file=nil
file=tostring(im.file)
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(w)
end
if tonumber(h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(h)
end
local iacross=x+(width/2)
local idown=y+(height/2)
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(iacross, idown)
imlib_free_image()
show=nil
end--function image

function cw(t)
--set variables and defualts
if t.text==nil then text="" else text=t.text end
if t.font==nil then font="mono" else font=t.font end
if t.fsize==nil then fsize=12 else fsize=t.fsize end
if t.radius==nil then radius=50 else radius=t.radius end
if t.xpos==nil then xpos=100 else xpos=t.xpos end
if t.ypos==nil then ypos=100 else ypos=t.ypos end
if t.position==nil then position=1 else position=t.position end
if t.start==nil then start=270 else start=t.start end
if t.finish==nil then finish=90 else finish=t.finish end
if t.justify==nil then justify=1 else justify=t.justify end
if t.letterdeg==nil then letterdeg=5 else letterdeg=t.letterdeg end
--end variables
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,1,1,1,1);
if finish<start then finish=finish+360 end
local inum=string.len(text)
---------------------------
if position==1 then
deg=(finish-start)/(inum-1)
elseif position==2 then
deg=letterdeg
	if justify==1 then
	start=start	
	elseif justify==2 then
	start=start-((letterdeg*inum)/2)
	elseif justify==3 then 
	start=start-(letterdeg*inum)
	end
end
----------------------------
local degrads=(math.pi/180)
local textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
for i=1,inum do
interval=(degrads*(start+(deg*(i-1))))
txs=0+radius*(math.sin(interval))
tys=0-radius*(math.cos(interval))
cairo_move_to (cr, txs+xpos, tys+ypos);
cairo_rotate (cr, interval)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval)
end
end--circlewriting
function cwd(t)
--set variables and defualts
if t.text==nil then text="" else text=t.text end
if t.font==nil then font="mono" else font=t.font end
if t.fsize==nil then fsize=12 else fsize=t.fsize end
if t.radius==nil then radius=50 else radius=t.radius end
if t.xpos==nil then xpos=100 else xpos=t.xpos end
if t.ypos==nil then ypos=100 else ypos=t.ypos end
if t.position==nil then position=1 else position=t.position end
if t.start==nil then start=270 else start=t.start end
if t.finish==nil then finish=90 else finish=t.finish end
if t.justify==nil then justify=1 else justify=t.justify end
if t.letterdeg==nil then letterdeg=5 else letterdeg=t.letterdeg end
--end variables
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,1,1,1,1);
if start<finish then start=start+360 end
local inum=string.len(text)
---------------------------
if position==1 then
deg=(start-finish)/(inum-1)
elseif position==2 then
deg=letterdeg
	if justify==1 then
	start=start	
	elseif justify==2 then
	start=start+((letterdeg*inum)/2)
	elseif justify==3 then 
	start=start+(letterdeg*inum)
	end
end
----------------------------
local degrads=(math.pi/180)
local textcut=string.gsub(text, ".", "%1<>")
texttable=string.split(textcut, "<>")
for i=1,inum do
interval=(degrads*(start-(deg*(i-1))))
txs=0+radius*(math.sin(interval))
tys=0-radius*(math.cos(interval))
cairo_move_to (cr, txs+xpos, tys+ypos);
cairo_rotate (cr, interval+(math.pi))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -1*(interval+(math.pi)))
end
end--cwd 

function to_lines(line_text,max_string_len,indent)
---------------------------------------------
--set defaults for function
local default_max_length=50
local default indent=""
---------------------------------------------
if indent==nil then indent=default_indent end
if max_string_len==nil then max_string_len=default_max_length end
local i=1
text_table={line_text}
while text_table[i]~=nil do
if max_string==nil then max_string=max_string_len end
local v=text_table[i]
	if string.len(v)>max_string_len and string.find(v," ")~=nil and string.find(string.sub(v,1,max_string)," ")~=nil then
	long=string.len(v)
	splitcha=string.sub(v,max_string,max_string)	
		if splitcha~=" " then		
			while splitcha~=" " do
				if max_string>1 then
				max_string=max_string-1
				splitcha=string.sub(v,max_string,max_string)
				else
				splitcha=" "
				end
			end
		end
		local insertit=tostring(indent..string.sub(v,max_string+1,long))
		table.insert(text_table,i+1,insertit)
		text_table[i]=tostring(string.sub(v,1,max_string-1))	
	elseif string.len(v)>max_string_len and string.find(v," ")~=nil and string.find(string.sub(v,1,max_string)," ")==nil then
	long=string.len(v)
	splitcha=string.sub(v,max_string,max_string)		
		while splitcha~=" " do
			if max_string<long then
			max_string=max_string+1
			splitcha=string.sub(v,max_string,max_string)
			else
			splitcha=" "
			end
		end
		local insertit=tostring(indent..string.sub(v,max_string+1,long))
		table.insert(text_table,i+1,insertit)
		text_table[i]=tostring(string.sub(v,1,max_string-1))	
	end
i=i+1
max_string=max_string_len
end
return text_table
end--function  

conkyweathercirle

  ###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override #override
own_window_transparent yes
own_window_hints below,sticky,skip_taskbar,skip_pager
own_window_argb_visual no
#own_window_colour black
own_window_class Forecast Conky
own_window_title Forecast by MrP

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### 'own_window_type override'
own_window_argb_visual no

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 0

minimum_size 450 450     ## width, height
maximum_width 450 450      ## width, usually a good idea to equal minimum width

gap_x 10        ### left &right
gap_y 10        ### up & down

alignment tl
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
# xftfont Anonymous Pro:bold:size=9
# xftfont Unispace:size=8
# xftfont Onuava:size=8
 #xftfont Inconsolata:bold:size=10
# xftfont Andale Mono:bold:size=9
xftfont DejVu Mono:size=9


# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color grey
default_outline_color black

default_color DCDCDC #Gainsboro
color0 DAA520 #Goldenrod  FFFFF0 #Ivory
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 10
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
lua_load ~/v9000/weathercircle.lua
lua_draw_hook_pre weather #starts the lua weather data gathering function, call once at top of conkyrc



# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
top_name_width 7


TEXT
 

Edit : j'ai voulu fair tourner le script et ai trouvé quelque dificulté, j'ai donc modiifié de manière a ce que sa puisse fonctionner avec nos abitude d'alias (~ et $HOME ne veulent rien dire pour lua)
Edit : de toute évidence il y a eut du changement sur le site intellicast, il y a donc des patterns qui ne fonctionnes plus a tous les coups, je viens d'en corriger un second (ligne 404du nouveau script), donc si il y a d'autre soucis n’hésite pas.

Dernière modification par Didier-T (Le 12/09/2012, à 06:57)

Hors ligne

#1259 Le 12/09/2012, à 07:02

Didier-T

Re : [Conky] Alternative à weather.com (2)

falldown a écrit :

Vous messieurs travaillent bien ensemble "Comme une machine bien huilée": D

Merci, si tu as des idées de conky météo, car c'est le sujet de la discutions surtout n'hésite pas.

Hors ligne

#1260 Le 12/09/2012, à 09:37

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Didiet-T
Merci beaucoup pour cette energie que tu mets dans le "lua"; j'ai maintenant le cercle et le texte en cercle qui s'affiche, mais pas les conditions...J'ai de nouveau un bug dans les lignes 508:

 cwt={text="TMP: "..now["temp"].."F / FL: "..now["feels_like"].."F ",font="mono",fsize=14,radius=trad,xpos=midx,ypos=midy,position=2,start=astr+5,finish=aend-5,justify=1,letterdeg=5.5,};cw(cwt) 

Sector11 m'avait dit que tous les scripts météo tournaient maintenant avec le script v9000.lua.Peut-être y a t-il dans ce script des données à récupérer pour les mettre dans le weathercircle.lua ? (car les infos intellicast tournent sans problèmes dans celui-ci...)
scripts_intellicast
ps/J'ai mis aussi dans l'archive le script "forecast_v6" qui tourne sans erreur.
ici sont les archives de ce script que sector11 m'a fait suivre mais mon niveau d'Anglais "technique" ne me permet pas de comprendre les bugs qu'ils ont eut eux aussi...
forum_crunchbang
Bonne journée

Dernière modification par ragamatrix (Le 12/09/2012, à 09:45)

Hors ligne

#1261 Le 12/09/2012, à 09:45

Didier-T

Re : [Conky] Alternative à weather.com (2)

ragamatrix a écrit :

@Didiet-T
Merci beaucoup pour cette energie que tu mets dans le "lua"; j'ai maintenant le cercle et le texte en cercle qui s'affiche, mais pas les conditions...J'ai de nouveau un bug dans les lignes 508:

 cwt={text="TMP: "..now["temp"].."F / FL: "..now["feels_like"].."F ",font="mono",fsize=14,radius=trad,xpos=midx,ypos=midy,position=2,start=astr+5,finish=aend-5,justify=1,letterdeg=5.5,};cw(cwt) 

Sector11 m'avait dit que tous les scripts météo tournaient maintenant avec le script v9000.lua.Peut-être y a t-il dans ce script des données à récupérer pour les mettre dans le weathercircle.lua ? (car les infos intellicast tournent sans problèmes dans celui-ci...)
scripts_intellicast
ps/J'ai mis aussi dans l'archive le script "forecast_v6" qui tourne sans erreur.

le problème est ligne 404, il faut mettre ceci

s,f,t=string.find(nowweather,"40_white/(wx_%d*).png")

Hors ligne

#1262 Le 12/09/2012, à 09:50

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Didier-T
Magnifique plus d'erreurs !!
C'était un travail pour le NETTOYEUR ! cool Joli travail encore merci !

Hors ligne

#1263 Le 13/09/2012, à 18:24

Phyllinux

Re : [Conky] Alternative à weather.com (2)

@ Didier-T :

Bravo, et merci pour le conky météo interactif.
Tout tourne, même sur mon netbook ! Et idem pour le conky système interactif.
Je vais me pencher sur le conky météo ce week-end pour mieux comprendre sa construction.
En effet, il y a quelques petites bricoles à retoucher. Rien de bien important : cela concerne les alignements, car il y a de petits décalages par rapport au conky du départ, et la couleur de police pour les prévisions.
Vu que j'aurai plus de temps ce week-end, je peaufinerai 'la bête'.
Merci encore pour la rapidité et la qualité du travail de code wink
Je regarderai aussi les conkys de falldown et Sector11


The ship is sinking normally...

Hors ligne

#1264 Le 14/09/2012, à 10:17

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Didiet-T
Salut, j'ai essayé les conky interacifs.
Je rencontre quelques bugs car je ne dispose pas des "sensors" (j'ai fais sensors-detect" et répondu oui à toutes les questions)Mais ma machine ne les supportent pas ?

 Try sensors-detect to find out which these are.
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
No sensors found!
 

et pour le meteo interactif...

 Conky: llua_do_call: function conky_icones execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_fenetre execution failed: attempt to call a nil value
Conky: failed to parse compare string '==0'
Conky: compare failed for expression '==0'
Conky: llua_do_call: function conky_Image execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_Maj execution failed: attempt to call a nil value
 

.........

Hors ligne

#1265 Le 14/09/2012, à 13:39

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Didier-T
Pour interactif système:
J'ai supprimé toutes les lignes concernant les sensors dans le lua: plus d'erreurs.:)

Hors ligne

#1266 Le 15/09/2012, à 14:56

Didier-T

Re : [Conky] Alternative à weather.com (2)

ragamatrix a écrit :

@Didier-T
Pour interactif système:
J'ai supprimé toutes les lignes concernant les sensors dans le lua: plus d'erreurs.:)

c'est dommage que tu ne puisse les utiliser, sa peut être utile de connaître les températures.

Hors ligne

#1267 Le 15/09/2012, à 19:05

falldown

Re : [Conky] Alternative à weather.com (2)

Ragamatrix Puis-je demander quel est le code que vous utilisez pour le radar météo? (Centré de votre capture d'écran)
Et si possible, pourrais-je obtenir une copie?
C'est très intéressant.

Hors ligne

#1268 Le 15/09/2012, à 20:42

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@falldown
Hey !
Do you mean the center of the screen..?
It's may be this one :
sys_sol3
And the pack:conkypack
cheers wink

Hors ligne

#1269 Le 16/09/2012, à 12:58

Didier-T

Re : [Conky] Alternative à weather.com (2)

bonjour à tous,
juste pour vous dire que je travail actuellement à la prochaine version de meteo.lua ( une version international )

Hors ligne

#1270 Le 16/09/2012, à 17:43

Phyllinux

Re : [Conky] Alternative à weather.com (2)

Bonjour à tous et à toutes,

Il y a un peu moins d'un an de cela, lorsque j'avais posté mon billet d'humeur relatif à la fermeture de la gratuité de Weather.com, et dans lequel je demandais un coup de main pour trouver une alternative à conky forecast, je n'imaginais pas que cette simple demande d'aide allait générer autant d'efforts de la part de tous ceux qui ont participé au développement de ce qui est maintenant 'météo lua' (exportant les données d'Accuweather.com), une véritable alternative à conky forecast qui utilisait Weather.com (comme l'indique le titre du fil).
Un grand Bravo et un grand merci à Didier-T, jpdipsy, et tous ceux qui ont apporté leur contribution pour faire progresser le projet big_smile.
Alors, vu que Didier-T se lance dans la version internationale du script, j'avais envie d'en profiter pour poster une petite galerie de l'historique de tout ce qui peut être fait avec la combinaison des différents scripts écrits jusqu'à maintenant.

Cela a commencé avec ceci :
espacedetravail1028.th.png
Un conky avec l'affichage des conditions du moment et les prévisions à une semaine.


L'idée m'est vite venue de rajouter une image satellite 'en temps réel', pour compléter le conky :
espacedetravail1029.th.png


Puis, nouveaux graphismes, pour en faire ce qui a servi de base à de très nombreuses variations de conkys (conky en haut à gauche) :
espacedetravail1030.th.png
(Merci à jpdipsy et ragamatrix pour le script d'exportation et 'détourage' de l'image de la terre pour le conky du centre)


Autre petite variation, un conky chrono, avec une montre en lua, et les données météo qui s'y intègrent :
espacedetravail1031.th.png


Puis, passage au conky en plein écran :
Première possibilité, en conky pur, avec la première apparition du clic interactif au sein du conky : un clic sur la photo en bas à droite permet de choisir une autre photo satellite dans un menu déroulant. Merci à Didier-T pour l'écriture des différents scripts qui m'ont permis d'avoir exactement le résultat souhaité (script du clic pour choix d'image et script d'extraction de la carte Vigilance de Météo France)
espacedetravail1032.th.png


Deuxième possibilité, en intégrant directement le conky dans le fond d'écran, qui se renouvelle au même rythme que le fond d'écran dynamique (XPlanetFX) auquel il est couplé. Merci à jpdipsy pour tout son travail de développement de cette version de conky.
espacedetravail1033.th.png


Dernière évolution avec le conky 'cliquable'. Merci à falldown pour l'idée originale et ses premiers scripts, retravaillés par Didier-T.
Pour qu'il soit plus 'visuel', j'ai doublé son lancement sur l'impression d'écran ci dessous, pour montrer à quoi cela ressemble une fois lancé (conky de gauche) et ce que cela donne en cliquant sur les cadres, afin de les ouvrir (conky de droite). Bien évidemment, chaque cadre peut être 'ouvert' de façon indépendante,  pour développer celui que l'on souhaite.
espacedetravail1034.th.png


Et je terminerai par mon conky Navette. Sur une idée originale de Sector11, retravaillée à ma façon, en intégrant les scripts lua de météo, image météo, etc....
C'est un 'énorme' conky plein écran, pour avoir un fond d'écran dynamique original, et toutes les informations que je voulais avoir directement sous les yeux. 
espacedetravail1035.th.png


Quelques précisions complémentaires :
Tous ces conkys tournent sur mon netbook au bien modeste et exotique processeur VIA NANO U2250 de 0.80GHz (cf impression d'écran du conky 3 et conky Navette).
La distribution utilisée est l'excellentissime Voyager 12.04 (sur une base de Xubuntu 12.04), sur un DD externe branché sur le netbook.
Donc, aucun problème pour les faire tourner quelle que soit la machine utilisée.
Si l'un d'entre vous est intéressé par le(s) script(s) de l'un ou l'autre des conkys, aucun problème pour les partager. cool
Bons conkys à tous, et j'attends de voir vos réalisations pour y piocher de nouvelles idées tongue


The ship is sinking normally...

Hors ligne

#1271 Le 16/09/2012, à 19:25

Didier-T

Re : [Conky] Alternative à weather.com (2)

Et oui on en a parcouru du chemin, et j'en ais appris des choses smile

pour ceux qui seraient intéressé pour les tests voici le pack de la beta, normalement tous fonctionnes mais bon rien ne vaut un essai grandeur nature.

Plus besoin de prendre des pages avec l'affichage en français, et les degrés Fahrenheit sont supportés.

Le pack est ici, il n'y a plus d'écriture des pages web sur le pc, donc disque rapide ou non plus de soucis.

un petit screen pour montrer (le temps indiquer dans le terminal correspond a la mise a jours complète sur 5 jours, matin, midi, soir et nuit)

1965.jpeg

Comme toujours, amusez-vous bien.

Dernière modification par Didier-T (Le 16/09/2012, à 19:26)

Hors ligne

#1272 Le 17/09/2012, à 14:35

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@Phyllinux
Salut ! Je ne m'étais pas rendu compte que nous avions déjà fait tant de choses...
Bravo, tu as très bien formulé toute cette aventure !
J'ai eu une idée de modification concernant le conky avec la planète au cente; j'ai fais cette modification mais maintenant ce conky à lui seul utilise plus de 6% de cpu ?
Est-ce normal ?
memcpu

Hors ligne

#1273 Le 17/09/2012, à 15:12

ragamatrix

Re : [Conky] Alternative à weather.com (2)

@jpdipsy
Oulala....J'ai trouvé ça:
startrek
Pas encore le temps de m'y plonger mais ça peut donner des idées...
++
cool

Hors ligne

#1274 Le 17/09/2012, à 15:39

Phyllinux

Re : [Conky] Alternative à weather.com (2)

ragamatrix a écrit :

@Phyllinux
Salut ! Je ne m'étais pas rendu compte que nous avions déjà fait tant de choses...
Bravo, tu as très bien formulé toute cette aventure !
J'ai eu une idée de modification concernant le conky avec la planète au cente; j'ai fais cette modification mais maintenant ce conky à lui seul utilise plus de 6% de cpu ?
Est-ce normal ?
memcpu

Je ne suis ps à mon domicile actuellement, et donc, je tourne avec mon netbook, qui, comme toutes les machines de ce type, et de cette génération, ont un processeur assez faiblard.
Et je peux te dire que, rien que pour le conky d'affichage de la terre toute seule, sans les scripts lua l'entourant comme tu l'as fait, avec uniquement les scripts de récupération de l'image, détourage et redimensionnement, ce conky me dévore 30% des ressources processeur !
Donc, je pense que ce ne sont pas les 2 pauvres jauges d'affichage des ressources CPU et RAM qu'il faut incriminer wink


The ship is sinking normally...

Hors ligne

#1275 Le 18/09/2012, à 12:21

Phyllinux

Re : [Conky] Alternative à weather.com (2)

@ Didier-T :

Retour d'expérience de Meteo Lua V4.5 :
Je viens de le tester, et petits problèmes :
1/ L'actualisation des données ne s'est pas faite. J'ai à l'écran l'affichage des dernières données téléchargées (en l’occurrence celles d'hier soir au lieu d'avoir les conditions actuelles du moment).
Cependant mon conky commence bien par

#### Lancement du script récupérant les données météo ####
${template1 Maj}

2/ Du coup, j'ai lancé en terminal au lieu de le lancer par Conky Control, et là, j'ai le message d'erreur suivant :

┌─( gilles ) - ( 3.2.0-31-generic ) - ( ~ )
└─> conky -c ~/conky/ConkyNC/conkyrcmeteo7J
Conky: desktop window (1200003) is subwindow of root window (132)
Conky: window type - override
Conky: drawing to created window (0x3600001)
Conky: drawing to double buffer
	version = v4.5
	web = www.accuweather.com/fr/fr/marseille/170960/weather-forecast/170960
	Pévision Nb jours = 7
	Pévision Matin = oui
	Pévision Après Midi = oui
	Pévision Soirée = oui
	Pévision Nuit = oui
	Délais = 300
	Chemin de travail = /tmp
	Palier = 16
	Chemin de sauvegarde = /home/gilles/meteotemp
sh: 1: curl: not found
Conky: llua_do_call: function conky_Meteo_enligne execution failed: /home/gilles/conky/script/meteo.lua:112: bad argument #1 to 'gsub' (string expected, got nil)

Je ne sais pas du tout à quoi correspond ce sh: 1: curl: not found
Et la ligne déclarée avec le mauvais argument (ligne 112) est celle ci :

directvent = string.gsub(directvent, "W", "O")

Je ne vois pas du tout ce qu'elle vient faire ici dans l'écriture du script hmm
Et je ne sais pas si c'est elle la fautive de la non actualisation des données, mais dans tous les cas, chez moi, pour le moment, cela ne fonctionne pa mad

J'espère que ce retour d'expérience te sera utile. Pour le moment, je repasse à la 4.4 en attendant que tout soit OK.

@ jpdipsy, ragamatrix et Didier-T :
Je posterai un peu plus tard un petit problème avec 'convert', suite aux essais que je suis en train de faire. tongue

Dernière modification par Phyllinux (Le 18/09/2012, à 12:23)


The ship is sinking normally...

Hors ligne