Page 2119 of 2284 FirstFirst ... 1119161920192069210921172118211921202121212921692219 ... LastLast
Results 21,181 to 21,190 of 22835

Thread: Post your .conkyrc files w/ screenshots

  1. #21181
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    ^ this is the start of code that controls the pointer for wind direction

    Code:
    --pointer 
    if ws==nil then ws=0 end 
    local wspd=ws 
    local m1=300/60 
    local m2=wspd*m1 
    local rout1=rout3
    the print command is extremely useful, i use it all the time when writing and testing scripts

    put a print command in there like this
    Code:
    --pointer 
    if ws==nil then ws=0 end 
    local wspd=ws
    print (wspd)
    local m1=300/60 local m2=wspd*m1 local rout1=rout3
    then launch in terminal and check what value is being fed to the pointer
    Last edited by mrpeachy; November 28th, 2012 at 09:53 PM.

  2. #21182
    Join Date
    Jun 2012
    Beans
    0

    Re: Post your .conkyrc files w/ screenshots

    @Mr Peachy
    Is it possible to call icons in the Thermometer lua script ?

  3. #21183
    Join Date
    Jun 2012
    Beans
    0

    Re: Post your .conkyrc files w/ screenshots

    I followed advices from Phyllinux in the french forum and I've done it with Meteo-Lua and your script in the same conky.
    Here's-->
    http://pix.toile-libre.org/upload/or...1354118829.png
    The codes :
    conky:
    Code:
     ##############################################
    #  Settings
    ##############################################
    max_specials 10000
    max_user_text 1500000
    background yes
    use_xft yes
    #xftfont Sans:size=12
    #xftalpha 1
    font Arial Rounded MT:size=7
    total_run_times 0
    own_window yes
    own_window_argb_visual yes
    own_window_transparent yes
    own_window_type normal
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    minimum_size 680 720
    maximum_width 680
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    default_color white
    default_shade_color black
    default_outline_color white
    alignment top_left
    gap_x 10
    gap_y 10
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    override_utf8_locale yes
    color1 86acad #darker blue
    color2 b1c9c9 #lighter blue
    text_buffer_size 100000
    top_name_width 10
    update_interval 1
    
    # -- Déclaration template -- #
    	template0 ${image ~/.conky/conky38/script/images/\1 -p \2 -s \3} # -- images fond -- #
    	template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
    	template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icônes météo -- \2=répertoire icônes \3=position \4=taille \5=jour (pour les prévisions) #
    	template3 ${lua Lune_\1} 
    	template4 ${lua_parse Images_\1 \2 \3 60 \4} # -- Appelle image -- \2=position \3=taille \4=jour (pour les prévisions) #
    	lua_load ~/.conky/conky38/script/meteo.lua
    	lua_startup_hook init ~/.conky/conky38/script/meteo.cfg
    
    
    lua_load ~/.conky/conky24/thermometer3.lua
    lua_load ~/.conky/conky24/draw_bg.lua
    
    TEXT
    ${lua conky_draw_bg 250 0 150 500 500 0x000000 0.6}
    ${lua conky_weather}
    #${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
    #### Lancement du script récupérant les données météo ####
    #${template1 horsligne}
    ${template1 Maj}
    ##### Affichage conditions météo #####
    ${voffset 375}${goto 235}${font :italic:size=10}${color white}${template1  CondMeteo}
    ${voffset 2}${goto 235}${font style=Bold:size=13}${if_match ${template1 TempAct}<5}${color lightblue}${blink ${template1 TempAct}°}${else}${color white}${template1 TempAct}°${endif}
    ## Affichage différents paramètres ###################################################
    ${voffset 5}${goto 270}${font}${color4}Soleil: ${color0}${template1 HLeverSoleil 1}:${template1 MLeverSoleil 1} / ${template1 HCoucherSoleil 1}:${template1 MCoucherSoleil 1} (${template1 HDureeJour 1}h ${template1 MDureeJour 1})
    ${voffset 2}${goto 270}${font}${color4}UV: ${color0}${template1  Uv 1} 
    ${voffset 2}${goto 270}${font}${color4}Couverture nuageuse: ${color0}${template1  CouvNuage 1}% 
    ${voffset 2}${goto 270}${font}${color4}Visibilité: ${color0}${template1  Visibilite 1} km
    ${voffset 2}${goto 270}${font}${color4}Vent: ${color FF0000}${template1 VentDirP} ${template1 VentForce} km/h
    ${voffset 2}${goto 270}${font}${color4}Pression: ${color0}${template1 Pression 1} mb
    ${voffset 2}${goto 270}${font}${color4}Quantité précipitation: ${color0}${template1  QPrec 1} mm
    ${voffset 2}${goto 270}${font}${color4}Vent Rafales max: ${color FF0000}${template1 Jour_VentRafales 1} Km/h
    ${voffset 2}${goto 270}${font :italic:size=6}${color4}Dernier relevé: ${color 1E90FF}${template1 Heure}:${template1 Minute}
    ${voffset 2}${goto 270}${color green3}${font :italic:size=6}Méteo-Lua:${lua conky_Version}
    ##next 3days##
    ${voffset -90}${goto 130}${font}${color4}${template1 Jour %A 2}: ${color red}${template1 Jour_Temp 2}°${color white} | ${color lightblue}${template1 Nuit_Temp 2}°
    ${voffset 15}${goto 130}${font}${color4}${template1 Jour %A 3}: ${color red}${template1 Jour_Temp 3}°${color white} | ${color lightblue}${template1 Nuit_Temp 3}°
    ${voffset 15}${goto 130}${font}${color4}${template1 Jour %A 4}: ${color red}${template1 Jour_Temp 4}°${color white} | ${color lightblue}${template1 Nuit_Temp 4}°
    ${voffset 15}${goto 130}${font}${color4}${template1 Jour %A 5}: ${color red}${template1 Jour_Temp 5}°${color white} | ${color lightblue}${template1 Nuit_Temp 5}°
    #${template2 huitHeures_IconeM ~/.conky/conky38/meteo/icones 210,505 43x26 2}
    #${template2 huitHeures_IconeM ~/.conky/conky38/meteo/icones 210,532 43x26 4}
    #${template2 huitHeures_IconeM ~/.conky/conky38/meteo/icones 210,558 43x26 8}
    ${template2 Jour_IconeM ~/.conky/conky38/meteo/icones 210,505 43x26 2}
    ${template2 Jour_IconeM ~/.conky/conky38/meteo/icones 210,532 43x26 3}
    ${template2 Jour_IconeM ~/.conky/conky38/meteo/icones 210,558 43x26 4}
    ${template2 Jour_IconeM ~/.conky/conky38/meteo/icones 210,585 43x26 4}
    Thermometer3.lua:
    Code:
     --[[weather display by mrpeachy nov 2011
    version 4
    -cleaned up a bit
    -temp scale changing
    -set mid point temp for color change
    -added forecast display
    -added wind speed guage
    -added hi lo thermometers
    ]]
    --#########################################################################################################
    --SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
    secs=300--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
    units="C"--set units for C or F
    mid=75--this is the temp at which temp scale is yellow, ie mid point in color change scale
    ----###weathericons="~/v9000/additional_files/weathericons/"
    --#########################################################################################################
    
    require 'cairo'
    ------------------------------------------------------------------------------
    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 timer=(updates %secs)+1
    if timer==1 or updates==6 then
    local f=io.popen("curl '"..web.."' | grep -A62 'As of ' | gawk -F'>' -v RS='</' 'RT{print $NF}' | sed -e 's/^[ \t]*//' -e '/^$/d' -e 's/&deg;//g' -e 's/%//g' -e 's/  / /g' -e 's/Thunderstorms/T.Storms/g'")
    local data1=f:read("*a")
    f:close()
    local data2=string.split(data1,"\n")
    local data={}
    for i,v in pairs(data2) do
    if string.find(v,"[%a%d]")~=nil then
    table.insert(data,data2[i])
    end
    end
    --##############################################
    --current
    local wdr=string.split(data[25]," ")
    now={con=string.gsub(data[2],"[\r\n]",""),tmp=string.gsub(data[4],units,""),flk=string.gsub(data[5],"Feels Like: ",""),wch=data[7],cel=data[10],hid=data[12],vis=string.gsub(data[15],"[ %a]",""),dpt=data[17],wsp=string.gsub(data[20],"[ %a]",""),wdg=(wdr[1]),wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),wgs=string.gsub(data[30],"[ %a]",""),hum=data[22],prs=string.gsub(data[27],"\"","")}
    --############################################
    --forecast
    local f=io.popen("curl '"..web.."' | grep -A554 'View the Calendar Forecast' | gawk -F'>' -v RS='<' 'RT{print $NF}' | sed -e 's/^[ \t]*//' -e 's/&deg;//g' -e 's/  / /g' -e 's/%//g' -e 's/&deg//g' -e 's/Thunderstorms/T.Storms/g'")
    local fdata1=f:read("*a")
    f:close()
    local fdata=string.split(fdata1,"\n")
    local fdata2={}
    for i,v in pairs(fdata) do
    if string.find(v,"[%a%d]")~=nil then
    table.insert(fdata2,fdata[i])
    end
    end
    local uvi=string.split(fdata2[20]," ")
    local wsp=string.split(fdata2[32]," ")
    local wdr=string.split(fdata2[34]," ")
    day1={day=fdata2[2],con=fdata2[3],hih=fdata2[4],low=fdata2[5],sri=fdata2[8],sst=fdata2[10],mri=fdata2[12],mst=fdata2[14],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[22],ppt=fdata2[24],snw=fdata2[26],cld=fdata2[28],mph=fdata2[30],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day2
    local uvi=string.split(fdata2[53]," ")
    local wsp=string.split(fdata2[65]," ")
    local wdr=string.split(fdata2[67]," ")
    day2={day=fdata2[35],con=fdata2[36],hih=fdata2[37],low=fdata2[38],sri=fdata2[41],sst=fdata2[43],mri=fdata2[45],mst=fdata2[47],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[55],ppt=fdata2[57],snw=fdata2[59],cld=fdata2[61],mph=fdata2[63],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day3
    local start=68
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day3={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day4
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day4={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day5
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day5={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day6
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day6={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day7
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day7={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=wmh,wkm=wkm,wkt=wkt,wdg=wdg,wdi=wdi}
    --day8
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day8={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day9
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day9={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    --day10
    local start=start+29
    local uvi=string.split(fdata2[start+14]," ")
    local wsp=string.split(fdata2[start+26]," ")
    local wdr=string.split(fdata2[start+28]," ")
    day10={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
    end--timer section
    display(now,day1,day2,day3,day4,day5,day6,day7,day8,day9,day10)
    --################################################################3
    end-- if updates>5
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
    return ""
    end-- end main function
    
    function display(now,day1,day2,day3,day4,day5,day6,day7,day8,day9,day10)
    --print (now.con,now.tmp,now.flk,now.wch,now.cel,now.hid,now.vis,now.dpt,now.wsp,now.wdg,now.wgi,now.wgs,now.hum,now.prs)
    --[[
    --forecast information, 10 day, options
    --use like this  dayX.option (where X=day number (1=today,2=tomorrow))
    --eg day1.day
    day=forecast day and date
    con=conditions summary
    hih=high temp
    low=low temp
    sri=sunrise
    sst=sunset
    mri=moon rise
    mst=moon set
    uvi=ultraviolet index
    hum=humidity
    ppt=chance of precipitation
    snw=chance of snow
    cld=cloud cover
    mph=moon phase
    wmh=wind speed in mph
    wkm=wind speed in km/h
    wkt=wind speed in knots
    wdg=wind direction in degrees
    wdi=wind direction in nesw
    ]]
    --#####################################
    --setup text type and color
    local font="Mono"
    local fsize=10
    local red,green,blue,alpha=1,1,1,1
    local xpos=430
    local ypos=30--first line
    local gap1=fsize+2
    --TEST
    --ypos=490--first line
    --xpos=200
    --gap1=fsize+2
    --gap=0
    --text=day2.day;txt(text,xpos,ypos,font,10,red,green,blue,alpha)
    --text="    Conditions: "..day2.con;gap=gap1+4;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="      Temp Max: "..day2.hih.."°"..units;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="      Temp Min: "..day2.low.."°"..units;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="     Indice UV: "..day2.uvn.." ("..day1.uvt..")";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="      Humidité: "..day2.hum.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="    Prob pluie: "..day2.ppt.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="    Prob Neige: "..day2.snw.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text=" Couv.Nuageuse: "..day2.cld.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="  Vent vitesse: "..day2.wmh.."kmh";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    --text="Vent direction: "..day2.wdg.."° ("..day2.wdi..")";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
    
    --#############################################
    --wind direction compass
    compass(145,240,50,tonumber(now.wdg),now.wsp,now.wgs)
    --windspeed dial
    wspeed_dial(now.wsp,305,300)
    --################################################################3
    --pressure barometer
    barometer(tonumber(now.prs),110,395)
    --#########################################
    --humidity bar
    humidity(430.5,315.5,tonumber(now.hum))
    --#########################################
    --current conditions display
    --text="Conditions:";txt(text,240,430,"Mono",12,1,1,1,1)
    --text="Température: "..now.tmp.."°, Plafond: "..now.cel;txt(text,240,445,"Mono",10,1,1,1,1)
    --text=now.con;txt(text,270,465,"Mono",15,1,1,1,1)
    
    end--display
    --#############################################################################################################################################################
    function wspeed_dial(ws,px,py)
    --0 to 60 mph
    --draw circle
    cairo_set_line_width (cr,1)
    local router=110
    cairo_set_source_rgba (cr,0.1,0.1,0.1,1)
    cairo_arc (cr,px,py,router,(math.pi/180),0)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,1,1,1)
    cairo_arc (cr,px,py,router,(math.pi/180),0)
    cairo_stroke (cr)
    -------------------------------------------
    --mph scale
    local rout1=80
    local rin1=rout1-10
    for i=0,60 do
    if i==5 or i==15 or i==25 or i==35 or i==45 then
    rin=rin1--set line length for 5s
    cairo_set_line_width (cr,1)
    elseif i==0 or i==10 or i==20 or i==30 or i==40 or i==50 or i==60 then
    rin=rin1+7--set line length for 10's
    cairo_set_line_width (cr,3)
    else
    rin=rin1+5--set other lines
    cairo_set_line_width (cr,1)
    end--if i==
    arc=(math.pi/180)*(210+(i*(300/60)))
    ppx=0+rout1*(math.sin(arc))
    ppy=0-rout1*(math.cos(arc))
    arc=(math.pi/180)*(210+(i*300/60))
    pix=0+rin*(math.sin(arc))
    piy=0-rin*(math.cos(arc))
    cairo_move_to (cr,px+ppx,py+ppy)
    cairo_line_to (cr,px+pix,py+piy)
    cairo_stroke (cr)
    end--for i=
    --mph reading
    mph={0,10,20,30,40,50,60}
    local rin=rin1-2
    for i=1,#mph do
    arc=(math.pi/180)*(210+((i-1)*(300/6)))
    ppx=0+rin*(math.sin(arc))
    ppy=0-rin*(math.cos(arc))
    text=mph[i]
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    width=extents.width
    height=extents.height
    cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end--for i= print inches
    --kmh lines and numbers
    --60kmh=96.5606
    cairo_set_line_width (cr,1)
    local m1=300/96.5606
    local rout2=60
    local rin2=rout2-5
    local num=95
    --print lines---------------
    for i=0,num do
    if i==0 or i==10 or i==20 or i==30 or i==40 or i==50 or i==60 or i==70 or i==80 or i==90 then
    rin=rin2-5--set length for 10s
    elseif i==5 or i==15 or i==25 or i==35 or i==45 or i==55 or i==65 or 1==75 or i==85 or i==95 then
    rin=rin2-2--set length for 5's
    else
    rin=rin2
    end--if i=
    ---------------------------------------------------
    arc=(math.pi/180)*(210+(i*m1))
    ppx=0+rout2*(math.sin(arc))
    ppy=0-rout2*(math.cos(arc))
    arc=(math.pi/180)*(210+(i*m1))
    pix=0+rin*(math.sin(arc))
    piy=0-rin*(math.cos(arc))
    cairo_move_to (cr,px+ppx,py+ppy)
    cairo_line_to (cr,px+pix,py+piy)
    cairo_stroke (cr)
    end--for i --line drawing
    --kmh reading
    kmh={0,10,20,30,40,50,60,70,80,90}
    local rout=rin2-18
    for i=1,#kmh do
    arc=(math.pi/180)*(210+((i-1)*(m1*10)))
    ppx=0+rout*(math.sin(arc))
    ppy=0-rout*(math.cos(arc))
    text=kmh[i]
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    width=extents.width
    height=extents.height
    cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end--kmh lines and numbers
    --knots
    --60kmh=52.1386
    cairo_set_line_width (cr,1)
    local m1=300/52.1386
    local rout3=90
    local rin3=rout3-5
    local num=50
    --print lines---------------
    for i=0,num do
    if i==0 or i==10 or i==20 or i==30 or i==40 or i==50 then
    rout=rout3-1--set length for 10s
    cairo_set_line_width (cr,3)
    elseif i==5 or i==15 or i==25 or i==35 or i==45 then
    rout=rout3+4--set length for 5's
    cairo_set_line_width (cr,1)
    else
    rout=rout3
    cairo_set_line_width (cr,1)
    end--if i=
    ---------------------------------------------------
    arc=(math.pi/180)*(210+(i*m1))
    ppx=0+rout*(math.sin(arc))
    ppy=0-rout*(math.cos(arc))
    arc=(math.pi/180)*(210+(i*m1))
    pix=0+rin3*(math.sin(arc))
    piy=0-rin3*(math.cos(arc))
    cairo_move_to (cr,px+pix,py+piy)
    cairo_line_to (cr,px+ppx,py+ppy)
    cairo_stroke (cr)
    end--for i --line drawing
    --kmh reading
    knot={0,10,20,30,40,50}
    local rout=rin3+15
    for i=1,#kmh do
    arc=(math.pi/180)*(210+((i-1)*(m1*10)))
    ppx=0+rout*(math.sin(arc))
    ppy=0-rout*(math.cos(arc))
    text=knot[i]
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    width=extents.width
    height=extents.height
    cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end
    --scale labels
    local text="mph"
    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,px-(width/2),py+rin1)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    local text="kmh"
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to (cr,px-(width/2),py+rin2)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    local text="Noeuds"
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to (cr,px-(width/2),py+rin3)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    local text="Mesures Vent"
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to (cr,px-(width/2),py+rin3+12)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    --pointer
    if ws==nil then ws=0 end
    local wspd=ws
    local m1=300/60
    local m2=wspd*m1
    local rout1=rout3
    local arc=(math.pi/180)*(210+m2)
    local ppx=0+rout1*(math.sin(arc))
    local ppy=0-rout1*(math.cos(arc))
    ------------------------------
    local arc=(math.pi/180)*(210+m2+180)
    local ppox=0+rout1*(math.sin(arc))
    local ppoy=0-rout1*(math.cos(arc))
    -------------------------------
    local rin3=7
    local arc=(math.pi/180)*(210+m2-90)
    local pilx=0+rin3*(math.sin(arc))
    local pily=0-rin3*(math.cos(arc))
    local arc=(math.pi/180)*(210+m2+90)
    local pirx=0+rin3*(math.sin(arc))
    local piry=0-rin3*(math.cos(arc))
    --------------------------------
    cairo_move_to (cr,px+pilx,py+pily)
    cairo_line_to (cr,px+ppx,py+ppy)
    cairo_line_to (cr,px+pirx,py+piry)
    cairo_line_to (cr,px+pilx,py+pily)
    cairo_set_source_rgba (cr,1,0,0,1)
    cairo_fill (cr)
    cairo_arc (cr,px,py,rin3,(math.pi/180),0)
    cairo_fill (cr)
    ---------------------------------
    cairo_move_to (cr,px+pilx,py+pily)
    cairo_line_to (cr,px+ppox,py+ppoy)
    cairo_line_to (cr,px+pirx,py+piry)
    cairo_line_to (cr,px+pilx,py+pily)
    cairo_set_source_rgba (cr,1,1,1,1)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,0,0,1)
    cairo_arc (cr,px,py,rin3,(math.pi/180),0)
    cairo_fill (cr)
    -----------------------------------
    cairo_set_source_rgba (cr,0,0,0,1)
    cairo_arc (cr,px,py,rin3-1,(math.pi/180),0)
    cairo_fill (cr)
    end--wspeed dial function
    --#############################################################################################################################################################
    function circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
    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);
    local inum=string.len(text)
    local deg=(finish-start)/(inum-1)
    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+radi*(math.sin(interval))
    tys=0-radi*(math.cos(interval))
    cairo_move_to (cr, txs+horiz, tys+verti);
    cairo_rotate (cr, interval)
    cairo_show_text (cr, (texttable[i]))
    cairo_stroke (cr)
    cairo_rotate (cr, -interval)
    end
    end--circlewriting
    --#############################################################################################################################################################
    --#############################################################################################################################################################
    function humidity(x,y,hval1)
    hval=hval1*1.5
    yt=y-1
    rh=200
    rw=30
    local pat = cairo_pattern_create_linear (0,yt,0,yt+rh);
    cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 1, 0);
    cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 1, 1);
    cairo_rectangle (cr,x,yt,rw, rh);
    cairo_set_source (cr, pat);
    cairo_fill (cr);
    cairo_pattern_destroy (pat);
    ----------
    for i=1,11 do
    lwid=-1
    cairo_set_source_rgba (cr,1,1,1,1)
    cairo_move_to (cr,x+rw,(y+150)-((i-1)*15))
    cairo_rel_line_to (cr,lwid,0)
    cairo_stroke(cr)
    end
    ----------
    cairo_set_source_rgba (cr,1,1,1,1)
    hh=5
    hw1=19
    hw2=hw1+10
    if hval==nil then hval=0 end
    tx,ty=x+hw1,(y+150)-(hval+hh)
    ix,iy=x+hw2,(y+150)-hval
    bx,by=x+hw1,(y+150)-(hval-hh)
    cairo_move_to (cr,tx,ty)
    cairo_line_to (cr,ix,iy)
    cairo_line_to (cr,bx,by)
    cairo_line_to (cr,tx,ty)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,1,1,1)
    font="Mono"
    fsize=12
    cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, fsize)
    cairo_move_to (cr,x+hw2+3,(y+150)-(hval-hh))
    cairo_show_text (cr,hval1.."%")
    cairo_stroke (cr)
    label="Taux d'humidité"
    cairo_move_to (cr,x+12,y+150)
    cairo_rotate (cr,(math.pi/180)*(-90))
    cairo_show_text (cr,label)
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(90))
    end--humidity
    --#############################################################################################################################################################
    --#############################################################################################################################################################
    function txt(text,xpos,ypos,font,fsize,red,green,blue,alpha)
    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,red,green,blue,alpha)
    cairo_move_to (cr,xpos,ypos)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end--function txt
    --#############################################################################################################################################################
    --#############################################################################################################################################################
    function barometer(pr,px,py)
    --baromeer 27 inches to 32 inches = 5 inches
    cairo_set_line_width (cr,1)
    local router=100
    cairo_set_source_rgba (cr,0.1,0.1,0.1,1)
    cairo_arc (cr,px,py,router,(math.pi/180),0)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,1,1,1)
    cairo_arc (cr,px,py,router,(math.pi/180),0)
    cairo_stroke (cr)
    local rout1=75
    local rin1=rout1-10
    for i=0,40 do
    if i==5 or i==15 or i==25 or i==35 then
    rout=rout1-7
    cairo_set_line_width (cr,3)
    elseif i==0 or i==10 or i==20 or i==30 or i==40 then
    rout=rout1
    cairo_set_line_width (cr,1)
    else
    rout=rout1-5
    cairo_set_line_width (cr,1)
    end
    arc=(math.pi/180)*(210+(i*(300/40)))
    ppx=0+rout*(math.sin(arc))
    ppy=0-rout*(math.cos(arc))
    arc=(math.pi/180)*(210+(i*300/40))
    pix=0+rin1*(math.sin(arc))
    piy=0-rin1*(math.cos(arc))
    cairo_move_to (cr,px+ppx,py+ppy)
    cairo_line_to (cr,px+pix,py+piy)
    cairo_stroke (cr)
    end
    --inches reading
    inch={28,29,30,31}
    local rout=rout1+2
    for i=1,4 do
    arc=(math.pi/180)*(210+(300/8)+((i-1)*(300/4)))
    ppx=0+rout*(math.sin(arc))
    ppy=0-rout*(math.cos(arc))
    text=inch[i]
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    width=extents.width
    height=extents.height
    cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end
    --942 to 1056
    --27.5=931.25
    --31.5=1066.70
    cairo_set_line_width (cr,1)
    local m1=300/135.45
    local m2=m1*8.75--931.25+8.75=940
    local rout2=60
    local rin2=rout2-5
    local num=60
    for i=0,num do
    if i==0 or i==5 or i==10 or i==15 or i==20 or i==25 or i==30 or i==35 or i==40 or i==45 or i==50 or i==55 or i==60 or i==65 then
    rin=rin2-5
    else
    rin=rin2
    end
    arc=(math.pi/180)*(210+m2+(i*((m1*(num*2))/num)))
    ppx=0+rout2*(math.sin(arc))
    ppy=0-rout2*(math.cos(arc))
    arc=(math.pi/180)*(210+m2+(i*((m1*(num*2))/num)))
    pix=0+rin*(math.sin(arc))
    piy=0-rin*(math.cos(arc))
    cairo_move_to (cr,px+ppx,py+ppy)
    cairo_line_to (cr,px+pix,py+piy)
    cairo_stroke (cr)
    end
    --millibars reading
    inch={940,960,980,1000,1020,1040,1060}
    local rout=rin2-18
    for i=1,7 do
    arc=(math.pi/180)*(210+m2+((i-1)*(m1*20)))
    ppx=0+rout*(math.sin(arc))
    ppy=0-rout*(math.cos(arc))
    text=inch[i]
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    width=extents.width
    height=extents.height
    cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end
    --scale labels
    local text="inches hg"
    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,px-(width/2),py+rin1)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    local text="millibars"
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to (cr,px-(width/2),py+rin2-height)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    local text="Pression"
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to (cr,px-(width/2),py+rin2+35)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    --pointer
    if pr==nil then pr=27.5 end
    local pres=pr-27.5
    local m1=300/4
    local m2=pres*m1
    local rout1=rout1
    local arc=(math.pi/180)*(210+m2)
    local ppx=0+rout1*(math.sin(arc))
    local ppy=0-rout1*(math.cos(arc))
    ------------------------------
    local arc=(math.pi/180)*(210+m2+180)
    local ppox=0+rout1*(math.sin(arc))
    local ppoy=0-rout1*(math.cos(arc))
    -------------------------------
    local rin3=7
    local arc=(math.pi/180)*(210+m2-90)
    local pilx=0+rin3*(math.sin(arc))
    local pily=0-rin3*(math.cos(arc))
    local arc=(math.pi/180)*(210+m2+90)
    local pirx=0+rin3*(math.sin(arc))
    local piry=0-rin3*(math.cos(arc))
    --------------------------------
    cairo_move_to (cr,px+pilx,py+pily)
    cairo_line_to (cr,px+ppx,py+ppy)
    cairo_line_to (cr,px+pirx,py+piry)
    cairo_line_to (cr,px+pilx,py+pily)
    cairo_set_source_rgba (cr,1,0,0,1)
    cairo_fill (cr)
    cairo_arc (cr,px,py,rin3,(math.pi/180),0)
    cairo_fill (cr)
    ---------------------------------
    cairo_move_to (cr,px+pilx,py+pily)
    cairo_line_to (cr,px+ppox,py+ppoy)
    cairo_line_to (cr,px+pirx,py+piry)
    cairo_line_to (cr,px+pilx,py+pily)
    cairo_set_source_rgba (cr,1,1,1,1)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,0,0,1)
    cairo_arc (cr,px,py,rin3,(math.pi/180),0)
    cairo_fill (cr)
    -----------------------------------
    cairo_set_source_rgba (cr,0,0,0,1)
    cairo_arc (cr,px,py,rin3-1,(math.pi/180),0)
    cairo_fill (cr)
    ----text
    local horiz=px
    local verti=py
    local radi=87
    local text="TEMPETE"
    local font="Mono"
    local fsize=12
    local start=250
    local finish=start+((string.len(text))*5)
    circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
    local text="Pluie"
    local start=300
    local finish=start+((string.len(text))*5)
    circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
    local text="Variable"
    local start=340
    local finish=start+((string.len(text))*5)
    circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
    local text="Beau"
    local start=395
    local finish=start+((string.len(text))*5)
    circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
    local text="TRES SEC"
    local start=435
    local finish=start+((string.len(text))*5)
    circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
    end--barometer
    --#############################################################################################################################################################
    --#############################################################################################################################################################
    function compass(wx,wy,rout,wdeg,w,wg)
    local rin=rout-((rout/100)*10)
    cairo_set_source_rgba (cr,0.1,0.1,0.1,1)
    cairo_arc (cr,wx,wy,rout,(math.pi/180),0)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,1,1,1)
    cairo_arc (cr,wx,wy,rout,(math.pi/180),0)
    cairo_stroke (cr)
    for i=1,36 do
    arc=(math.pi/180)*(i*10)
    wpx=0+rout*(math.sin(arc))
    wpy=0-rout*(math.cos(arc))
    arc=(math.pi/180)*(i*10)
    wix=0+rin*(math.sin(arc))
    wiy=0-rin*(math.cos(arc))
    cairo_move_to (cr,wx+wpx,wy+wpy)
    cairo_line_to (cr,wx+wix,wy+wiy)
    cairo_stroke (cr)
    end
    --print directions
    local font="Mono"
    local fsize=10
    cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, fsize)
    dirs={"N","NE","E","SE","S","SO","O","NO"}
    local rdir=rout-((rout/100)*25)
    for i=1,8 do
    arc=(math.pi/180)*((i-1)*(360/8))
    wdx=0+rdir*(math.sin(arc))
    wdy=0-rdir*(math.cos(arc))
    text=dirs[i]
    extents=cairo_text_extents_t:create()
    cairo_text_extents(cr,text,extents)
    width=extents.width
    height=extents.height
    cairo_move_to (cr,wx+wdx-(width/2),wy+wdy+(height/2))
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end
    --indicator
    local npr=rout-((rout/100)*15)
    if wdeg==nil then wdeg=0 end
    local arc=(math.pi/180)*(wdeg)
    local npx=0+npr*(math.sin(arc))
    local npy=0-npr*(math.cos(arc))
    cairo_move_to (cr,wx+npx,wy+npy)
    local nprm=rout-((rout/100)*88)
    local arc=(math.pi/180)*(wdeg+90)
    local npmrx=0+nprm*(math.sin(arc))
    local npmry=0-nprm*(math.cos(arc))
    local arc=(math.pi/180)*(wdeg-90)
    local npmlx=0+nprm*(math.sin(arc))
    local npmly=0-nprm*(math.cos(arc))
    cairo_line_to (cr,wx+npmrx,wy+npmry)
    cairo_line_to (cr,wx+npmlx,wy+npmly)
    cairo_line_to (cr,wx+npx,wy+npy)
    cairo_set_source_rgba (cr,1,0,0,1)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,1,1,1)
    ---------------------------------
    local arc=(math.pi/180)*(wdeg-180)
    local spx=0+npr*(math.sin(arc))
    local spy=0-npr*(math.cos(arc))
    cairo_move_to (cr,wx+spx,wy+spy)
    local sprm=nprm
    local arc=(math.pi/180)*(wdeg+90-180)
    local spmrx=0+sprm*(math.sin(arc))
    local spmry=0-sprm*(math.cos(arc))
    local arc=(math.pi/180)*(wdeg-90-180)
    local spmlx=0+sprm*(math.sin(arc))
    local spmly=0-sprm*(math.cos(arc))
    cairo_line_to (cr,wx+spmrx,wy+spmry)
    cairo_line_to (cr,wx+spmlx,wy+spmly)
    cairo_line_to (cr,wx+spx,wy+spy)
    cairo_fill (cr)
    --------------------------------------
    cairo_set_source_rgba (cr,0,0,0,1)
    cairo_arc (cr,wx,wy,nprm,(math.pi/180),0)
    cairo_fill (cr)
    cairo_set_source_rgba (cr,1,0,0,1)
    cairo_arc (cr,wx,wy,nprm,(math.pi/180),0)
    cairo_stroke (cr)
    ------------------------
    cairo_set_source_rgba (cr,1,1,1,1)
    local text="Rose des Vents"
    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,wx-(width/10),wy-rout-5)
    cairo_show_text (cr,text)
    cairo_stroke (cr)
    end--compass
    --#############################################################################################################################################################
    --
    --#############################################################################################################################################################
    function conky_draw_bg(r,x,y,w,h,color,alpha)
    local function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    if conky_window == nil then return end
    if cs == nil then cairo_surface_destroy(cs) end
    if cr == nil then cairo_destroy(cr) end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local cr = cairo_create(cs)
    cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
    --top left mid circle
    local xtl=x+r
    local ytl=y+r
    --top right mid circle
    local xtr=(x+r)+((w)-(2*r))
    local ytr=y+r
    --bottom right mid circle
    local xbr=(x+r)+((w)-(2*r))
    local ybr=(y+r)+((h)-(2*r))
    --bottom right mid circle
    local xbl=(x+r)
    local ybl=(y+r)+((h)-(2*r))
    -----------------------------
    cairo_move_to (cr,xtl,ytl-r)
    cairo_line_to (cr,xtr,ytr-r)
    cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
    cairo_line_to (cr,xbr+r,ybr)
    cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
    cairo_line_to (cr,xbl,ybl+r)
    cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
    cairo_line_to (cr,xtl-r,ytl)
    cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
    cairo_close_path(cr)
    cairo_fill (cr)
    ------------------------------------------------------------
    cairo_surface_destroy(cs)
    cairo_destroy(cr)
    return ""
    end
    Enjoy !

  4. #21184
    Join Date
    Jul 2012
    Beans
    24

    Re: Post your .conkyrc files w/ screenshots

    Modified Vindsl's conky to have a better Mint flavor and fit my laptop screen.
    Attached Images Attached Images

  5. #21185
    Join Date
    Jun 2012
    Beans
    0

    Re: Post your .conkyrc files w/ screenshots

    I'd Like to use differents circles in lua script and only drawing circles.Do you know how to delete the others functions inside just for keeping the drawing lines ones and writing text ? And then it may be possible to configure them how we want ?
    I try this and it doesn't work, because I don't know anithing in lua...If I show you that you'll have an Allergie or nervous breakdown
    Sorry:
    Code:
     --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
    --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
    --############start of timed section#######################################################################
    --#########################################################################################################
    local updates=tonumber(conky_parse('${updates}'))
    local timer=(updates %secs)+1
    --#######################################
    --if timer==secs or updates==6 then--######
    --#######################################
    --###########################
    --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="PREVISIONS",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)
    
    
    --print current conditions wrap to length
    --wrap settings
    
    
    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))
    	
    	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))
    	
    	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))
    	
    	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))
    	
    	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))
    	
    	cairo_stroke (cr)
    cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
    
    --#########################################################
    --########## end of current conditions ####################
    --######### forecast weather and repeat ###################
    --#########################################################
    
    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
    Last edited by ragamatrix; November 30th, 2012 at 11:41 AM.

  6. #21186
    Join Date
    Jun 2012
    Beans
    0

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    ^ this is the start of code that controls the pointer for wind direction

    Code:
    --pointer 
    if ws==nil then ws=0 end 
    local wspd=ws 
    local m1=300/60 
    local m2=wspd*m1 
    local rout1=rout3
    the print command is extremely useful, i use it all the time when writing and testing scripts

    put a print command in there like this
    Code:
    --pointer 
    if ws==nil then ws=0 end 
    local wspd=ws
    print (wspd)
    local m1=300/60 local m2=wspd*m1 local rout1=rout3
    then launch in terminal and check what value is being fed to the pointer
    Hi;
    I did this and in the terminal the number "6" goes without stopping, what I have to do now...I'm not sure to have understood what you mean...I leave the script like that ? or it was just to make a control ? Sorry for my bad English again.
    Code:
                                    Dload  Upload   Total   Spent    Left  Speed
    100 70954  100 70954    0     0  55200      0  0:00:01  0:00:01 --:--:--  114k
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 70954  100 70954    0     0  92072      0 --:--:-- --:--:-- --:--:--  117k
    6
    6
    6
    6
    6
    6
    6
    6
    6
    6
    6
    6

  7. #21187
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    2,802
    Distro
    Ubuntu Development Release

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by AK44 View Post
    Modified Vindsl's conky to have a better Mint flavor and fit my laptop screen.
    Great job! Love the color combo!

    Here's my latest...


    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  8. #21188
    Join Date
    Jun 2012
    Beans
    0

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by ragamatrix View Post
    I'd Like to use differents circles in lua script and only drawing circles.Do you know how to delete the others functions inside just for keeping the drawing lines ones and writing text ? And then it may be possible to configure them how we want ?
    I try this and it doesn't work, because I don't know anithing in lua...If I show you that you'll have an Allergie or nervous breakdown
    Sorry:
    Code:
     --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
    --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
    --############start of timed section#######################################################################
    --#########################################################################################################
    local updates=tonumber(conky_parse('${updates}'))
    local timer=(updates %secs)+1
    --#######################################
    --if timer==secs or updates==6 then--######
    --#######################################
    --###########################
    --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="PREVISIONS",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)
    
    
    --print current conditions wrap to length
    --wrap settings
    
    
    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))
    	
    	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))
    	
    	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))
    	
    	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))
    	
    	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))
    	
    	cairo_stroke (cr)
    cairo_set_source_rgba (cr,wcr,wcg,wcb,wca)
    
    --#########################################################
    --########## end of current conditions ####################
    --######### forecast weather and repeat ###################
    --#########################################################
    
    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
    Well Sorry about that, I've searched and found a solution wich is may be not in the right way but in test it's working...
    code:
    Code:
      --border
            {x=120, y=380,w=80,h=80,
            --the missing corners are repeated
            corners={ {"circle",40}, {"circle",40}, {"circle",40}, {"circle",40}},
            border=1
            },
    
     }
    Then it's possible to manage circle with every options you want.
    http://pix.toile-libre.org/upload/or...1354283933.png

  9. #21189
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by ragamatrix View Post
    Hi;
    I did this and in the terminal the number "6" goes without stopping, what I have to do now...I'm not sure to have understood what you mean...I leave the script like that ? or it was just to make a control ? Sorry for my bad English again.
    Code:
                                    Dload  Upload   Total   Spent    Left  Speed
    100 70954  100 70954    0     0  55200      0  0:00:01  0:00:01 --:--:--  114k
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 70954  100 70954    0     0  92072      0 --:--:-- --:--:-- --:--:--  117k
    6
    6
    6
    6
    6
    6
    6
    6
    6
    6
    6
    6
    the print command is to test the script
    Code:
    print (wspd)
    from the above we know that wspd=6
    so you can look at the dial and see if it matches up

    there are always a few possibilities, sometimes many, that could cause unexpected behavior

    in this case it could be
    1 - the dial is being fed the wrong number so is displaying the wrong number
    or
    2 - the dial is getting the right number but displaying the wrong number

    using print we can work out which it is

  10. #21190
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    look here for drawing things with cairo
    http://cairographics.org/samples/

    you cant take the code directly from this page into lua

    for example this line from the page
    Code:
    double angle1 = 45.0  * (M_PI/180.0);  /* angles are specified */
    would be this
    Code:
    angle1 = 45.0  * (math.pi/180.0); -- angles are specified */

Page 2119 of 2284 FirstFirst ... 1119161920192069210921172118211921202121212921692219 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •