Re: My Conky Config

yah, and just to be clear--torarm has a million features; i'm most interested in the running data visualisations that it has.

1,527

Re: My Conky Config

djyoung4 wrote:

Tor isn't a bittorrent program.  Its similar to a proxy. Heres there website: http://www.torproject.org/ and the wiki: http://en.wikipedia.org/wiki/Tor_%28ano … network%29

DO'H! {blush}

1,528

Re: My Conky Config

parkbench wrote:

yah, and just to be clear--torarm has a million features; i'm most interested in the running data visualisations that it has.

Sorry for the mistake.  I wish you luck.  I don't use it.

1,529

Re: My Conky Config

UPDATE 02/18/2011
here you can find the most up to date version of the myan clock/calendar wit the 17 fix

--yearclock by mrpeachy 2010 version3, fixed 17 bug
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 circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
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, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_rotate (cr, -interval2)
cairo_move_to (cr,0,0)
cairo_set_source_rgba (cr, 0, 0, 0, 0)
cairo_line_to (cr,hx0,hy0)
cairo_stroke (cr)
end
end

function date_to_words()------------------------------------------------------------------------------------------
date=os.date("%d")
datecut=string.gsub(date, ".", "%1|")
datetable=string.split(datecut, "|")
        
        if datetable[1]=="1" then
            datetens=""
            datespacer=""
            if datetable[2]=="0" then
            dateunit="tenth"
            elseif datetable[2]=="1" then
            dateunit="eleventh"
            elseif datetable[2]=="2" then
            dateunit="twelfth"
            elseif datetable[2]=="3" then
            dateunit="thirteenth"
            elseif datetable[2]=="4" then
            dateunit="fourteenth"
            elseif datetable[2]=="5" then
            dateunit="fifteenth"
            elseif datetable[2]=="6" then
            dateunit="sixteenth"
            elseif datetable[2]=="7" then
            fisrtdigit="seventeenth"
            elseif datetable[2]=="8" then
            dateunit="eighteenth"
            elseif datetable[2]=="9" then
            dateunit="nineteenth"
            end
        end 
          
        if datetable[1]=="0" or datetable[1]>"1" then
            datespacer=" "
            if datetable[1]=="2" then
            datetens="twenty"
            elseif datetable[1]=="3" then
            datetens="thirty"
            elseif datetable[1]=="0" then
            datetens=""
            end 
            if datetable[2]=="1" then
            dateunit="first"
            elseif datetable[2]=="2" then
            dateunit="second"
            elseif datetable[2]=="3" then
            dateunit="third"
            elseif datetable[2]=="4" then
            dateunit="fourth"
            elseif datetable[2]=="5" then
            dateunit="fifth"
            elseif datetable[2]=="6" then
            dateunit="sixth"
            elseif datetable[2]=="7" then
            dateunit="seventh"
            elseif datetable[2]=="8" then
            dateunit="eighth"
            elseif datetable[2]=="9" then
            dateunit="nineth"
            elseif datetable[2]=="0" then
            dateunit=""
            datespacer=""
            end
        end
        if datetable[2]=="0" then
            datetens=""
            datespacer=""
            if datetable[1]=="2" then
            dateunit="twentieth"
            elseif datetable[1]=="3" then
            dateunit="thirtieth"
            end
        end    
    return ((datetens) .. (datespacer) .. (dateunit))
end--end of function--------------------------------------------------------------------------------------

function number_to_words(text)
text=tonumber(text)
textlength=tonumber(string.len(text))
textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
--for NUMBERS from 1 to 999
--for 1 digit number----------
if textlength==1 then
    if tonumber(texttable[1])==1 then
    firstdigit="one"
    elseif tonumber(texttable[1])==2 then
    firstdigit="two"
    elseif tonumber(texttable[1])==3 then
    firstdigit="three"
    elseif tonumber(texttable[1])==4 then
    firstdigit="four"
    elseif tonumber(texttable[1])==5 then
    firstdigit="five"
    elseif tonumber(texttable[1])==6 then
    firstdigit="six"
    elseif tonumber(texttable[1])==7 then
    firstdigit="seven"
    elseif tonumber(texttable[1])==8 then
    firstdigit="eight"
    elseif tonumber(texttable[1])==9 then
    firstdigit="nine"
    elseif tonumber(texttable[1])==0 then
    firstdigit="zero"
    end
return (firstdigit)
end
--for 2 digit number------------------
if textlength==2 then
    if tonumber(texttable[1])==1 then
        seconddigit=""
        spacer=""
        if tonumber(texttable[2])==0 then
        firstdigit="ten"
        elseif tonumber(texttable[2])==1 then
        firstdigit="eleven"
        elseif tonumber(texttable[2])==2 then
        firstdigit="twelve"
        elseif tonumber(texttable[2])==3 then
        firstdigit="thirteen"
        elseif tonumber(texttable[2])==4 then
        firstdigit="fourteen"
        elseif tonumber(texttable[2])==5 then
        firstdigit="fifteen"
        elseif tonumber(texttable[2])==6 then
        firstdigit="sixteen"
        elseif tonumber(texttable[2])==7 then
        fisrtdigit="seventeen"
        elseif tonumber(texttable[2])==8 then
        firstdigit="eighteen"
        elseif tonumber(texttable[2])==9 then
        firstdigit="nineteen"
        end
    end   
    if tonumber(texttable[1])>1 then
        spacer=" "
        if tonumber(texttable[1])==2 then
        seconddigit="twenty"
        elseif tonumber(texttable[1])==3 then
        seconddigit="thirty"
        elseif tonumber(texttable[1])==4 then
        seconddigit="fourty"
        elseif tonumber(texttable[1])==5 then
        seconddigit="fifty"
        elseif tonumber(texttable[1])==6 then
        seconddigit="sixty"
        elseif tonumber(texttable[1])==7 then
        seconddigit="seventy"
        elseif tonumber(texttable[1])==8 then
        seconddigit="eighty"
        elseif tonumber(texttable[1])==9 then
        seconddigit="ninety"
        end
    
        if tonumber(texttable[2])==1 then
        firstdigit="one"
        elseif tonumber(texttable[2])==2 then
        firstdigit="two"
        elseif tonumber(texttable[2])==3 then
        firstdigit="three"
        elseif tonumber(texttable[2])==4 then
        firstdigit="four"
        elseif tonumber(texttable[2])==5 then
        firstdigit="five"
        elseif tonumber(texttable[2])==6 then
        firstdigit="six"
        elseif tonumber(texttable[2])==7 then
        firstdigit="seven"
        elseif tonumber(texttable[2])==8 then
        firstdigit="eight"
        elseif tonumber(texttable[2])==9 then
        firstdigit="nine"
        elseif tonumber(texttable[2])==0 then
        firstdigit=""
        spacer=""
        end
     end
return ((seconddigit) .. (spacer) .. (firstdigit))
end

--for 3 digit numbers-----------------------------
if textlength==3 then
    if tonumber(texttable[2])==0 and tonumber(texttable[3])==0 then space="" end
    if tonumber(texttable[2])>0 or tonumber(texttable[3])>0 then space=" and " end
    if tonumber(texttable[2])==0 and tonumber(texttable[3])>0 then spacer="" end
    
    if tonumber(texttable[1])==1 then
    thirddigit="one hundred"
    elseif tonumber(texttable[1])==2 then
    thirddigit="two hundred"
    elseif tonumber(texttable[1])==3 then
    thirddigit="three hundred"
    elseif tonumber(texttable[1])==4 then
    thirddigit="four hundred"
    elseif tonumber(texttable[1])==5 then
    thirddigit="five hundred"
    elseif tonumber(texttable[1])==6 then
    thirddigit="six hundred"
    elseif tonumber(texttable[1])==7 then
    thirddigit="seven hundred"
    elseif tonumber(texttable[1])==8 then
    thirddigit="eight hundred"
    elseif tonumber(texttable[1])==9 then
    thirddigit="nine hundred"
    end
    if tonumber(texttable[2])==0 or tonumber(texttable[2])>1 then
        if tonumber(texttable[3])==1 then
        firstdigit="one"
        elseif tonumber(texttable[3])==2 then
        firstdigit="two"
        elseif tonumber(texttable[3])==3 then
        firstdigit="three"
        elseif tonumber(texttable[3])==4 then
        firstdigit="four"
        elseif tonumber(texttable[3])==5 then
        firstdigit="five"
        elseif tonumber(texttable[3])==6 then
        firstdigit="six"
        elseif tonumber(texttable[3])==7 then
        firstdigit="seven"
        elseif tonumber(texttable[3])==8 then
        firstdigit="eight"
        elseif tonumber(texttable[3])==9 then
        firstdigit="nine"
        elseif tonumber(texttable[3])==0 then
        firstdigit=""
        spacer=""
        end 
    end
    if tonumber(texttable[2])==1 then
        seconddigit=""
        spacer=""  
        if tonumber(texttable[3])==0 then
        firstdigit="ten"
        elseif tonumber(texttable[3])==1 then
        firstdigit="eleven"
        elseif tonumber(texttable[3])==2 then
        firstdigit="twelve"
        elseif tonumber(texttable[3])==3 then
        firstdigit="thirteen"
        elseif tonumber(texttable[3])==4 then
        firstdigit="fourteen"
        elseif tonumber(texttable[3])==5 then
        firstdigit="fifteen"
        elseif tonumber(texttable[3])==6 then
        firstdigit="sixteen"
        elseif tonumber(texttable[3])==7 then
        firstdigit="seventeen"
        elseif tonumber(texttable[3])==8 then
        firstdigit="eighteen"
        elseif tonumber(texttable[3])==9 then
        firstdigit="nineteen"
        end
    end
    if tonumber(texttable[2])>1 then
        spacer=" "    
        if tonumber(texttable[2])==2 then
        seconddigit="twenty"
        elseif tonumber(texttable[2])==3 then
        seconddigit="thirty"
        elseif tonumber(texttable[2])==4 then
        seconddigit="fourty"
        elseif tonumber(texttable[2])==5 then
        seconddigit="fifty"
        elseif tonumber(texttable[2])==6 then
        seconddigit="sixty"
        elseif tonumber(texttable[2])==7 then
        seconddigit="seventy"
        elseif tonumber(texttable[2])==8 then
        seconddigit="eighty"
        elseif tonumber(texttable[2])==9 then
        seconddigit="ninety"
        elseif tonumber(texttable[2])==0 then
        seconddigit=""
        end
    end
return ((thirddigit) .. (space) .. (seconddigit) .. (spacer) .. (firstdigit))
end
end--of function

function conky_draw_fig()
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
--##########################################
cairo_set_line_width (cr,1)
hx0=200
hy0=200
radius=40
--############################################
--months of the year---------------------------------------------------------------------------------------------------
mnrad1=radius
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--draw circles
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
--calculations
year4num=os.date("%Y")
t1 = os.time( {    year=year4num,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year4num,month=02,day=01,hour=00,min=0,sec=0} );
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
yeardays=31+febdaynum+31+30+31+30+31+31+30+31+30+31
yearsec=(yeardays*24*60*60)
jan=31*24*60*60
feb=jan+(febdaynum*24*60*60)
mar=feb+(31*24*60*60)
apr=mar+(30*24*60*60)
may=apr+(31*24*60*60)
jun=may+(30*24*60*60)
jul=jun+(31*24*60*60)
aug=jul+(31*24*60*60)
sep=aug+(30*24*60*60)
oct=sep+(31*24*60*60)
nov=oct+(30*24*60*60)
dec=nov+(31*24*60*60)
secdays = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }
--circle indicator lines
for i=1,12 do
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
--indicator
doy=tonumber(os.date("%j"))
yrsecs=((doy-1)*24*60*60)+(tonumber(os.date('%H'))*60*60)+(tonumber(os.date('%M'))*60)+(tonumber(os.date('%S')))
mnrad3=mnrad2+10
arc=(2*math.pi/360)*((360/yearsec)*(yrsecs))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))+4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))-4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)
--circlewriting
--######################################################################--
--------------------patch for 17 bug--------------------------------------
year2d=os.date('%y')
if year2d==17 then
text1=((string.upper(os.date('%B'))) .. " TWO THOUSAND AND SEVENTEEN")
else
text1=((string.upper(os.date('%B'))) .. " TWO THOUSAND AND " .. string.upper(number_to_words(year2d)))
end
--######################################################################
--text must be in quotes
text=text1
--font name must be in quotes
font="mono"
fontsize=10
radius=mnrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/yearsec)*((yrsecs))+4)
slen2=string.len(text)
finish=start+270
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--end of months around year-------------------------------------------------------------------------------------------------------------------------------
--##########################################################################################
--days around month----------------------------------------------------------------------
drad1=mnrad3
drad2=drad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--draw circles
cairo_arc (cr,hx0,hy0,drad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,drad2,0,2*math.pi)
cairo_stroke (cr)
--calculations
monthnum=(tonumber(os.date('%m')))
monthdays = { 31, febdaynum, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
--drawin circle indicator lines
for i=1,monthdays[monthnum] do
arc=((2*math.pi/360)*((360/monthdays[monthnum])*(i)))
dx1=0+drad1*(math.sin(arc))
dy1=0-drad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/monthdays[monthnum])*(i)))
dx2=0+drad2*(math.sin(arc))
dy2=0-drad2*(math.cos(arc))
cairo_move_to (cr,hx0+dx1,hy0+dy1)
cairo_line_to (cr,hx0+dx2,hy0+dy2)
cairo_stroke (cr)
end
--indicator
daynumsec=(tonumber(os.date('%d'))*24*60*60)+(tonumber(os.date('%H'))*60*60)+(tonumber(os.date('%M'))*60)+(tonumber(os.date('%S')))
monthnumsec=(monthdays[monthnum])*24*60*60
drad3=drad2+10
arc=(2*math.pi/360)*((360/monthnumsec)*(daynumsec))
dx1=0+drad2*(math.sin(arc))
dy1=0-drad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthnumsec)*((daynumsec))+4)
dx2=0+drad3*(math.sin(arc))
dy2=0-drad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthnumsec)*((daynumsec))-4)
dx3=0+drad3*(math.sin(arc))
dy3=0-drad3*(math.cos(arc))
cairo_move_to (cr,hx0+dx1,hy0+dy1)
cairo_line_to (cr,hx0+dx2,hy0+dy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+dx1,hy0+dy1)
cairo_line_to (cr,hx0+dx3,hy0+dy3)
cairo_stroke (cr)
--circlewriting
--########################################--
-------------patch for 17 bug---------------
days=tonumber(os.date("%d"))
if days==17 then text1=((string.upper(os.date('%A'))) .. " THE SEVENTEENTH")
else
text1=((string.upper(os.date('%A'))) .. " THE " .. string.upper(date_to_words()))
end
--########################################--
--text must be in quotes
text=text1
--font name must be in quotes
font="mono"
fontsize=10
radius=drad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/monthnumsec)*(daynumsec)+4)
slen1=string.len(text)
finish=start+(7.5*slen1)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--end of days around month-------------------------------------------------------------------------------------------------------
--####################################################################################################################################
--hours around day ---------------------------------------------------------------------------------------------------------------------
hrad1=drad3
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--draw eings
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
--draw ring indicator lines
for i=1,24 do
arc=((2*math.pi/360)*((360/24)*i))
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/24)*i))
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
--indicator
hrsec=(tonumber(os.date('%H'))*60*60)+(tonumber(os.date('%M'))*60)+(tonumber(os.date('%S')))
--mns=mn+sc
hrad3=hrad2+10
arc=((2*math.pi/360)*((360/(24*60*60)*hrsec)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrsec)-4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrsec)+4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)
--circlewriting
hrnum=tonumber(os.date('%H'))
if hrnum==1 then hour="HOUR"
else hour="HOURS" end
--########################################--
-------------patch for 17 bug---------------
if hrnum==17 then text4="SEVENTEEN HOURS"
else
text4=((string.upper(number_to_words(hrnum))) .. " " .. hour)
end
--########################################--
--text must be in quotes
text=text4
--font name must be in quotes
font="mono"
fontsize=10
radius=hrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/(24*60*60))*(hrsec)+4)
slen4=string.len(text)
finish=start+(slen4*5)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--end of hours around day----------------------------------------------------------------------------------------------------
--##############################################################################################################################
--minutes around hour--------------------------------------------------------------------------------------------------------------
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--draw circles
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
--draw circle indicator lines
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
--indicator
minsec=(tonumber(os.date('%M'))*60)+(tonumber(os.date('%S')))
mrad3=mrad2+10
arc=((2*math.pi/360)*((360/(60*60)*minsec)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(minsec)-4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(minsec)+4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)
--circlewriting
min=tonumber(os.date('%M'))
if min==1 then minute="MINUTE"
else minute="MINUTES" end
--########################################--
-------------patch for 17 bug---------------
if min==17 then text4="SEVENTEEN MINUTES"
else
text4=((string.upper(number_to_words(min))) .. " " .. minute)
end
--########################################--
text=text4
--font name must be in quotes
font="mono"
fontsize=10
radius=mrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/(60*60))*(minsec)+4)
slen4=string.len(text)
finish=start+(slen4*5)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--end minutes around hour--------------------------------------------------------------------------------------
--seconds of minute-------------------------------------------------------------------------------------------
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--draw circles
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
--draw circle indicator lines
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
--indicator
sec=(tonumber(os.date('%S')))
srad3=srad2+10
arc=((2*math.pi/360)*((360/(60)*sec)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sec))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sec))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad3,0,2*math.pi)
cairo_stroke (cr)
--circlewriting
--circlewriting variable
sec=tonumber(os.date('%S'))
if sec==1 then second="SECOND"
else second="SECONDS" end
--########################################--
-------------patch for 17 bug---------------
if sec==17 then text3="SEVENTEEN SECONDS"
else
text3=(string.upper(number_to_words(sec)) .. " " .. second)
end
--########################################--
--text must be in quotes
text=text3
--font name must be in quotes
font="mono"
fontsize=10
radius=srad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/60)*((sec))+4)
slen3=string.len(text)
finish=start+(slen3*5)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--end seconds of minute-----------------------------------------------------------------------------------------------------------------------------
--end of calendar---------------------------------------------------------------------------------------------------
end--of if updates>5
end--of main function

still working on a multiple ring year,month,day,hour etc clock...

here is the latest incarnation smile

http://ompldr.org/tNm9zZw

top shows conky working at a modest 1% which is an improvement over last time

it takes into account leap years and the month segments are proportional to the number of days in the month

maybe i could add an inner ring for century?

anyway this is what does it

--yearclock by mrpeachy 2010
require 'cairo'

function conky_draw_fig()
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

cairo_set_line_width (cr,1)
hx0=200
hy0=200
hrad1=80
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,24 do
arc=((2*math.pi/360)*((360/24)*i))
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/24)*i))
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
hr=os.date("%H")*60*60
mn=os.date("%M")*60
sc=os.date("%S")
hrs=hr+mn+sc
mns=mn+sc
hrad3=hrad2+10
arc=((2*math.pi/360)*((360/(24*60*60)*hrs)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)-4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)+4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)
--minutes
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
mrad3=mrad2+10
arc=((2*math.pi/360)*((360/(60*60)*mns)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)-4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)+4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)
--seconds
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
srad3=srad2+10
arc=((2*math.pi/360)*((360/(60)*sc)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad3,0,2*math.pi)
cairo_stroke (cr)
--year
month=os.date("%m")
day=os.date("%d")
mnrad1=hrad1-40
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
--lines of months
jan=31*24*60*60
feb=jan+(feb*24*60*60)
mar=feb+(31*24*60*60)
apr=mar+(30*24*60*60)
may=apr+(31*24*60*60)
jun=may+(30*24*60*60)
jul=jun+(31*24*60*60)
aug=jul+(31*24*60*60)
sep=aug+(30*24*60*60)
oct=sep+(31*24*60*60)
nov=oct+(30*24*60*60)
dec=nov+(31*24*60*60)
secdays = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
yeardays=31+feb+31+30+31+30+31+31+30+31+30+31
for i=1,12 do
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
yearsec=(yeardays*24*60*60)
hr=os.date("%I")
doy=os.date("%j")
yrsecs=((doy-1)*24*60*60)+(sc)+(mn*60)+(hr*60*60)
mnrad3=mnrad2+10
arc=(2*math.pi/360)*((360/yearsec)*(yrsecs))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))+4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))-4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)

--month
yrad1=mnrad3
yrad2=yrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,yrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,yrad2,0,2*math.pi)
cairo_stroke (cr)
monthdays = { 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
for i=1,monthdays[tonumber(month)] do
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx1=0+yrad1*(math.sin(arc))
yy1=0-yrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx2=0+yrad2*(math.sin(arc))
yy2=0-yrad2*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
end

yrad3=yrad2+10
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*(day))
yx1=0+yrad2*(math.sin(arc))
yy1=0-yrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))+4)
yx2=0+yrad3*(math.sin(arc))
yy2=0-yrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))-4)
yx3=0+yrad3*(math.sin(arc))
yy3=0-yrad3*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx3,hy0+yy3)
cairo_stroke (cr)
end
end

and here with some additional system info... cpu, mem, and hd usage
http://ompldr.org/tNm90NA
for those eagle eyed enough to notice, january was looking a little on the small side (coz it was actually february)... fixed in code above

Last edited by mrpeachy (2011-02-18 21:33:02)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,530

Re: My Conky Config

mrpeachy wrote:

and here with some additional system info... cpu, mem, and hd usage
http://ompldr.org/tNm90NA
for those eagle eyed enough to notice, january was looking a little on the small side (coz it was actually february)... fixed in code above

You must be kidding, I went cross eyed just counting the months ... forget days, hours, minutes and seconds.

Now centuries I could probably manage.  lol

I have to admit though it is an intriguing  piece of work.

1,531

Re: My Conky Config

mrpeachy wrote:

still working on a multiple ring year,month,day,hour etc clock...

here is the latest incarnation smile

http://ompldr.org/tNm9zZw

top shows conky working at a modest 1% which is an improvement over last time

it takes into account leap years and the month segments are proportional to the number of days in the month

maybe i could add an inner ring for century?

anyway this is what does it

[...]

and here with some additional system info... cpu, mem, and hd usage
http://ompldr.org/tNm90NA
for those eagle eyed enough to notice, january was looking a little on the small side (coz it was actually february)... fixed in code above

It looks like a maya calendar tongue

"I'd rather run Linux on a 6.5KHz machine through an ARM emulator than run Vista"

1,532

Re: My Conky Config

@sector11 - apologies for the eye strain!  i have an idea to increase readability smile ...

@SuNjACk - yes, it did turn out a bit mayan
http://www.december2012endofworld.com/m … endar-2012
would be cool to have symbols all over it, and a face in the middle smile

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,533

Re: My Conky Config

mrpeachy wrote:

@sector11 - apologies for the eye strain!  i have an idea to increase readability smile ...

shhhhhhhh, it's an age thing.  smile

mrpeachy wrote:

@SuNjACk - yes, it did turn out a bit mayan
http://www.december2012endofworld.com/m … endar-2012
would be cool to have symbols all over it, and a face in the middle smile

OK, Pick one:

http://dl.dropbox.com/u/16070765/thmb_masks.png

Trim it just inside the frame and have at it.  big_smile
I'm kinda partial to the one dead centre, although the one immediately to the left of that looks more like me.  lol

And just because I couldn't stop myself!
http://dl.dropbox.com/u/16070765/thmb_2012_explained.png

Last edited by Sector11 (2010-12-23 16:39:48)

1,534

Re: My Conky Config

Sector11 wrote:

And just because I couldn't stop myself!
http://dl.dropbox.com/u/16070765/thmb_2012_explained.png

I love this comic.  especially when I show it to people who believe the world is gonna end in 2012.  They just try and come up with some stupid argument about how they made the calendar in a line and then rolled it up into a circle.  Anyway im liking the rings alot mrpeachy.  Ill probably put it on my laptop the next time I turn it on.

You can't handle the truth...or conky

1,535

Re: My Conky Config

djyoung4 wrote:
Sector11 wrote:

And just because I couldn't stop myself!
http://dl.dropbox.com/u/16070765/thmb_2012_explained.png

I love this comic.  especially when I show it to people who believe the world is gonna end in 2012.  They just try and come up with some stupid argument about how they made the calendar in a line and then rolled it up into a circle.  Anyway im liking the rings alot mrpeachy.  Ill probably put it on my laptop the next time I turn it on.

Did you see what I put up in the Coffee is a Food Group thread?
Lets meet for a coffee (online - less $$ in airfare) in 728 days. I'm an optimist!

We may never know The True Meaning of the Mayan Calendar - but that's an interesting read.

And I can tell you exactly when the world is going to end .... when I stop breathing!  What I can't tell you is when that is going to be ... I have a lot of years left --- maybe, maybe n....{blink} oh, it's just the lights!  lol

I'd like to try that script but mrpeachy didn't post what is needed above TEXT ... I know there are a couple of lines but ........

Merry Christmas

Last edited by Sector11 (2010-12-24 22:36:42)

1,536

Re: My Conky Config

its the regular

lua_load /~wherever you put the file~/filename.lua
lua_draw_hook_pre draw_fig

and here is the code for the clock and indicator rings in case anyone wants it
need to write a ring drawing function so that setup is easier

the only particularly complicated bit was to calculate the month and year ring, everything else is pretty straight forward

--yearclock by mrpeachy 2010
require 'cairo'

function conky_draw_fig()
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

cairo_set_line_width (cr,1)
hx0=200
hy0=200
hrad1=80
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,24 do
arc=((2*math.pi/360)*((360/24)*i))
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/24)*i))
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
hr=os.date("%H")*60*60
mn=os.date("%M")*60
sc=os.date("%S")
hrs=hr+mn+sc
mns=mn+sc
hrad3=hrad2+10
arc=((2*math.pi/360)*((360/(24*60*60)*hrs)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)-4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)+4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)
--minutes
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
mrad3=mrad2+10
arc=((2*math.pi/360)*((360/(60*60)*mns)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)-4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)+4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)
--seconds
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
srad3=srad2+10
arc=((2*math.pi/360)*((360/(60)*sc)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad3,0,2*math.pi)
cairo_stroke (cr)
--year
month=os.date("%m")
day=os.date("%d")
mnrad1=hrad1-40
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
--lines of months
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
jan=31*24*60*60
feb=jan+(feb*24*60*60)
mar=feb+(31*24*60*60)
apr=mar+(30*24*60*60)
may=apr+(31*24*60*60)
jun=may+(30*24*60*60)
jul=jun+(31*24*60*60)
aug=jul+(31*24*60*60)
sep=aug+(30*24*60*60)
oct=sep+(31*24*60*60)
nov=oct+(30*24*60*60)
dec=nov+(31*24*60*60)
secdays = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
yeardays=31+feb+31+30+31+30+31+31+30+31+30+31
yearsec=(yeardays*24*60*60)
for i=1,12 do
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
hr=os.date("%I")
doy=os.date("%j")
yrsecs=((doy-1)*24*60*60)+(sc)+(mn*60)+(hr*60*60)
mnrad3=mnrad2+10
arc=(2*math.pi/360)*((360/yearsec)*(yrsecs))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))+4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))-4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)
--month
yrad1=mnrad3
yrad2=yrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,yrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,yrad2,0,2*math.pi)
cairo_stroke (cr)
monthdays = { 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
for i=1,monthdays[tonumber(month)] do
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx1=0+yrad1*(math.sin(arc))
yy1=0-yrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx2=0+yrad2*(math.sin(arc))
yy2=0-yrad2*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
end
yrad3=yrad2+10
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*(day))
yx1=0+yrad2*(math.sin(arc))
yy1=0-yrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))+4)
yx2=0+yrad3*(math.sin(arc))
yy2=0-yrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))-4)
yx3=0+yrad3*(math.sin(arc))
yy3=0-yrad3*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx3,hy0+yy3)
cairo_stroke (cr)
--system monitor
--cpu
cairo_set_line_width (cr,1)
hx0=385
hy0=383
hrad1=40
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=(2*math.pi/100)*i
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=(2*math.pi/100)*i
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
cpu=conky_parse('${cpu}')
hrad3=hrad2+10
arc=(2*math.pi/360)*((360/100)*((cpu)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((cpu))+4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((cpu))-4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)
--memory
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=(2*math.pi/100)*i
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=(2*math.pi/100)*i
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
mem=tonumber(conky_parse('${memperc}'))
mrad3=mrad2+10
arc=(2*math.pi/360)*((360/100)*((mem)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((mem))+4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((mem))-4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)
--fs_used root
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=((2*math.pi/360)*((360/100)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/100)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
fsr=conky_parse('${fs_used_perc /}')
srad3=srad2+10
arc=((2*math.pi/360)*((360/(100)*fsr)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsr))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsr))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
--fs used home
mnrad1=srad3
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=((2*math.pi/360)*((360/100)*i))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/100)*i))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
fsh=conky_parse('${fs_used_perc /home}')
mnrad3=mnrad2+10
arc=((2*math.pi/360)*((360/(100)*fsh)))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsh))-4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsh))+4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad3,0,2*math.pi)
cairo_stroke (cr)
end
end

and i found a nice mayan dingbats font...so maybe a bit of circlewriting to add some glyphs smile
merry christmas!

Last edited by mrpeachy (2010-12-25 04:34:03)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,537

Re: My Conky Config

mrpeachy wrote:

its the regular

lua_load /~wherever you put the file~/filename.lua
lua_draw_hook_pre draw_fig

and here is the code for the clock and indicator rings in case anyone wants it
need to write a ring drawing function so that setup is easier
{snip}
and i found a nice mayan dingbats font...so maybe a bit of circlewriting to add some glyphs smile
merry christmas!

it's the second line I had a problem with "draw_fig"  big_smile

I'll try it in a bit ...

Merry Christmas!

1,538

Re: My Conky Config

Well, I did more than "try it" I took the second set of circles out (commented out), and added the Mayan masks.  There are 12 of them and will change every month.

I have to show my entire desktop to show why I clipped the second set of circles.
http://dl.dropbox.com/u/16070765/thmb_Mayan_Clock.png
So why did I take the other circles out: It's called: No room!

The conky:

# To use #! in a conky use: ${exec echo '#!'}
# OB_topconky

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints below,skip_taskbar,skip_pager
own_window_title mayan-time
own_window_class mayan-time

background no
border_inner_margin 0
border_width 0
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
no_buffers yes
override_utf8_locale yes
pad_percents 2
short_units yes
stippled_borders 0
text_buffer_size 1028
uppercase no
use_spacer right
use_xft yes
xftfont Zekton:bold:size=10
xftalpha 1.0

# Colors
default_color DCDCDC #Gainsboro
color0 FFFFF0 #Ivory
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

imlib_cache_size 0

update_interval 2
gap_x 700 # left &right
gap_y 320 # up & down
minimum_size 340 340 # width, height
alignment tl

# -- Lua load -- #
lua_load ~/Conky/scripts/mayan.lua
lua_draw_hook_pre draw_fig


TEXT
${if_match ${time %m} == 01}${image ~/Conky/images/Mayan/jan.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 02}${image ~/Conky/images/Mayan/feb.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 03}${image ~/Conky/images/Mayan/mar.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 04}${image ~/Conky/images/Mayan/apr.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 05}${image ~/Conky/images/Mayan/may.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 06}${image ~/Conky/images/Mayan/jun.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 07}${image ~/Conky/images/Mayan/jul.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 08}${image ~/Conky/images/Mayan/aug.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 09}${image ~/Conky/images/Mayan/sep.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 10}${image ~/Conky/images/Mayan/oct.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 11}${image ~/Conky/images/Mayan/nov.png -p 171,171 -s 56x56}${else}${if_match ${time %m} == 12}${image ~/Conky/images/Mayan/dec.png -p 171,171 -s 56x56}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

The modified Lua script (the images may need adjusting if you use the full script, I didn't try it) it is the complete LUA file, with the bottom part commented out.

--yearclock by mrpeachy 2010
require 'cairo'

function conky_draw_fig()
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

cairo_set_line_width (cr,1)
hx0=200
hy0=200
hrad1=80
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,24 do
arc=((2*math.pi/360)*((360/24)*i))
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/24)*i))
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
hr=os.date("%H")*60*60
mn=os.date("%M")*60
sc=os.date("%S")
hrs=hr+mn+sc
mns=mn+sc
hrad3=hrad2+10
arc=((2*math.pi/360)*((360/(24*60*60)*hrs)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)-4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)+4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)
--minutes
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
mrad3=mrad2+10
arc=((2*math.pi/360)*((360/(60*60)*mns)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)-4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)+4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)
--seconds
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
srad3=srad2+10
arc=((2*math.pi/360)*((360/(60)*sc)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad3,0,2*math.pi)
cairo_stroke (cr)
--year
month=os.date("%m")
day=os.date("%d")
mnrad1=hrad1-40
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
--lines of months
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
jan=31*24*60*60
feb=jan+(feb*24*60*60)
mar=feb+(31*24*60*60)
apr=mar+(30*24*60*60)
may=apr+(31*24*60*60)
jun=may+(30*24*60*60)
jul=jun+(31*24*60*60)
aug=jul+(31*24*60*60)
sep=aug+(30*24*60*60)
oct=sep+(31*24*60*60)
nov=oct+(30*24*60*60)
dec=nov+(31*24*60*60)
secdays = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
yeardays=31+feb+31+30+31+30+31+31+30+31+30+31
yearsec=(yeardays*24*60*60)
for i=1,12 do
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
hr=os.date("%I")
doy=os.date("%j")
yrsecs=((doy-1)*24*60*60)+(sc)+(mn*60)+(hr*60*60)
mnrad3=mnrad2+10
arc=(2*math.pi/360)*((360/yearsec)*(yrsecs))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))+4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))-4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)
--month
yrad1=mnrad3
yrad2=yrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,yrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,yrad2,0,2*math.pi)
cairo_stroke (cr)
monthdays = { 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
for i=1,monthdays[tonumber(month)] do
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx1=0+yrad1*(math.sin(arc))
yy1=0-yrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx2=0+yrad2*(math.sin(arc))
yy2=0-yrad2*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
end
yrad3=yrad2+10
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*(day))
yx1=0+yrad2*(math.sin(arc))
yy1=0-yrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))+4)
yx2=0+yrad3*(math.sin(arc))
yy2=0-yrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))-4)
yx3=0+yrad3*(math.sin(arc))
yy3=0-yrad3*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx3,hy0+yy3)
cairo_stroke (cr)
--system monitor
--cpu
--cairo_set_line_width (cr,1)
--hx0=385
--hy0=383
--hrad1=40
--hrad2=hrad1+10
--br1,bg1,bb1,ba1=1,1,1,1
--cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
--cairo_stroke (cr)
--cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
--cairo_stroke (cr)
--for i=1,100 do
--arc=(2*math.pi/100)*i
--hx1=0+hrad1*(math.sin(arc))
--hy1=0-hrad1*(math.cos(arc))
--arc=(2*math.pi/100)*i
--hx2=0+hrad2*(math.sin(arc))
--hy2=0-hrad2*(math.cos(arc))
--cairo_move_to (cr,hx0+hx1,hy0+hy1)
--cairo_line_to (cr,hx0+hx2,hy0+hy2)
--cairo_stroke (cr)
--end
--cpu=conky_parse('${cpu}')
--hrad3=hrad2+10
--arc=(2*math.pi/360)*((360/100)*((cpu)))
--hx1=0+hrad2*(math.sin(arc))
--hy1=0-hrad2*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((cpu))+4)
--hx2=0+hrad3*(math.sin(arc))
--hy2=0-hrad3*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((cpu))-4)
--hx3=0+hrad3*(math.sin(arc))
--hy3=0-hrad3*(math.cos(arc))
--cairo_move_to (cr,hx0+hx1,hy0+hy1)
--cairo_line_to (cr,hx0+hx2,hy0+hy2)
--cairo_stroke (cr)
--cairo_move_to (cr,hx0+hx1,hy0+hy1)
--cairo_line_to (cr,hx0+hx3,hy0+hy3)
--cairo_stroke (cr)
----memory
--mrad1=hrad3
--mrad2=mrad1+10
--br1,bg1,bb1,ba1=1,1,1,1
--cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
--cairo_stroke (cr)
--cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
--cairo_stroke (cr)
--for i=1,100 do
--arc=(2*math.pi/100)*i
--mx1=0+mrad1*(math.sin(arc))
--my1=0-mrad1*(math.cos(arc))
--arc=(2*math.pi/100)*i
--mx2=0+mrad2*(math.sin(arc))
--my2=0-mrad2*(math.cos(arc))
--cairo_move_to (cr,hx0+mx1,hy0+my1)
--cairo_line_to (cr,hx0+mx2,hy0+my2)
--cairo_stroke (cr)
--end
--mem=tonumber(conky_parse('${memperc}'))
--mrad3=mrad2+10
--arc=(2*math.pi/360)*((360/100)*((mem)))
--mx1=0+mrad2*(math.sin(arc))
--my1=0-mrad2*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((mem))+4)
--mx2=0+mrad3*(math.sin(arc))
--my2=0-mrad3*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((mem))-4)
--mx3=0+mrad3*(math.sin(arc))
--my3=0-mrad3*(math.cos(arc))
--cairo_move_to (cr,hx0+mx1,hy0+my1)
--cairo_line_to (cr,hx0+mx2,hy0+my2)
--cairo_stroke (cr)
--cairo_move_to (cr,hx0+mx1,hy0+my1)
--cairo_line_to (cr,hx0+mx3,hy0+my3)
--cairo_stroke (cr)
----fs_used root
--srad1=mrad3
--srad2=srad1+10
--br1,bg1,bb1,ba1=1,1,1,1
--cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
--cairo_stroke (cr)
--cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
--cairo_stroke (cr)
--for i=1,100 do
--arc=((2*math.pi/360)*((360/100)*i))
--sx1=0+srad1*(math.sin(arc))
--sy1=0-srad1*(math.cos(arc))
--arc=((2*math.pi/360)*((360/100)*i))
--sx2=0+srad2*(math.sin(arc))
--sy2=0-srad2*(math.cos(arc))
--cairo_move_to (cr,hx0+sx1,hy0+sy1)
--cairo_line_to (cr,hx0+sx2,hy0+sy2)
--cairo_stroke (cr)
--end
--fsr=conky_parse('${fs_used_perc /}')
--srad3=srad2+10
--arc=((2*math.pi/360)*((360/(100)*fsr)))
--sx1=0+srad2*(math.sin(arc))
--sy1=0-srad2*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((fsr))-4)
--sx2=0+srad3*(math.sin(arc))
--sy2=0-srad3*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((fsr))+4)
--sx3=0+srad3*(math.sin(arc))
--sy3=0-srad3*(math.cos(arc))
--cairo_move_to (cr,hx0+sx1,hy0+sy1)
--cairo_line_to (cr,hx0+sx2,hy0+sy2)
--cairo_stroke (cr)
--cairo_move_to (cr,hx0+sx1,hy0+sy1)
--cairo_line_to (cr,hx0+sx3,hy0+sy3)
--cairo_stroke (cr)
----fs used home
--mnrad1=srad3
--mnrad2=mnrad1+10
--br1,bg1,bb1,ba1=1,1,1,1
--cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
--cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
--cairo_stroke (cr)
--cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
--cairo_stroke (cr)
--for i=1,100 do
--arc=((2*math.pi/360)*((360/100)*i))
--mnx1=0+mnrad1*(math.sin(arc))
--mny1=0-mnrad1*(math.cos(arc))
--arc=((2*math.pi/360)*((360/100)*i))
--mnx2=0+mnrad2*(math.sin(arc))
--mny2=0-mnrad2*(math.cos(arc))
--cairo_move_to (cr,hx0+mnx1,hy0+mny1)
--cairo_line_to (cr,hx0+mnx2,hy0+mny2)
--cairo_stroke (cr)
--end
--fsh=conky_parse('${fs_used_perc /home}')
--mnrad3=mnrad2+10
--arc=((2*math.pi/360)*((360/(100)*fsh)))
--mnx1=0+mnrad2*(math.sin(arc))
--mny1=0-mnrad2*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((fsh))-4)
--mnx2=0+mnrad3*(math.sin(arc))
--mny2=0-mnrad3*(math.cos(arc))
--arc=(2*math.pi/360)*((360/100)*((fsh))+4)
--mnx3=0+mnrad3*(math.sin(arc))
--mny3=0-mnrad3*(math.cos(arc))
--cairo_move_to (cr,hx0+mnx1,hy0+mny1)
--cairo_line_to (cr,hx0+mnx2,hy0+mny2)
--cairo_stroke (cr)
--cairo_move_to (cr,hx0+mnx1,hy0+mny1)
--cairo_line_to (cr,hx0+mnx3,hy0+mny3)
--cairo_stroke (cr)
--cairo_arc (cr,hx0,hy0,mnrad3,0,2*math.pi)
--cairo_stroke (cr)
end
end

And the images - comes with everything, even the red.png test image I used to "centre" the images. I archived the directory: ~/Conky/images/Mayan
Mayan.tar.gz - Contents:

  • ~/Conky/images/Mayan/thmb_masks.png

  • ~/Conky/images/Mayan/sep.png

  • ~/Conky/images/Mayan/red.png

  • ~/Conky/images/Mayan/oct.png

  • ~/Conky/images/Mayan/nov.png

  • ~/Conky/images/Mayan/may.png

  • ~/Conky/images/Mayan/mar.png

  • ~/Conky/images/Mayan/jun.png

  • ~/Conky/images/Mayan/jul.png

  • ~/Conky/images/Mayan/jan.png

  • ~/Conky/images/Mayan/full_masks.png

  • ~/Conky/images/Mayan/feb.png

  • ~/Conky/images/Mayan/dec.png

  • ~/Conky/images/Mayan/aug.png

  • ~/Conky/images/Mayan/apr.png

OK, That's it ... my screen is full!
Time to erase everything and start over again!

I do hope you all had and are having a great Christmas!

1,539

Re: My Conky Config

Sector11 wrote:

Well, I did more than "try it" I took the second set of circles out (commented out), and added the Mayan masks.  There are 12 of them and will change every month.

I have to show my entire desktop to show why I clipped the second set of circles.
So why did I take the other circles out: It's called: No room!

OK, That's it ... my screen is full!
Time to erase everything and start over again!

I do hope you all had and are having a great Christmas!

The middle face really does look good, I think I'll have to borrow that.  I'll work on adding some glyphs when I get some time.

I think this one might make make me update my conky blog.

Your desktop looks great Sector11 smile

Last edited by mrpeachy (2010-12-26 04:23:39)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,540

Re: My Conky Config

Sector11 wrote:

Well, I did more than "try it" I took the second set of circles out (commented out), and added the Mayan masks.  There are 12 of them and will change every month.

I dont even want to know how much stuff you have commented out in your conkies

You can't handle the truth...or conky

Re: My Conky Config

I find it amazing how people can do so much with conky yet when I go on two IRC's and ask how to display what's playing on my media player and how to show album art I can't get a single answer.

One day I'll figure it out!

XFCE User ~ Linux Abuser ~ Rubbish Refuser
[img]http://achievements.schrankmonster.de/Achievement.aspx?text=First%20Tiling%20WM%20-%2050G[/img]

1,542

Re: My Conky Config

mrpeachy wrote:

The middle face really does look good, I think I'll have to borrow that.  I'll work on adding some glyphs when I get some time.

I think this one might make make me update my conky blog.

Your desktop looks great Sector11 smile

They're yours - I give them to you!  They were made for that "Mayan Time" clock of yours.  Not good for much else.

I hope you do update your blog, this would look good there.  smile

Here's "Conky" as a glyph:
http://dl.dropbox.com/u/16070765/full_conky.png

And not all those conkys run all day, just at boot and when I want some part of them, this is normal:
http://dl.dropbox.com/u/16070765/thmb_26.png

1,543

Re: My Conky Config

djyoung4 wrote:
Sector11 wrote:

Well, I did more than "try it" I took the second set of circles out (commented out), and added the Mayan masks.  There are 12 of them and will change every month.

I dont even want to know how much stuff you have commented out in your conkies

Actually not a lot is commented out in my conkys.
Those reside in the directory ~/Conky as that's what I use on a day to day basis ....

Now "~/conky" is a different story ... 269 entries of which 46 are subdirectories
- with multiple sub-sub-directories.

I do believe I still have the very first conky I ever did about 4 years ago, and by comparison of what some do today it was horrible  smile

1,544

Re: My Conky Config

i promised some added readability to my calendar/clock
http://ompldr.org/tNnF5Yw

will do the same for the system monitor then try and think of a way to incorporate glyphs

--yearclock by mrpeachy 2010
require 'cairo'

require 'cairo'
function addzero100(num)
if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end
end
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 circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
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, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_rotate (cr, -interval2)
cairo_move_to (cr,0,0)
cairo_set_source_rgba (cr, 0, 0, 0, 0)
cairo_line_to (cr,hx0,hy0)
cairo_stroke (cr)
end
end

function date_to_words()------------------------------------------------------------------------------------------
date=os.date("%d")
datecut=string.gsub(date, ".", "%1|")
datetable=string.split(datecut, "|")
        
        if datetable[1]=="1" then
            datetens=""
            datespacer=""
            if datetable[2]=="0" then
            dateunit="tenth"
            elseif datetable[2]=="1" then
            dateunit="eleventh"
            elseif datetable[2]=="2" then
            dateunit="twelfth"
            elseif datetable[2]=="3" then
            dateunit="thirteenth"
            elseif datetable[2]=="4" then
            dateunit="fourteenth"
            elseif datetable[2]=="5" then
            dateunit="fifteenth"
            elseif datetable[2]=="6" then
            dateunit="sixteenth"
            elseif datetable[2]=="7" then
            fisrtdigit="seventeenth"
            elseif datetable[2]=="8" then
            dateunit="eighteenth"
            elseif datetable[2]=="9" then
            dateunit="nineteenth"
            end
        end 
          
        if datetable[1]=="0" or datetable[1]>"1" then
            datespacer=" "
            if datetable[1]=="2" then
            datetens="twenty"
            elseif datetable[1]=="3" then
            datetens="thirty"
            elseif datetable[1]=="0" then
            datetens=""
            end 
            if datetable[2]=="1" then
            dateunit="first"
            elseif datetable[2]=="2" then
            dateunit="second"
            elseif datetable[2]=="3" then
            dateunit="third"
            elseif datetable[2]=="4" then
            dateunit="fourth"
            elseif datetable[2]=="5" then
            dateunit="fifth"
            elseif datetable[2]=="6" then
            dateunit="sixth"
            elseif datetable[2]=="7" then
            dateunit="seventh"
            elseif datetable[2]=="8" then
            dateunit="eighth"
            elseif datetable[2]=="9" then
            dateunit="nineth"
            elseif datetable[2]=="0" then
            dateunit=""
            datespacer=""
            end
        end
        if datetable[2]=="0" then
            datetens=""
            datespacer=""
            if datetable[1]=="2" then
            dateunit="twentieth"
            elseif datetable[1]=="3" then
            dateunit="thirtieth"
            end
        end    
    return ((datetens) .. (datespacer) .. (dateunit))
end--end of function--------------------------------------------------------------------------------------

function number_to_words(text)
textlength=string.len(text)
textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
--for NUMBERS from 1 to 999
--for numbers 1 digit number----------
if textlength==1 then
    if texttable[1]=="1" then
    firstdigit="one"
    elseif texttable[1]=="2" then
    firstdigit="two"
    elseif texttable[1]=="3" then
    firstdigit="three"
    elseif texttable[1]=="4" then
    firstdigit="four"
    elseif texttable[1]=="5" then
    firstdigit="five"
    elseif texttable[1]=="6" then
    firstdigit="six"
    elseif texttable[1]=="7" then
    firstdigit="seven"
    elseif texttable[1]=="8" then
    firstdigit="eight"
    elseif texttable[1]=="9" then
    firstdigit="nine"
    elseif texttable[1]=="0" then
    firstdigit="zero"
    end
return firstdigit
end
--for 2 digit number------------------
if textlength==2 then
    if texttable[1]=="1" then
        seconddigit=""
        spacer=""
        if texttable[2]=="0" then
        firstdigit="ten"
        elseif texttable[2]=="1" then
        firstdigit="eleven"
        elseif texttable[2]=="2" then
        firstdigit="twelve"
        elseif texttable[2]=="3" then
        firstdigit="thirteen"
        elseif texttable[2]=="4" then
        firstdigit="fourteen"
        elseif texttable[2]=="5" then
        firstdigit="fifteen"
        elseif texttable[2]=="6" then
        firstdigit="sixteen"
        elseif texttable[2]=="7" then
        fisrtdigit="seventeen"
        elseif texttable[2]=="8" then
        firstdigit="eighteen"
        elseif texttable[2]=="9" then
        firstdigit="nineteen"
        end
    end   
    if texttable[1]>"1" then
        spacer=" "
        if texttable[1]=="2" then
        seconddigit="twenty"
        elseif texttable[1]=="3" then
        seconddigit="thirty"
        elseif texttable[1]=="4" then
        seconddigit="fourty"
        elseif texttable[1]=="5" then
        seconddigit="fifty"
        elseif texttable[1]=="6" then
        seconddigit="sixty"
        elseif texttable[1]=="7" then
        seconddigit="seventy"
        elseif texttable[1]=="8" then
        seconddigit="eighty"
        elseif texttable[1]=="9" then
        seconddigit="ninety"
        end    
        if texttable[2]=="1" then
        firstdigit="one"
        elseif texttable[2]=="2" then
        firstdigit="two"
        elseif texttable[2]=="3" then
        firstdigit="three"
        elseif texttable[2]=="4" then
        firstdigit="four"
        elseif texttable[2]=="5" then
        firstdigit="five"
        elseif texttable[2]=="6" then
        firstdigit="six"
        elseif texttable[2]=="7" then
        firstdigit="seven"
        elseif texttable[2]=="8" then
        firstdigit="eight"
        elseif texttable[2]=="9" then
        firstdigit="nine"
        elseif texttable[2]=="0" then
        firstdigit=""
        spacer=""
        end
     end
return ((seconddigit) .. (spacer) .. (firstdigit))
end
--for 3 digit numbers-----------------------------
if textlength==3 then
    if texttable[2]=="0" and texttable[3]=="0" then space="" end
    if texttable[2]>"0" or texttable[3]>"0" then space=" and " end
    if texttable[2]=="0" and texttable[3]>"0" then spacer="" end
    
    if texttable[1]=="1" then
    thirddigit="one hundred"
    elseif texttable[1]=="2" then
    thirddigit="two hundred"
    elseif texttable[1]=="3" then
    thirddigit="three hundred"
    elseif texttable[1]=="4" then
    thirddigit="four hundred"
    elseif texttable[1]=="5" then
    thirddigit="five hundred"
    elseif texttable[1]=="6" then
    thirddigit="six hundred"
    elseif texttable[1]=="7" then
    thirddigit="seven hundred"
    elseif texttable[1]=="8" then
    thirddigit="eight hundred"
    elseif texttable[1]=="9" then
    thirddigit="nine hundred"
    end
    if texttable[2]=="0" or texttable[2]>"1" then
        if texttable[3]=="1" then
        firstdigit="one"
        elseif texttable[3]=="2" then
        firstdigit="two"
        elseif texttable[3]=="3" then
        firstdigit="three"
        elseif texttable[3]=="4" then
        firstdigit="four"
        elseif texttable[3]=="5" then
        firstdigit="five"
        elseif texttable[3]=="6" then
        firstdigit="six"
        elseif texttable[3]=="7" then
        firstdigit="seven"
        elseif texttable[3]=="8" then
        firstdigit="eight"
        elseif texttable[3]=="9" then
        firstdigit="nine"
        elseif texttable[3]=="0" then
        firstdigit=""
        spacer=""
        end 
    end
    if texttable[2]=="1" then
        seconddigit=""
        spacer=""  
        if texttable[3]=="0" then
        firstdigit="ten"
        elseif texttable[3]=="1" then
        firstdigit="eleven"
        elseif texttable[3]=="2" then
        firstdigit="twelve"
        elseif texttable[3]=="3" then
        firstdigit="thirteen"
        elseif texttable[3]=="4" then
        firstdigit="fourteen"
        elseif texttable[3]=="5" then
        firstdigit="fifteen"
        elseif texttable[3]=="6" then
        firstdigit="sixteen"
        elseif texttable[3]=="7" then
        firstdigit="seventeen"
        elseif texttable[3]=="8" then
        firstdigit="eighteen"
        elseif texttable[3]=="9" then
        firstdigit="nineteen"
        end
    end
    if texttable[2] >"1" then
        spacer=" "    
        if texttable[2]=="2" then
        seconddigit="twenty"
        elseif texttable[2]=="3" then
        seconddigit="thirty"
        elseif texttable[2]=="4" then
        seconddigit="fourty"
        elseif texttable[2]=="5" then
        seconddigit="fifty"
        elseif texttable[2]=="6" then
        seconddigit="sixty"
        elseif texttable[2]=="7" then
        seconddigit="seventy"
        elseif texttable[2]=="8" then
        seconddigit="eighty"
        elseif texttable[2]=="9" then
        seconddigit="ninety"
        elseif texttable[2]=="0" then
        seconddigit=""
        end
    end
return ((thirddigit) .. (space) .. (seconddigit) .. (spacer) .. (firstdigit))
end
end--of function

function conky_draw_fig()
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

cairo_set_line_width (cr,1)
hx0=200
hy0=200
hrad1=80
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,24 do
arc=((2*math.pi/360)*((360/24)*i))
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/24)*i))
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
hr=os.date("%H")*60*60
mn=os.date("%M")*60
sc=os.date("%S")
hrs=hr+mn+sc
mns=mn+sc
hrad3=hrad2+10
arc=((2*math.pi/360)*((360/(24*60*60)*hrs)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)-4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(24*60*60))*(hrs)+4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)

hrnum=os.date('%H')
if tonumber(os.date('%H'))<10 then hrnum=string.gsub(hrnum,"^.","") 
else hrnum=hrnum end
if hrnum==1 then hour="HOUR"
else hour="HOURS" end
text4=((string.upper(number_to_words(hrnum))) .. " " .. hour)
--text must be in quotes
text=text4
--font name must be in quotes
font="mono"
fontsize=10
radius=hrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/(24*60*60))*(hrs)+4)
slen4=string.len(text)
finish=start+(slen4*5)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--minutes of hour
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
mrad3=mrad2+10
arc=((2*math.pi/360)*((360/(60*60)*mns)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)-4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/(60*60))*(mns)+4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)

minnum=os.date('%M')
if tonumber(os.date('%M'))<10 then minnum=string.gsub(minnum,"^.","") 
else minnum=minnum end
if minnum==1 then minute="MINUTE"
else minute="MINUTES" end
text4=((string.upper(number_to_words(minnum))) .. " " .. minute)
--text must be in quotes
text=text4
--font name must be in quotes
font="mono"
fontsize=10
radius=mrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/(60*60))*(mns)+4)
slen4=string.len(text)
finish=start+(slen4*5)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--seconds of minute
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,60 do
arc=((2*math.pi/360)*((360/60)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/60)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
srad3=srad2+10
arc=((2*math.pi/360)*((360/(60)*sc)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/60)*((sc))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad3,0,2*math.pi)
cairo_stroke (cr)
--circlewriting
--circlewriting variable
secnum=os.date('%S')
if tonumber(os.date('%S'))<10 then secnum=string.gsub(secnum,"^.","") 
else secnum=secnum end
if secnum==1 then second="SECOND"
else second="SECONDS" end
text3=((string.upper(number_to_words(secnum))) .. " " .. second)
--text must be in quotes
text=text3
--font name must be in quotes
font="mono"
fontsize=10
radius=srad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/60)*((sc))+4)
slen3=string.len(text)
finish=start+(slen3*5)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--months of the year
month=os.date("%m")
day=os.date("%d")
mnrad1=hrad1-40
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
--lines of months
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
jan=31*24*60*60
feb=jan+(feb*24*60*60)
mar=feb+(31*24*60*60)
apr=mar+(30*24*60*60)
may=apr+(31*24*60*60)
jun=may+(30*24*60*60)
jul=jun+(31*24*60*60)
aug=jul+(31*24*60*60)
sep=aug+(30*24*60*60)
oct=sep+(31*24*60*60)
nov=oct+(30*24*60*60)
dec=nov+(31*24*60*60)
secdays = { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec }
year=os.date("%G")
t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
feb=(os.difftime(t1,t2))/(24*60*60)
yeardays=31+feb+31+30+31+30+31+31+30+31+30+31
yearsec=(yeardays*24*60*60)
for i=1,12 do
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/yearsec)*(secdays[i])))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
hr=os.date("%I")
doy=os.date("%j")
yrsecs=((doy-1)*24*60*60)+(sc)+(mn*60)+(hr*60*60)
mnrad3=mnrad2+10
arc=(2*math.pi/360)*((360/yearsec)*(yrsecs))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))+4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/yearsec)*((yrsecs))-4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)
--circlewriting
--circlewriting variable
text1=((string.upper(os.date('%B'))) .. " TWO THOUSAND AND " .. string.upper(number_to_words(os.date('%y'))))
--text must be in quotes
text=text1
--font name must be in quotes
font="mono"
fontsize=10
radius=mnrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/yearsec)*((yrsecs))+4)
slen2=string.len(text)
finish=start+270
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--days of month
yrad1=mnrad3
yrad2=yrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,yrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,yrad2,0,2*math.pi)
cairo_stroke (cr)
monthdays = { 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
for i=1,monthdays[tonumber(month)] do
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx1=0+yrad1*(math.sin(arc))
yy1=0-yrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/monthdays[tonumber(month)])*(i)))
yx2=0+yrad2*(math.sin(arc))
yy2=0-yrad2*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
end
yrad3=yrad2+10
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*(day))
yx1=0+yrad2*(math.sin(arc))
yy1=0-yrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))+4)
yx2=0+yrad3*(math.sin(arc))
yy2=0-yrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/monthdays[tonumber(month)])*((day))-4)
yx3=0+yrad3*(math.sin(arc))
yy3=0-yrad3*(math.cos(arc))
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx2,hy0+yy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+yx1,hy0+yy1)
cairo_line_to (cr,hx0+yx3,hy0+yy3)
cairo_stroke (cr)
--circlewriting
--circlewriting variable
text1=((string.upper(os.date('%A'))) .. " THE " .. string.upper(date_to_words()))
--text must be in quotes
text=text1
--font name must be in quotes
font="mono"
fontsize=10
radius=yrad2+1
positionx=hx0
positiony=hy0
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=((360/monthdays[tonumber(month)])*((day))+4)
slen1=string.len(text)
finish=start+(7.5*slen1)
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--system monitor
--cpu
cairo_set_line_width (cr,1)
hx0=385
hy0=383
hrad1=40
hrad2=hrad1+10
br1,bg1,bb1,ba1=1,1,1,1

cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,hrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,hrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=(2*math.pi/100)*i
hx1=0+hrad1*(math.sin(arc))
hy1=0-hrad1*(math.cos(arc))
arc=(2*math.pi/100)*i
hx2=0+hrad2*(math.sin(arc))
hy2=0-hrad2*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
end
cpu=conky_parse('${cpu}')
hrad3=hrad2+10
arc=(2*math.pi/360)*((360/100)*((cpu)))
hx1=0+hrad2*(math.sin(arc))
hy1=0-hrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((cpu))+4)
hx2=0+hrad3*(math.sin(arc))
hy2=0-hrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((cpu))-4)
hx3=0+hrad3*(math.sin(arc))
hy3=0-hrad3*(math.cos(arc))
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx2,hy0+hy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+hx1,hy0+hy1)
cairo_line_to (cr,hx0+hx3,hy0+hy3)
cairo_stroke (cr)
--memory
mrad1=hrad3
mrad2=mrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=(2*math.pi/100)*i
mx1=0+mrad1*(math.sin(arc))
my1=0-mrad1*(math.cos(arc))
arc=(2*math.pi/100)*i
mx2=0+mrad2*(math.sin(arc))
my2=0-mrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
end
mem=tonumber(conky_parse('${memperc}'))
mrad3=mrad2+10
arc=(2*math.pi/360)*((360/100)*((mem)))
mx1=0+mrad2*(math.sin(arc))
my1=0-mrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((mem))+4)
mx2=0+mrad3*(math.sin(arc))
my2=0-mrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((mem))-4)
mx3=0+mrad3*(math.sin(arc))
my3=0-mrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx2,hy0+my2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mx1,hy0+my1)
cairo_line_to (cr,hx0+mx3,hy0+my3)
cairo_stroke (cr)
--fs_used root
srad1=mrad3
srad2=srad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,srad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,srad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=((2*math.pi/360)*((360/100)*i))
sx1=0+srad1*(math.sin(arc))
sy1=0-srad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/100)*i))
sx2=0+srad2*(math.sin(arc))
sy2=0-srad2*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
end
fsr=conky_parse('${fs_used_perc /}')
srad3=srad2+10
arc=((2*math.pi/360)*((360/(100)*fsr)))
sx1=0+srad2*(math.sin(arc))
sy1=0-srad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsr))-4)
sx2=0+srad3*(math.sin(arc))
sy2=0-srad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsr))+4)
sx3=0+srad3*(math.sin(arc))
sy3=0-srad3*(math.cos(arc))
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx2,hy0+sy2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+sx1,hy0+sy1)
cairo_line_to (cr,hx0+sx3,hy0+sy3)
cairo_stroke (cr)
--fs used home
mnrad1=srad3
mnrad2=mnrad1+10
br1,bg1,bb1,ba1=1,1,1,1
cairo_set_source_rgba (cr,br1,bg1,bb1,ba1)
cairo_arc (cr,hx0,hy0,mnrad1,0,2*math.pi)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad2,0,2*math.pi)
cairo_stroke (cr)
for i=1,100 do
arc=((2*math.pi/360)*((360/100)*i))
mnx1=0+mnrad1*(math.sin(arc))
mny1=0-mnrad1*(math.cos(arc))
arc=((2*math.pi/360)*((360/100)*i))
mnx2=0+mnrad2*(math.sin(arc))
mny2=0-mnrad2*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
end
fsh=conky_parse('${fs_used_perc /home}')
mnrad3=mnrad2+10
arc=((2*math.pi/360)*((360/(100)*fsh)))
mnx1=0+mnrad2*(math.sin(arc))
mny1=0-mnrad2*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsh))-4)
mnx2=0+mnrad3*(math.sin(arc))
mny2=0-mnrad3*(math.cos(arc))
arc=(2*math.pi/360)*((360/100)*((fsh))+4)
mnx3=0+mnrad3*(math.sin(arc))
mny3=0-mnrad3*(math.cos(arc))
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx2,hy0+mny2)
cairo_stroke (cr)
cairo_move_to (cr,hx0+mnx1,hy0+mny1)
cairo_line_to (cr,hx0+mnx3,hy0+mny3)
cairo_stroke (cr)
cairo_arc (cr,hx0,hy0,mnrad3,0,2*math.pi)
cairo_stroke (cr)
end
end

Last edited by mrpeachy (2010-12-27 20:18:55)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,545

Re: My Conky Config

mrpeachy wrote:

i promised some added readability to my calendar/clock
http://ompldr.org/tNnF5Yw

will do the same for the system monitor then try and think of a way to incorporate glyphs

My wife saw that and said - Hey! That's yours!  hahahahahaha
No dear, I just added the image, it's mrpeachy's.  big_smile

Did you need to edit anything with the images or did they work "out of the box" for you?

Of course you KNOW I have to grab this one now !!!

1,546

Re: My Conky Config

Sector11 wrote:
mrpeachy wrote:

i promised some added readability to my calendar/clock
http://ompldr.org/tNnF5Yw

will do the same for the system monitor then try and think of a way to incorporate glyphs

My wife saw that and said - Hey! That's yours!  hahahahahaha
No dear, I just added the image, it's mrpeachy's.  big_smile

Did you need to edit anything with the images or did they work "out of the box" for you?

Of course you KNOW I have to grab this one now !!!

I just had to change the placement a little and change the path to the images, nothing a quick replace all couldn't do smile

the number to words converter function added a couple hundred lines extra to the new script!

Last edited by mrpeachy (2010-12-27 22:23:06)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,547

Re: My Conky Config

mrpeachy wrote:

I just had to change the placement a little and change the path to the images, nothing a quick replace all couldn't do smile

the number to words converter function added a couple hundred lines extra to the new script!

Oh yea, the path to the images, I forgot that those would have to be changed.
Glad it works.

Yup, got it working, and no need to edit the "images" here.

1,548

Re: My Conky Config

@ Sector11 - did you post the code for your system tree conky?
I really like that one, and want to use it on my puter smile

thanks!

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.

1,549

Re: My Conky Config

mrpeachy wrote:

@ Sector11 - did you post the code for your system tree conky?
I really like that one, and want to use it on my puter smile

thanks!

You, can have anything I have.  smile

# To use #! in a conky use: ${exec echo '#!'}
# OB_All_Txt
# by Sector11

background no
border_inner_margin 0
border_width 0
default_color FFFFFF
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
minimum_size 250 0
no_buffers yes

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints below,skip_taskbar,skip_pager
own_window_title alltext
own_window_class alltext

pad_percents 2
short_units yes
stippled_borders 0
top_name_width 5
update_interval 1
uppercase no
use_spacer right
use_xft yes
xftalpha 1.0 #0.2
xftfont Sans Mono:size=9
override_utf8_locale yes

gap_x 270 # left-right
gap_y 85 # up-down

update_interval 5

alignment tl
TEXT
${goto 12}+----System
${goto 15}|${goto 40}|
${goto 15}|${goto 38}+-- OS${goto 125}${exec echo '#!'} Statler
${goto 15}|${goto 38}+-- Kernel ${goto 125}${kernel}
${goto 15}|${goto 38}+-- Machine${goto 125}${machine}
${goto 15}|
${goto 12}+----Memory
${goto 15}|${goto 38}+-- Total${goto 125}${memmax}
${goto 15}|${goto 38}+-- In Use${goto 125}${mem} (${memperc}%)
${goto 15}|${goto 38}+-- Free${goto 125}${memfree}
${goto 15}|${goto 38}+-- Up to${goto 125}${memeasyfree} freed easily
${goto 15}|${goto 38}+-- Swap
${goto 15}|${goto 60}+-- Total${goto 125}${swapmax}
${goto 15}|${goto 60}+-- Used${goto 125}${swap} - ${swapperc}%
${goto 15}|${goto 60}+-- Free${goto 125}${swapfree}
${goto 15}|
${goto 12}+----Status
${goto 15}|${goto 40}|
${goto 15}|${goto 38}+-- CPU${goto 125}${cpu cpu0}% - ${freq_g}GHz
${goto 15}|${goto 38}+-- Ram${goto 125}${memperc}%
${goto 15}|${goto 38}+-- LoadAvg${goto 125}${loadavg}
${goto 15}|${goto 38}+-- Disk${goto 125}${fs_used_perc /}% Used
${goto 15}|${goto 38}+-- Diskio ${goto 125}${diskio}
${goto 15}|${goto 60}+-- Read${goto 125}${diskio_read}
${goto 15}|${goto 60}+-- Write${goto 125}${diskio_write}
${goto 15}|
${goto 12}+----Storage
${goto 15}|${goto 40}|
${goto 15}|${goto 38}+-- /ROOT${goto 125}${fs_free /} / ${fs_size /}
${goto 15}|${goto 38}+-- /HOME${goto 125}${fs_free /home} / ${fs_size /home}
${goto 15}|
${goto 12}+----Processes
${goto 15}|${goto 40}|
${goto 15}|${goto 38}+-- Total${goto 125}${processes}
${goto 15}|${goto 38}+-- Running${goto 125}${running_processes}
${goto 15}|${goto 40}|
${goto 15}|${goto 38}+-- CPU
${goto 15}|${goto 40}|${goto 60}+-- ${top name 1}${goto 125}${top cpu 1}${top mem 1}
${goto 15}|${goto 40}|${goto 60}+-- ${top name 2}${goto 125}${top cpu 2}${top mem 2}
${goto 15}|${goto 40}|${goto 60}+-- ${top name 3}${goto 125}${top cpu 3}${top mem 3}
${goto 15}|${goto 40}|
${goto 15}|${goto 38}+-- MEM
${goto 15}|${goto 60}+-- ${top_mem name 1}${goto 125}${top_mem cpu 1}${top_mem mem 1}
${goto 15}|${goto 60}+-- ${top_mem name 2}${goto 125}${top_mem cpu 2}${top_mem mem 2}
${goto 15}|${goto 60}+-- ${top_mem name 3}${goto 125}${top_mem cpu 3}${top_mem mem 3}
${goto 15}|
${goto 12}+----Net
${goto 40}|
${goto 38}+-- eth0${goto 125}195.320.151.8.11
${goto 38}+-- Up
${goto 40}|${goto 60}+-- Speed${goto 125}${upspeedf eth0}KiB
${goto 40}|${goto 60}+-- Total${goto 125}${totalup eth0}KiB
${goto 40}|
${goto 38}+-- Down
${goto 60}+-- Speed${goto 125}${downspeedf eth0}KiB
${goto 60}+-- Total${goto 125}${totaldown eth0}KiB

... except the kitchen sink, my wife wants that!

I'm going to add some stuff to that I think - just for fun.  Will post it when done.

Last edited by Sector11 (2010-12-28 11:59:06)

1,550

Re: My Conky Config

Sector11 wrote:
mrpeachy wrote:

@ Sector11 - did you post the code for your system tree conky?
I really like that one, and want to use it on my puter smile

thanks!

You, can have anything I have.  smile

... except the kitchen sink, my wife wants that!

I'm going to add some stuff to that I think - just for fun.  Will post it when done.

why thank you sir...

and while your at it, you can send some of your warm weather my way?  I hate (cold,wet.windy,snowy,icy,slushy,dark) winter!

Last edited by mrpeachy (2010-12-28 17:29:23)

It's hard to find something if you don't know what you're looking for.
I have a blog, it's mostly about conky and lua stuff... go here.