Re: My Conky Config

http://omploader.org/tM3BoZQ

${font Sans:size=10}1) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 7p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}2) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 8p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}3) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 9p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}4) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 10p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}5) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 11p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}6) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 12p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}7) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 13p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}8) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 14p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}9) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 15p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}
${font Sans:size=10}10) ${color1}${execi 30 curl 'http://sydney.gumtree.com.au/f-Jobs-W0QQAdTypeZ2QQCatIdZ9302' | grep -n '<a href="http://sydney.gumtree.com.au/c-' | sed -n 16p | awk -F'onclick' '{print $1}' | awk -F'au/c-' '{print $2}' | awk -F'W0QQ' '{print $1}'| sed "s/-/ /g" | fold -sw 40}

this gives you the first 10 entries and updates every 30 seconds, kind of dirty looking... but it can be cleaned up with better formatting and sed to remove the "-"  ...add 

| sed "s/-/ /g" | 

before the fold (updated above)
obviously change the fold number at the end to change how much text is displayed before it starts a new line or just delete it.

if you want more listings just add more lines but change the "sed -n p" by 1

getting the description might be a bit harder, but let me know


...  or go with benj1's idea smile

but the site seems to update *really* quickly i cant actually get the conky output to sync with what i see when i refresh the page itself!

but i guess if you see one you like on the conky it will give you a basis for a search.

...also it might be less system intensive to write  just one instance of the website to a text file, and then runs the extraction on the text file.  i did this with a shell script when i was working on getting facebook in conky

Last edited by mrpeachy (2010-03-02 02:54:10)

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.

Re: My Conky Config

the voting is now open for the conky of the month competition over on the conky blog.
http://blog.conky.be/2010/03/01/please- … m-entries/

so go there and pick the one you like best (and it really doesn't have to be one of mine smile )

i hope its okay to post this... It's not my intention to try and solicit votes for myself

Last edited by mrpeachy (2010-03-02 02:10:37)

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.

928

Re: My Conky Config

nice thinking benj1 I'll do that.

don't worry mrpeachy I will sort it out. I don't want to distract you from your fun big_smile

I blog too much....       geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao

Re: My Conky Config

tawan wrote:

nice thinking benj1 I'll do that.

don't worry mrpeachy I will sort it out. I don't want to distract you from your fun big_smile

no distraction... and I don't know about the fun part either.  Actually recently I've been feeling a little burnt out on lua scripts and conky...or at least my ideas for what to do have been drying up a little of late.  Maybe the march edition of the conky of the month competition will give me some inspiration!

plus i realize that I can only go so far without embarking on a serious undertaking to learn the lua language and how to apply it more thoroughly (or for that matter learning the inner workings of cairo).  Plus I just don't have the time to work on anything really complicated.  It feels like I've reached a state that to improve upon what I've done by one unit now takes an input of 10 units of effort smile

although it was nice to see my work displayed on the official conky blog today and i think my entries rival any of the others *shrug*

(ok going off topic here)

Last edited by mrpeachy (2010-03-02 04:17:13)

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.

930

Re: My Conky Config

nice entries mrpeachy, although i think youre cheating having 4 entries wink

seriously tho, your conky/lua scripts are really good, much better than most people can achieve, plus its inevitable that you can't keep up your pace of learning for ever, and you will have to put more effort in to learning, thats just the way it goes.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: My Conky Config

benj1 wrote:

nice entries mrpeachy, although i think youre cheating having 4 entries wink

seriously tho, your conky/lua scripts are really good, much better than most people can achieve, plus its inevitable that you can't keep up your pace of learning for ever, and you will have to put more effort in to learning, thats just the way it goes.

thanks benj1 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.

Re: My Conky Config

here is a configurable version of the perspective bars lua script
http://omploader.org/tM3BzMAhttp://omploader.org/tM3BzcA
Currently the bars have no bottoms, thats why they look extra white in the transparent version... i'll add those later
i need to work on getting titles onto the bars.  I want to be able to twist the text to match the angles of the bars and i think this is possible using a matrix in cairo... but I have yet to look into exactly how to do this!

here is a clip of it working which also shows how the figure can be altered through the settings.
http://blip.tv/file/3290847

I have posted a video on my blog that better shows how the settings can affect the look of the bars:
http://thepeachyblog.blogspot.com/2010/ … about.html


--[[perspective bars by mrpeachy (2010]]
require 'cairo'
function perspective(num1, num2, num3, num4, num5, num6, across, down, width, rad, radback, topangle, bottomangle, backta, backba,red1,green1,blue1,alpha1,red2,green2,blue2,alpha2,red3,green3,blue3,alpha3,red4,green4,blue4,alpha4,barnumber,gridlines,glred,glgreen,glblue,glaplha)
cairo_translate (cr, across, down)
lwidth=1
cairo_set_line_width (cr, lwidth)

--rad=500
--angle=20
top=270+topangle
bottom=270-bottomangle

--radback=540
--backangle=15
backtop=270+backta
backbottom=270-backba
cairo_move_to (cr, 0, 0)

--backtop line
text_arc=((2*math.pi/360)*backtop)
tx3=0+radback*(math.sin(text_arc))
ty3=0-radback*(math.cos(text_arc))

--backbottom line
text_arc=((2*math.pi/360)*backbottom)
tx4=0+radback*(math.sin(text_arc))
ty4=0-radback*(math.cos(text_arc))

--1st line
linea=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radback)
--width of first column horizontal
wideah=math.cos(((backbottom-backtop)/2)*(math.pi/180))*width
--width of fisrt column along backangle
wideaa=width
--2nd line
radiusa=radback-wideaa
lineb=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radiusa)
--width of second column
widebh=(wideah/linea)*lineb
--width of second column along backangle
wideba=widebh/math.cos(((backbottom-backtop)/2)*(math.pi/180))
--3nd line
radiusb=radiusa-wideba
linec=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radiusb)
--width of second column
widech=(widebh/lineb)*linec
--width of second column along backangle
wideca=widech/math.cos(((backbottom-backtop)/2)*(math.pi/180))
--4nd line
radiusc=radiusb-wideca
lined=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radiusc)
--width of second column
widedh=(widech/linec)*lined
--width of second column along backangle
wideda=widedh/math.cos(((backbottom-backtop)/2)*(math.pi/180))
--5nd line
radiusd=radiusc-wideda
linee=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radiusd)
--width of second column
wideeh=(widedh/lined)*linee
--width of second column along backangle
wideea=wideeh/math.cos(((backbottom-backtop)/2)*(math.pi/180))
--6nd line
radiuse=radiusd-wideea
linef=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radiuse)
--width of second column
widefh=(wideeh/linee)*linef
--width of second column along backangle
widefa=widefh/math.cos(((backbottom-backtop)/2)*(math.pi/180))
--7nd line
radiusf=radiuse-widefa
lineg=math.sin(((backbottom-backtop)/2)*(math.pi/180))*(radiusf)
--width of second column
widegh=(widefh/linef)*lineg
--width of second column along backangle
widega=widegh/math.cos(((backbottom-backtop)/2)*(math.pi/180))

xa=tx4
xb=xa+wideah
xc=xb+widebh
xd=xc+widech
xe=xd+widedh
xf=xe+wideeh
xg=xf+widefh
ya=ty4
yb=ya-(lineb-linea)
yc=yb-(linec-lineb)
yd=yc-(lined-linec)
ye=yd-(linee-lined)
yf=ye-(linef-linee)
yg=yf-(lineg-linef)

cairo_move_to (cr, 0, 0)
--top line
text_arc=((2*math.pi/360)*top)
tx1=0+rad*(math.sin(text_arc))
ty1=0-rad*(math.cos(text_arc))
--bottom line
text_arc=((2*math.pi/360)*bottom)
tx2=0+rad*(math.sin(text_arc))
ty2=0-rad*(math.cos(text_arc))

--1st line
line1=math.sin(((bottom-top)/2)*(math.pi/180))*(rad)
--width of first column horizontal
wide1h=math.cos(((bottom-top)/2)*(math.pi/180))*width
--width of fisrt column along angle
wide1a=width
--2nd line
radius1=rad-wide1a
line2=math.sin(((bottom-top)/2)*(math.pi/180))*(radius1)
--width of second column
wide2h=(wide1h/line1)*line2
--width of second column along angle
wide2a=wide2h/math.cos(((bottom-top)/2)*(math.pi/180))
--3nd line
radius2=radius1-wide2a
line3=math.sin(((bottom-top)/2)*(math.pi/180))*(radius2)
--width of second column
wide3h=(wide2h/line2)*line3
--width of second column along angle
wide3a=wide3h/math.cos(((bottom-top)/2)*(math.pi/180))
--4nd line
radius3=radius2-wide3a
line4=math.sin(((bottom-top)/2)*(math.pi/180))*(radius3)
--width of second column
wide4h=(wide3h/line3)*line4
--width of second column along angle
wide4a=wide4h/math.cos(((bottom-top)/2)*(math.pi/180))
--5nd line
radius4=radius3-wide4a
line5=math.sin(((bottom-top)/2)*(math.pi/180))*(radius4)
--width of second column
wide5h=(wide4h/line4)*line5
--width of second column along angle
wide5a=wide5h/math.cos(((bottom-top)/2)*(math.pi/180))
--6nd line
radius5=radius4-wide5a
line6=math.sin(((bottom-top)/2)*(math.pi/180))*(radius5)
--width of second column
wide6h=(wide5h/line5)*line6
--width of second column along angle
wide6a=wide6h/math.cos(((bottom-top)/2)*(math.pi/180))
--7nd line
radius6=radius5-wide6a
line7=math.sin(((bottom-top)/2)*(math.pi/180))*(radius6)
--width of second column
wide7h=(wide6h/line6)*line7
--width of second column along angle
wide7a=wide7h/math.cos(((bottom-top)/2)*(math.pi/180))

x1=tx2
x2=x1+wide1h
x3=x2+wide2h
x4=x3+wide3h
x5=x4+wide4h
x6=x5+wide5h
x7=x6+wide6h
y1=ty2
y2=y1-(line2-line1)
y3=y2-(line3-line2)
y4=y3-(line4-line3)
y5=y4-(line5-line4)
y6=y5-(line6-line5)
y7=y6-(line7-line6)

--back indicator line
if gridlines==1 then
cairo_set_source_rgba (cr, glred,glgreen,glblue,glaplha)
if barnumber==1 then
xpos=xb
ypos=yb
line=lineb
xposf=x2
yposf=y2
linef=line2
elseif barnumber==2 then
xpos=xc
ypos=yc
line=linec
xposf=x3
yposf=y3
linef=line3
elseif barnumber==3 then
xpos=xd
ypos=yd
line=lined
xposf=x4
yposf=y4
linef=line4
elseif barnumber==4 then
xpos=xe
ypos=ye
line=linee
xposf=x5
yposf=y5
linef=line5
elseif barnumber==5 then
xpos=xf
ypos=yf
line=linef
xposf=x6
yposf=y6
linef=line6
elseif barnumber==6 then
xpos=xg
ypos=yg
line=lineg
xposf=x7
yposf=y7
linef=line7
end
cairo_move_to (cr, tx4, ty4)
cairo_rel_line_to (cr, 0, linea*2)
cairo_line_to (cr, xpos, ypos+line*2)
cairo_rel_line_to (cr, 0, -line*2)
cairo_stroke (cr)
cairo_move_to (cr, xpos, ypos+line*2)
cairo_line_to (cr, xposf, yposf+linef*2)
cairo_stroke (cr)
end

--BAR 6
var6=line6*2*(num6/100)
var7=line7*2*(num6/100)
varf=linef*2*(num6/100)
varg=lineg*2*(num6/100)
--back left face6
cairo_set_source_rgba (cr,red6*0.8,green6*0.8,blue6*0.8,alpha6)
cairo_move_to (cr, xf,yf)
cairo_rel_line_to (cr, 0, varf)
cairo_line_to (cr, xg, yg+varg)
cairo_rel_line_to (cr, 0, -varg)
cairo_close_path (cr)
cairo_fill (cr)
--back right face6
cairo_set_source_rgba (cr,red6*0.8,green6*0.8,blue6*0.8,alpha6)
cairo_move_to (cr, xg,yg)
cairo_rel_line_to (cr, 0, varg)
cairo_line_to (cr, x7, y7+var7)
cairo_rel_line_to (cr, 0, -var7)
cairo_close_path (cr)
cairo_fill (cr)
--top 6
cairo_set_source_rgba (cr,red6*0.8,green6*0.8,blue6*0.8,alpha6)
cairo_move_to (cr, x6, y6+var6)
cairo_line_to (cr, x7, y7+var7)
cairo_line_to (cr, xg, yg+varg)
cairo_line_to (cr, xf, yf+varf)
cairo_close_path (cr)
cairo_fill (cr)
--front left face6
cairo_set_source_rgba (cr,red6*1,green6*1,blue6*1,alpha6)
cairo_move_to (cr, xf,yf)
cairo_rel_line_to (cr, 0, varf)
cairo_line_to (cr, x6, y6+var6)
cairo_rel_line_to (cr, 0, -var6)
cairo_close_path (cr)
cairo_fill (cr)
--front right face6
cairo_set_source_rgba (cr,red6*0.7,green6*0.7,blue6*0.7,alpha6)
cairo_move_to (cr, x6,y6)
cairo_rel_line_to (cr, 0, var6)
cairo_line_to (cr, x7, y7+var7)
cairo_rel_line_to (cr, 0, -var7)
cairo_close_path (cr)
cairo_fill (cr)

--BAR 5
var5=line5*2*(num5/100)
var6=line6*2*(num5/100)
vare=linee*2*(num5/100)
varf=linef*2*(num5/100)
--back left face5
cairo_set_source_rgba (cr,red5*0.8,green5*0.8,blue5*0.8,alpha5)
cairo_move_to (cr, xe,ye)
cairo_rel_line_to (cr, 0, vare)
cairo_line_to (cr, xf, yf+varf)
cairo_rel_line_to (cr, 0, -varf)
cairo_close_path (cr)
cairo_fill (cr)
--back right face5
cairo_set_source_rgba (cr,red5*0.8,green5*0.8,blue5*0.8,alpha5)
cairo_move_to (cr, xf,yf)
cairo_rel_line_to (cr, 0, varf)
cairo_line_to (cr, x6, y6+var6)
cairo_rel_line_to (cr, 0, -var6)
cairo_close_path (cr)
cairo_fill (cr)
--top 5
cairo_set_source_rgba (cr,red5*0.8,green5*0.8,blue5*0.8,alpha5)
cairo_move_to (cr, x5, y5+var5)
cairo_line_to (cr, x6, y6+var6)
cairo_line_to (cr, xf, yf+varf)
cairo_line_to (cr, xe, ye+vare)
cairo_close_path (cr)
cairo_fill (cr)
--front left face5
cairo_set_source_rgba (cr,red5*1,green5*1,blue5*1,alpha5)
cairo_move_to (cr, xe,ye)
cairo_rel_line_to (cr, 0, vare)
cairo_line_to (cr, x5, y5+var5)
cairo_rel_line_to (cr, 0, -var5)
cairo_close_path (cr)
cairo_fill (cr)
--front right face5
cairo_set_source_rgba (cr,red5*0.7,green5*0.7,blue5*0.7,alpha5)
cairo_move_to (cr, x5,y5)
cairo_rel_line_to (cr, 0, var5)
cairo_line_to (cr, x6, y6+var6)
cairo_rel_line_to (cr, 0, -var6)
cairo_close_path (cr)
cairo_fill (cr)

--BAR 4
var4=line4*2*(num4/100)
var5=line5*2*(num4/100)
vard=lined*2*(num4/100)
vare=linee*2*(num4/100)
--back left face4
cairo_set_source_rgba (cr,red4*0.8,green4*0.8,blue4*0.8,alpha4)
cairo_move_to (cr, xd,yd)
cairo_rel_line_to (cr, 0, vard)
cairo_line_to (cr, xe, ye+vare)
cairo_rel_line_to (cr, 0, -vare)
cairo_close_path (cr)
cairo_fill (cr)
--back right face2
cairo_set_source_rgba (cr,red4*0.8,green4*0.8,blue4*0.8,alpha4)
cairo_move_to (cr, xe,ye)
cairo_rel_line_to (cr, 0, vare)
cairo_line_to (cr, x5, y5+var5)
cairo_rel_line_to (cr, 0, -var5)
cairo_close_path (cr)
cairo_fill (cr)
--top 4
cairo_set_source_rgba (cr,red4*0.8,green4*0.8,blue4*0.8,alpha4)
cairo_move_to (cr, x4, y4+var4)
cairo_line_to (cr, x5, y5+var5)
cairo_line_to (cr, xe, ye+vare)
cairo_line_to (cr, xd, yd+vard)
cairo_close_path (cr)
cairo_fill (cr)
--front left face4
cairo_set_source_rgba (cr,red4*1,green4*1,blue4*1,alpha4)
cairo_move_to (cr, xd,yd)
cairo_rel_line_to (cr, 0, vard)
cairo_line_to (cr, x4, y4+var4)
cairo_rel_line_to (cr, 0, -var4)
cairo_close_path (cr)
cairo_fill (cr)
--front right face4
cairo_set_source_rgba (cr,red4*0.7,green4*0.7,blue4*0.7,alpha4)
cairo_move_to (cr, x4,y4)
cairo_rel_line_to (cr, 0, var4)
cairo_line_to (cr, x5, y5+var5)
cairo_rel_line_to (cr, 0, -var5)
cairo_close_path (cr)
cairo_fill (cr)

--BAR 3
var3=line3*2*(num3/100)
var4=line4*2*(num3/100)
varc=linec*2*(num3/100)
vard=lined*2*(num3/100)
--back left face3
cairo_set_source_rgba (cr,red3*8,green3*8,blue3*8,alpha3)
cairo_move_to (cr, xc,yc)
cairo_rel_line_to (cr, 0, varc)
cairo_line_to (cr, xd, yd+vard)
cairo_rel_line_to (cr, 0, -vard)
cairo_close_path (cr)
cairo_fill (cr)
--back right face3
cairo_set_source_rgba (cr,red3*8,green3*8,blue3*8,alpha3)
cairo_move_to (cr, xd,yd)
cairo_rel_line_to (cr, 0, vard)
cairo_line_to (cr, x4, y4+var4)
cairo_rel_line_to (cr, 0, -var4)
cairo_close_path (cr)
cairo_fill (cr)
--top3
cairo_set_source_rgba (cr,red3*8,green3*8,blue3*8,alpha3)
cairo_move_to (cr, x3, y3+var3)
cairo_line_to (cr, x4, y4+var4)
cairo_line_to (cr, xd, yd+vard)
cairo_line_to (cr, xc, yc+varc)
cairo_close_path (cr)
cairo_fill (cr)
--front left face3
cairo_set_source_rgba (cr,red3*1,green3*1,blue3*1,alpha3)
cairo_move_to (cr, xc,yc)
cairo_rel_line_to (cr, 0, varc)
cairo_line_to (cr, x3, y3+var3)
cairo_rel_line_to (cr, 0, -var3)
cairo_close_path (cr)
cairo_fill (cr)
--front right face3
cairo_set_source_rgba (cr,red3*0.7,green3*0.7,blue3*0.7,alpha3)
cairo_move_to (cr, x3,y3)
cairo_rel_line_to (cr, 0, var3)
cairo_line_to (cr, x4, y4+var4)
cairo_rel_line_to (cr, 0, -var4)
cairo_close_path (cr)
cairo_fill (cr)

--BAR 2
var2=line2*2*(num2/100)
var3=line3*2*(num2/100)
varb=lineb*2*(num2/100)
varc=linec*2*(num2/100)
--back left face2
cairo_set_source_rgba (cr,red2*0.8,green2*0.8,blue2*0.8,alpha2)
cairo_move_to (cr, xb,yb)
cairo_rel_line_to (cr, 0, varb)
cairo_line_to (cr, xc, yc+varc)
cairo_rel_line_to (cr, 0, -varc)
cairo_close_path (cr)
cairo_fill (cr)
--back right face2
cairo_set_source_rgba (cr,red2*0.8,green2*0.8,blue2*0.8,alpha2)
cairo_move_to (cr, xc,yc)
cairo_rel_line_to (cr, 0, varc)
cairo_line_to (cr, x3, y3+var3)
cairo_rel_line_to (cr, 0, -var3)
cairo_close_path (cr)
cairo_fill (cr)
--top2
cairo_set_source_rgba (cr,red2*0.8,green2*0.8,blue2*0.8,alpha2)
cairo_move_to (cr, x2, y2+var2)
cairo_line_to (cr, x3, y3+var3)
cairo_line_to (cr, xc, yc+varc)
cairo_line_to (cr, xb, yb+varb)
cairo_close_path (cr)
cairo_fill (cr)
--front left face2
cairo_set_source_rgba (cr,red2*1,green2*1,blue2*1,alpha2)
cairo_move_to (cr, xb,yb)
cairo_rel_line_to (cr, 0, varb)
cairo_line_to (cr, x2, y2+var2)
cairo_rel_line_to (cr, 0, -var2)
cairo_close_path (cr)
cairo_fill (cr)
--front right face2
cairo_set_source_rgba (cr,red2*0.7,green2*0.7,blue2*0.7,alpha2)
cairo_move_to (cr, x2,y2)
cairo_rel_line_to (cr, 0, var2)
cairo_line_to (cr, x3, y3+var3)
cairo_rel_line_to (cr, 0, -var3)
cairo_close_path (cr)
cairo_fill (cr)

--BAR 1 num1, num2, num3, num4, num5, num6
var1=line1*2*(num1/100)
var2=line2*2*(num1/100)
vara=linea*2*(num1/100)
varb=lineb*2*(num1/100)
--back left face1
cairo_set_source_rgba (cr,red1*0.8,green1*0.8,blue1*0.8,alpha1)
cairo_move_to (cr, xa,ya)
cairo_rel_line_to (cr, 0, vara)
cairo_line_to (cr, xb, yb+varb)
cairo_rel_line_to (cr, 0, -varb)
cairo_close_path (cr)
cairo_fill (cr)
--back right face1
cairo_set_source_rgba (cr,red1*0.8,green1*0.8,blue1*0.8,alpha1)
cairo_move_to (cr, xb,yb)
cairo_rel_line_to (cr, 0, varb)
cairo_line_to (cr, x2, y2+var2)
cairo_rel_line_to (cr, 0, -var2)
cairo_close_path (cr)
cairo_fill (cr)
--top1
cairo_set_source_rgba (cr,red1*0.8,green1*0.8,blue1*0.8,alpha1)
cairo_move_to (cr, x1, y1+var1)
cairo_line_to (cr, x2, y2+var2)
cairo_line_to (cr, xb, yb+varb)
cairo_line_to (cr, xa, ya+vara)
cairo_close_path (cr)
cairo_fill (cr)
--front left face1
cairo_set_source_rgba (cr,red1*1,green1*1,blue1*1,alpha1)
cairo_move_to (cr, xa,ya)
cairo_rel_line_to (cr, 0, vara)
cairo_line_to (cr, x1, y1+var1)
cairo_rel_line_to (cr, 0, -var1)
cairo_close_path (cr)
cairo_fill (cr)
--front right face1
cairo_set_source_rgba (cr,red1*0.7,green1*0.7,blue1*0.7,alpha1)
cairo_move_to (cr, x1,y1)
cairo_rel_line_to (cr, 0, var1)
cairo_line_to (cr, x2, y2+var2)
cairo_rel_line_to (cr, 0, -var2)
cairo_close_path (cr)
cairo_fill (cr)
--front indicator line
if gridlines==1 then
cairo_set_source_rgba (cr, glred,glgreen,glblue,glaplha)
cairo_move_to (cr, x1, y1)
cairo_rel_line_to (cr, 0, line1*2)
cairo_line_to (cr, xposf, yposf+linef*2)
cairo_rel_line_to (cr, 0, -linef*2)
cairo_stroke (cr)
cairo_move_to (cr, xa, ya+linea*2)
cairo_line_to (cr, x1, y1+line1*2)
cairo_stroke (cr)
cairo_move_to (cr, x1, y1)
cairo_line_to (cr, xposf, yposf)
cairo_stroke (cr)
cairo_move_to (cr, x1, y1)
cairo_line_to (cr, xa, ya)
cairo_stroke (cr)
end
cairo_translate (cr, -across, -down)
end

function conky_draw_graph()
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> 3 then
cpu=tonumber(conky_parse('${cpu}'))
mem=tonumber(conky_parse('${memperc}'))
hdd1=tonumber(conky_parse('${fs_used_perc /}'))
hdd2=tonumber(conky_parse('${fs_used_perc /media/Windows XP}'))
--call draw function------------------------------------------------------------
--set the number of bars you are using to set gridlines correctly
barnumber=4
--bar1 (for a bar not in use set alpha to 0
num1=cpu
red1,green1,blue1,alpha1=1,0,0,1
--bar2
num2=mem
red2,green2,blue2,alpha2=0,1,0,1
--bar3
num3=hdd1
red3,green3,blue3,alpha3=0,0,1,1
--bar4
num4=hdd2
red4,green4,blue4,alpha4=1,1,0,1
--bar5
num5=0
red5,green5,blue5,alpha5=1,1,0,0
--bar6
num6=0
red6,green6,blue6,alpha6=1,1,0,0
--position x
across=800
--position y
down=200
--width of first bar, other bar widths are relative to this
width=60
--length of the front
frontradius=500
--length of the back
backradius=600
--angles of lines... due to how lines are calculated a bar at 50% will have a horizontal top on the front and back faces of the figure
topangle=20
bottomangle=15
backtopangle=10
backbottomangle=5
--set 1 for gridlines, 0 for none
gridlines=1
--set gridline color
glred,glgreen,glblue,glaplha=0,0,0,1
--call drawing function
perspective(num1, num2, num3, num4, num5, num6, across, down, width, frontradius, backradius, topangle, bottomangle, backtopangle, backbottomangle,red1,green1,blue1,alpha1,red2,green2,blue2,alpha2,red3,green3,blue3,alpha3,red4,green4,blue4,alpha4,barnumber,gridlines,glred,glgreen,glblue,glaplha)
--end call----------------------------------------------------------------------
end
end

Last edited by mrpeachy (2010-03-03 01:48:57)

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.

933

Re: My Conky Config

mrpeachy wrote:
Digit wrote:

and mpreachy's hulk.    inspirational!    ps.  would faster refresh rates help smooth it out?

Thanks Digit smile ...but unfortunately no... higher refresh rates make it even more jumpy.

just a delayed after thought.

how about somehow having it remain in use in a faster piece of the computer.  like if its in hd, put it in swap, if in swap put it in ram, if in ram, make it just run constantly in the processor.  hehe.  mount the stuff it needs to run, in ramfs for example, and reduce the resource/graphical overhead of the frames.

educate yourself so you may educate others.DeNoob&UnBloat PCs!
the only free webhosting i use.
say "NO!" to a chemical lobotomy in your food
flattr me, thnx

Re: My Conky Config

whoops double post...see below

Last edited by mrpeachy (2010-03-02 22:23:59)

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.

Re: My Conky Config

Digit wrote:

just a delayed after thought.

how about somehow having it remain in use in a faster piece of the computer.  like if its in hd, put it in swap, if in swap put it in ram, if in ram, make it just run constantly in the processor.  hehe.  mount the stuff it needs to run, in ramfs for example, and reduce the resource/graphical overhead of the frames.

the problem is more with the reporting of the cpu usage... a faster cycle rate on conky makes the reported cpu use more "erratic"
so at 1 second it might be..
12%......25%......28%......13%
but at 0,5 second cycle it would be
12%15%25%30%28%10%13%

thats what i meant by the jumpy....

i would need a way to record cpu usage at time a, then record cpu usage at time b.. then work out the difference between b and a
then have some way of having the frames "progress" from a to b rather than just jump from a to b.

might be possible in a lua script if conky cycle was set high say 4 times per second... then cpu could be recorded every second which would give you 3 frames to get from a to b (if you see what i mean) ...but then the animation would always be just slightly behind the actual cpu usage number...

Last edited by mrpeachy (2010-03-02 22:24:19)

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.

Re: My Conky Config

Hi!
I have one question: is it possible to add one icon/symbol after ${hr 1} line. E.g. see my mail icon or butterfly:

background yes
use_xft yes
xftfont DejaVu Sans:size=7
xftalpha 0.5
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type override
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 180 5
maximum_width 180
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color grey
default_shade_color red
default_outline_color green
alignment top_right
gap_x 3
gap_y 23
no_buffers yes
uppercase no
cpu_avg_samples_2
override_utf8_locale yes
text_buffer_size 2048

TEXT
${font Trebuchet MS:size=29}${alignc}${time %H:%M:%S}${font}
${voffset 4}${font Trebuchet MS:size=8}${alignc}${time %A - %d - %B - %Y}${font}
${hr 1}
${voffset 0}${font andale mono:size=7}${color ffffff}${execpi 600 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/                     /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc -10} /' | sed /" $DJS "/s/" $DJS "/" "'${color red}'"$DJS"'${color ffffff}'" "/}${font}
${voffset -15}${font OpenSymbol:size=14}${font}${voffset 0}  SYSTEM    ${hr 1}
kernel: ${alignr}$kernel
uptime: ${alignr}$uptime
${color #3E3E3E}${cpugraph 000000 ffffff}${color}
${voffset -6}cpu: ${cpu}% ${alignr 1} ${alignr}${freq}MHz   ${acpitemp}°C
${voffset 0}hd:  $fs_free_perc%  ${voffset 0}${fs_free /home}/${fs_size /home} ${alignr}${hddtemp /dev/sda localhost 7634}°C
${voffset 0}ram: $memperc% ${alignc} $mem${alignr 7} ${membar 6,50}
${voffset 2}${alignc -40}CPU%    ${alignr}MEM%
${voffset 2}${top_mem name 1}${alignr}${top_mem cpu 1}   ${top_mem mem 1}
${voffset 0}${top_mem name 2}${alignr}${top_mem cpu 2}   ${top_mem mem 2}
${voffset 0}${top_mem name 3}${alignr}${top_mem cpu 3}   ${top_mem mem 3}
${voffset 0}${top_mem name 4}${alignr}${top_mem cpu 4}   ${top_mem mem 4}
${voffset 5}upload: ${alignr}${upspeedf eth2} KB/s
${voffset 0}download: ${alignr}${downspeedf eth2} KB/s
${voffset 2}${font OpenSymbol:size=12}${font}${voffset -1}  MAIL    ${hr 1}

I tried to put something after ${hr 1} - but nothing-just the line till the end of margin.

http://img11.imageshack.us/img11/2329/b … fotoax.png
http://img11.imageshack.us/img11/2329/bildschirmfotoax.png

Last edited by wassm. (2010-03-04 15:34:02)

Dell Mini 10v, 1GB RAm, 160 GB Hard Disk, #! (testing)

Re: My Conky Config

wassm. wrote:

Hi!
I have one question: is it possible to add one icon/symbol after ${hr 1} line. E.g. see my mail icon or butterfly:

i think you need something line:
${alignr 50}${hr1}whatever

the 50 after the alignr shouls stop the line 50 pixels from the right of the conky window....
foget that, just tried it and itdoesnt work... but im sure i saw a fix somewhere!

Last edited by mrpeachy (2010-03-04 16:53:05)

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.

Re: My Conky Config

mrpeachy wrote:
wassm. wrote:

Hi!
I have one question: is it possible to add one icon/symbol after ${hr 1} line. E.g. see my mail icon or butterfly:

i think you need something line:
${alignr 50}${hr1}whatever

the 50 after the alignr shouls stop the line 50 pixels from the right of the conky window....
foget that, just tried it and itdoesnt work... but im sure i saw a fix somewhere!


Thanks. i also tried that-almost every versions

Dell Mini 10v, 1GB RAm, 160 GB Hard Disk, #! (testing)

Re: My Conky Config

@ wassm
i dont think there is a way.. the fix i thought i saw was really a trick to get a hr like line --- this is where i saw it
http://conky.linux-hardcore.com/?page_id=2962

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.

Re: My Conky Config

mrpeachy wrote:
Digit wrote:

just a delayed after thought.

how about somehow having it remain in use in a faster piece of the computer.  like if its in hd, put it in swap, if in swap put it in ram, if in ram, make it just run constantly in the processor.  hehe.  mount the stuff it needs to run, in ramfs for example, and reduce the resource/graphical overhead of the frames.

the problem is more with the reporting of the cpu usage... a faster cycle rate on conky makes the reported cpu use more "erratic"
so at 1 second it might be..
12%......25%......28%......13%
but at 0,5 second cycle it would be
12%15%25%30%28%10%13%

thats what i meant by the jumpy....

i would need a way to record cpu usage at time a, then record cpu usage at time b.. then work out the difference between b and a
then have some way of having the frames "progress" from a to b rather than just jump from a to b.

might be possible in a lua script if conky cycle was set high say 4 times per second... then cpu could be recorded every second which would give you 3 frames to get from a to b (if you see what i mean) ...but then the animation would always be just slightly behind the actual cpu usage number...

I think you should have a look to the code of the audio spectrum I posted on ubuntu forums : the peak bars have a smooth effect when moving (search peak_value in the code). It's what you're looking for if I understood you well. It works for decreasings values but it should be possible to use it for increasing values

Re: My Conky Config

mrpeachy wrote:

@ wassm
i dont think there is a way.. the fix i thought i saw was really a trick to get a hr like line --- this is where i saw it
http://conky.linux-hardcore.com/?page_id=2962


Here is workaround:
http://conky.linux-hardcore.com/?page_id=302

And this is my line:

${voffset 2}MAIL${voffset 3}${alignr 10}${cpubar cpu1 0,135}${voffset -7} ${font OpenSymbol:size=12}${font}

Thanks

Dell Mini 10v, 1GB RAm, 160 GB Hard Disk, #! (testing)

Re: My Conky Config

Herewith mine on my Ubuntu box, will be making some adjustments to the standard Conky in #! when I install this weekend

http://img35.imageshack.us/img35/6818/conkya.th.jpg

# .conkyrc - Edited from various examples across the 'net
# with thanks to everyone in particular HypeEst & Craig Watson

# --- Window Layout & Options --- #
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
use_spacer none
use_xft yes
text_buffer_size 2048
alignment top_left
gap_x 10
gap_y 20

# --- Colours, Sizes, Fonts & Margins --- #
update_interval 3.0
minimum_size 210 5
maximum_size 215
stippled_borders 3
border_margin 9
border_width 10
default_color white

# --- Text --- #
draw_outline no
draw_borders no
xftfont free sanes:size=8
xftalpha 0.8
uppercase no
draw_shades yes

# --- Other --- #
total_run_times 0
cpu_avg_samples 2



TEXT

${font Zekton:size=9}${color C2E078}SYSTEM: ${hr 2}$color${font}
${color white}O.S: ${alignr 2}${font}Ubuntu ${sysname}
${color white}Kernel: ${alignr 2}${kernel}
${color white}Uptime: ${alignr 2}${uptime}
${color white}CPU 1: ${alignr 2}${cpu cpu0}%   ${cpubar cpu0 8,80}
${color white}CPU 2: ${alignr 2}${cpu cpu1}%   ${cpubar cpu1 8,80}
${color white}RAM: ${goto 100}$mem / $memmax ${alignr 2}$memperc%
${color white}Swap: ${goto 100}$swap / $swapmax ${alignr 2}$swapperc%
${color white}Root: ${goto 100}Used: ${fs_used /} / ${fs_size /} ${alignr 2}Free: ${fs_free_perc /}%
${color white}Thug: ${goto 100}Used: ${fs_used /home} / ${fs_size /home} ${alignr 2}Free: ${fs_free_perc /home}%
${color white}Battery: ${alignr 2} ${battery_percent BAT0}%
${color white}Temp:  CPU: ${color white}${acpitemp}C ${alignr 2}HDD: ${execi 300 hddtemp /dev/sda | cut -b30-39}

${font Zekton:size=9}${color C2E078}PROCESSES: ${hr 2}$color${font}
${color C2E078}Name :${color} ${goto 145}PID${goto 210}CPU%${alignr 2}MEM%
${color white}${top name 1} ${goto 145}${top pid 1}${goto 210}${top cpu 1}${alignr 2}${top mem 1}
${color white}${top name 2} ${goto 145}${top pid 2}${goto 210}${top cpu 2}${alignr 2}${top mem 2}
${color white}${top name 3} ${goto 145}${top pid 3}${goto 210}${top cpu 3}${alignr 2}${top mem 3}
${color C2E078}Memory :${color}
${color white}${top_mem name 1} ${goto 145}${top_mem pid 1}${goto 210}${top_mem cpu 1}${alignr 2}${top_mem mem 1}
${color white}${top_mem name 2} ${goto 145}${top_mem pid 2}${goto 210}${top_mem cpu 2}${alignr 2}${top_mem mem 2}
${color white}${top_mem name 3} ${goto 145}${top_mem pid 3}${goto 210}${top_mem cpu 3}${alignr 2}${top_mem mem 3}

${font Zekton:size=9}${color C2E078}3G CARD: ${addr ppp0} ${hr 2}$color${font}
${font PizzaDude Bullets:size=20}S${font}${voffset -9}   ${goto 150}${font PizzaDude Bullets:size=20}M${font}${voffset -9}
${voffset 10}${color white}Today:$color${goto 70}${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}${goto 150}${color white}Today:$color${alignr 2}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}$font
${color white}Week:$color${goto 70}${execi 300 vnstat -w | grep "current week" | awk '{print $3 $4}'}${goto 150}${color white}Week:$color${alignr 2}${execi 300 vnstat -w | grep "current week" | awk '{print $6 $7}'}$font
${color white}Month:$color${goto 70}${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}${goto 150}${color white}Month:$color${alignr 2}${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}$font

${font Zekton:size=9}${color C2E078}WEATHER: ${hr 2}$color${font}

${execpi 1800 conkyForecast --location=SFXX0023 --template=/home/thug/Conky/conkyForecast.template}

Re: My Conky Config

nothing particularly groundbreaking, but have written a couple of lua functions to convert numbers and dates to text
so 19 becomes "nineteen"
and 23 (as in 23rd of month) becomes "twenty third"

UPDATED--------------
you can get stuff like this:
http://omploader.org/tM3I5dw

here is the script that made the above:
currently the number conversion function only goes up to 999
i have made a separate time to words function

--[[numbers to words conversion lua script by mrpeachy (2010)]]
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 time_to_words(wantsecs)
hours=os.date("%I")
minutes=os.date("%M")
seconds=os.date("%S")
hrcut=string.gsub(hours, ".", "%1|")
hrtable=string.split(hrcut, "|")
mincut=string.gsub(minutes, ".", "%1|")
mintable=string.split(mincut, "|")
seccut=string.gsub(seconds, ".", "%1|")
sectable=string.split(seccut, "|")
    if hours=="01" then
    hr="one"
    elseif hours=="02" then
    hr="two"
    elseif hours=="03" then
    hr="three"
    elseif hours=="04" then
    hr="four"
    elseif hours=="05" then
    hr="five"
    elseif hours=="06" then
    hr="six"
    elseif hours=="07" then
    hr="seven"
    elseif hours=="08" then
    hr="eight"
    elseif hours=="09" then
    hr="nine"
    elseif hours=="10" then
    hr="ten"
    elseif hours=="11" then
    hr="eleven"
    elseif hours=="12" then
    hr="twelve"
    end

   if mintable[1]=="1" then
   mintens=""
   minspacer=""
        if mintable[2]=="0" then
        minunits="ten"
        elseif mintable[2]=="1" then
        minunits="eleven"
        elseif mintable[2]=="2" then
        minunits="twelve"
        elseif mintable[2]=="3" then
        minunits="thirteen"
        elseif mintable[2]=="4" then
        minunits="fourteen"
        elseif mintable[2]=="5" then
        minunits="fifteen"
        elseif mintable[2]=="6" then
        minunits="sixteen"
        elseif mintable[2]=="7" then
        fisrtdigit="seventeen"
        elseif mintable[2]=="8" then
        minunits="eighteen"
        elseif mintable[2]=="9" then
        minunits="nineteen"
        end
    end   
    if mintable[1]=="0" or mintable[1]>"1" then
    if mintable[1]=="0" then minspacer="" end
    if mintable[1]>"1" then minspacer=" " end      
        if mintable[1]=="2" then
        mintens="twenty"
        elseif mintable[1]=="3" then
        mintens="thirty"
        elseif mintable[1]=="4" then
        mintens="fourty"
        elseif mintable[1]=="5" then
        mintens="fifty"
        elseif mintable[1]=="0" then
        mintens=""
        end  
        if mintable[2]=="1" then
        minunits="one"
        elseif mintable[2]=="2" then
        minunits="two"
        elseif mintable[2]=="3" then
        minunits="three"
        elseif mintable[2]=="4" then
        minunits="four"
        elseif mintable[2]=="5" then
        minunits="five"
        elseif mintable[2]=="6" then
        minunits="six"
        elseif mintable[2]=="7" then
        minunits="seven"
        elseif mintable[2]=="8" then
        minunits="eight"
        elseif mintable[2]=="9" then
        minunits="nine"
        elseif mintable[2]=="0" then
        minunits=""
        minspacer=""
        end
    end
min=(mintens .. minspacer .. minunits)
    if sectable[1]=="1" then
        if sectable[2]=="0" then
        secunits="ten"
        elseif sectable[2]=="1" then
        secunits="eleven"
        elseif sectable[2]=="2" then
        secunits="twelve"
        elseif sectable[2]=="3" then
        secunits="thirteen"
        elseif sectable[2]=="4" then
        secunits="fourteen"
        elseif sectable[2]=="5" then
        secunits="fifteen"
        elseif sectable[2]=="6" then
        secunits="sixteen"
        elseif sectable[2]=="7" then
        fisrtdigit="seventeen"
        elseif sectable[2]=="8" then
        secunits="eighteen"
        elseif sectable[2]=="9" then
        secunits="nineteen"
        end
    end   
    if sectable[1]=="0" or sectable[1]>"1" then
    if sectable[1]=="0" then secspacer="" end
    if sectable[1]>"1" then secspacer=" " end       
        if sectable[1]=="2" then
        sectens="twenty"
        elseif sectable[1]=="3" then
        sectens="thirty"
        elseif sectable[1]=="4" then
        sectens="fourty"
        elseif sectable[1]=="5" then
        sectens="fifty"
        elseif sectable[1]=="0" then
        sectens=""
        end  
        if sectable[2]=="1" then
        secunits="one"
        elseif sectable[2]=="2" then
        secunits="two"
        elseif sectable[2]=="3" then
        secunits="three"
        elseif sectable[2]=="4" then
        secunits="four"
        elseif sectable[2]=="5" then
        secunits="five"
        elseif sectable[2]=="6" then
        secunits="six"
        elseif sectable[2]=="7" then
        secunits="seven"
        elseif sectable[2]=="8" then
        secunits="eight"
        elseif sectable[2]=="9" then
        secunits="nine"
        elseif sectable[2]=="0" then
        secunits=""
        secspacer=""
        end
    end
sec=(sectens .. secspacer .. secunits)
if wantsecs=="n" then
    if minutes==00 then
    return ((hr) .. " o'clock")
    elseif minutes==01 then
    return ((min) .. " minute past " .. (hr))
    elseif minutes>01 then
    return ((min) .. " minutes past " .. (hr))
    end
end
if wantsecs=="y" then
    if seconds>"01" then    
        if minutes=="00" then
        return ((sec) .. " seconds past " .. (hr))
        elseif minutes>"00" then
        return ((min) .. " minutes and " .. (sec) .. " seconds past " .. (hr))
        end
    end
    if seconds=="01" then
        if minutes=="00" then
        return ((sec) .. " second past " .. (hr))
        elseif minutes>"00" then
        return ((min) .. " minutes and " .. (sec) .. " second past " .. (hr))
        end
    end
    if seconds=="00" then    
        if minutes=="00" then
        return ((hr) .. " o'clock")
        elseif minutes>"00" then
        return ((min) .. " minutes past " .. (hr))
        end
    end
end

end--end of function

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_text()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
--set font, font size and color
cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 18);
cairo_set_source_rgba (cr, 1, 1, 1, 1);

cairo_move_to (cr, 100, 200);
dayname=string.lower(os.date("%A"))
month=string.lower(os.date("%B"))
--when using date_to_words you must add empty brackets after the function name
cairo_show_text (cr, "today is " .. (dayname) .. " the " .. (date_to_words()) .. " of " .. (month))

cairo_move_to (cr, 100, 240);
--when using time_to_words, enter "y" if you want seconds or "n" if you do not
cairo_show_text (cr, "the time is " .. (time_to_words("y")))

cairo_move_to (cr, 100, 280);
--when using number_to_words you muct put the number you want converted in brackets after the function name
cairo_show_text (cr,"the central processing unit is running at " .. (number_to_words(tonumber(conky_parse('${cpu}')))) .. " percent capacity")

end
end

combine with some simple circlewriting and:
http://omploader.org/tM3JhZA

Last edited by mrpeachy (2010-03-09 04:58: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.

Re: My Conky Config

http://omploader.org/tM3MybA

here is the code for the ascii conversion function:
currently it only works with lowercase letters and only outputs one ascii "font" ... the "standard" font from the site tawan posted here:  http://crunchbanglinux.org/forums/post/57581/#p57581

--[[conky output and text converter to ascii output lua script by mrpeachy (2010)  ]]
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 texttoascii(text, fontsize, across, down)
cairo_select_font_face (cr, "Mono", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_set_source_rgba (cr, 0.2, 0.6, 0.2, 1);

textlength=string.len(text)
textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")


for i=1,textlength do
if texttable[i-1]==nil then adjust=0 end
if texttable[i-1]=="0" then adjust=(fontsize*0.4) end
if texttable[i-1]=="1" then adjust=(-1*(fontsize*2)) end
if texttable[i-1]=="4" then adjust=(fontsize*0.5) end

cairo_translate (cr, (across+((i-1)*fontsize*4.3))+adjust, down)
    if texttable[i]=="a" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2)
        cairo_show_text (cr,"  __ _ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _` |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__,_|")        
        
        
        elseif texttable[i]=="b" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _     ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| |__  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '_ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |_) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_.__/ ")

        
        elseif texttable[i]=="c" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  ___ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / __|")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (__ ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\___|")
        cairo_translate (cr, -fontsize*0.4, 0)
        
        elseif texttable[i]=="d" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"     _ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  __| |")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _` |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__,_|")

        
        elseif texttable[i]=="e" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  ___ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _ \\")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"|  __/")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\___|")

        
        elseif texttable[i]=="f" then
        
        cairo_move_to (cr, 0, 0)
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"  __ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," / _|")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| |_ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"|  _|")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_|  ")
        cairo_translate (cr, -fontsize, 0)

        
        elseif texttable[i]=="g" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  __ _ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _` |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__, |")
        cairo_move_to (cr, 0, fontsize*1.2*6) 
        cairo_show_text (cr," |___/")
        cairo_move_to (cr, 0, fontsize*1.2*7) 
        cairo_show_text (cr," ")

        
        elseif texttable[i]=="h" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _     ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| |__  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '_ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| | | |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_| |_|")

        
        elseif texttable[i]=="i" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"(_)")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_|")
        cairo_translate (cr, -fontsize*2.5, 0)

        elseif texttable[i]=="j" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"   _ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  (_)")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"  | |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"  | |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," _/ |")
        cairo_move_to (cr, 0, fontsize*1.2*6) 
        cairo_show_text (cr,"|__/ ")
        cairo_move_to (cr, 0, fontsize*1.2*7) 
        cairo_show_text (cr,"")
        cairo_translate (cr, -fontsize, 0)
        
        elseif texttable[i]=="k" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _    ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| | __")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| |/ /")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"|   < ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_|\\_\\")

        
        elseif texttable[i]=="l" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_|")
        cairo_translate (cr, -fontsize*2, 0)
        
        elseif texttable[i]=="m" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _ __ ___  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '_ ` _ \\")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| | | | | |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_| |_| |_|")
        cairo_translate (cr, fontsize*2.5, 0)
        
        elseif texttable[i]=="n" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _ __  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '_ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| | | |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_| |_|")

        
        elseif texttable[i]=="o" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  ___  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\___/ ")

        
        elseif texttable[i]=="p" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _ __  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '_ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |_) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"| .__/ ")
        cairo_move_to (cr, 0, fontsize*1.2*6) 
        cairo_show_text (cr,"|_|    ")
        cairo_move_to (cr, 0, fontsize*1.2*7) 
        cairo_show_text (cr,"")
        
        elseif texttable[i]=="q" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"  __ _ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _` |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__, |")
        cairo_move_to (cr, 0, fontsize*1.2*6) 
        cairo_show_text (cr,"    |_|")
        cairo_move_to (cr, 0, fontsize*1.2*7) 
        cairo_show_text (cr,"")
        
        elseif texttable[i]=="r" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _ __ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '__|")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |   ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_|   ")
        cairo_translate (cr, -fontsize*0.4, 0)

        
        elseif texttable[i]=="s" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," ___ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"/ __|")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"\\__ \\")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|___/")
        cairo_translate (cr, -fontsize*0.7, 0)
        
        elseif texttable[i]=="t" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _   ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| |_ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| __|")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |_ ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__|")
        cairo_translate (cr, -fontsize*0.7, 0)
        
        elseif texttable[i]=="u" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _   _ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| | | |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__,_|")
        cairo_translate (cr, fontsize*0.4, 0)

        
        elseif texttable[i]=="v" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"__   __")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"\\ \\ / /")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," \\ V / ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"  \\_/  ")
        cairo_translate (cr, fontsize*0.7, 0)
        
        elseif texttable[i]=="w" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"__      __")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"\\ \\ /\\ / /")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," \\ V  V / ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"  \\_/\\_/  ")
        cairo_translate (cr, fontsize*2.5, 0)

        
        elseif texttable[i]=="x" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"__  __")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"\\ \\/ /")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," >  < ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"/_/\\_\\")

        
        elseif texttable[i]=="y" then
        
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _   _ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| | | |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\__, |")
        cairo_move_to (cr, 0, fontsize*1.2*6) 
        cairo_show_text (cr," |___/ ")
        cairo_move_to (cr, 0, fontsize*1.2*7) 
        cairo_show_text (cr,"")
        cairo_translate (cr, fontsize*0.7, 0)
        
        elseif texttable[i]=="z" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," ____")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"|_  /")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," / / ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"/___|")
        cairo_translate (cr, -fontsize*0.6, 0)
        
        elseif texttable[i]=="0" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"  ___  ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," / _ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| | | |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |_| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\___/ ")
        --cairo_translate (cr, fontsize*0.4, 0)    

        elseif texttable[i]=="1" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"/ |")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_|")
        --cairo_translate (cr, -fontsize*2, 0)
     

        elseif texttable[i]=="2" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," ____  ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"|___ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"  __) |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," / __/ ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|_____|")      

        elseif texttable[i]=="3" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _____ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"|___ / ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"  |_ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," ___) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|____/ ")        

        elseif texttable[i]=="4" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _  _   ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| || |  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| || |_ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"|__   _|")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"   |_|  ") 
        --cairo_translate (cr, fontsize, 0)
      

        elseif texttable[i]=="5" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," ____  ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"| ___| ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"|___ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," ___) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"|____/ ")        

        elseif texttable[i]=="6" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"  __   ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," / /_  ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| '_ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\___/ ")      

        elseif texttable[i]=="7" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _____ ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"|___  |")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"   / / ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"  / /  ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," /_/   ")       

        elseif texttable[i]=="8" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"  ___  ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," ( _ ) ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr," / _ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"| (_) |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr," \\___/ ")       

        elseif texttable[i]=="9" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"  ___  ")
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," / _ \\ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"| (_) |")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," \\__, |")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"   /_/ ")  
        
        elseif texttable[i]==":" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"")  
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr," _ ")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"|_|")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr,"|_|")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"")
        cairo_translate (cr, -fontsize*2, 0)

        
        elseif texttable[i]==" " then   
        cairo_translate (cr, -fontsize*3, 0)
        
        elseif texttable[i]=="%" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr," _  _ ")  
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"|_|/ /")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"  / / ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," / /_ ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"/_/|_|")
        cairo_translate (cr, -fontsize*2, 0)
        
        elseif texttable[i]=="/" then
        cairo_move_to (cr, 0, 0)
        cairo_show_text (cr,"")
        cairo_move_to (cr, 0, fontsize*1.2) 
        cairo_show_text (cr,"    _ ")  
        cairo_move_to (cr, 0, fontsize*1.2*2) 
        cairo_show_text (cr,"   / /")
        cairo_move_to (cr, 0, fontsize*1.2*3) 
        cairo_show_text (cr,"  / / ")
        cairo_move_to (cr, 0, fontsize*1.2*4) 
        cairo_show_text (cr," / /  ")
        cairo_move_to (cr, 0, fontsize*1.2*5) 
        cairo_show_text (cr,"/_/   ")
        cairo_translate (cr, -fontsize, 0)

    end
cairo_translate (cr, -1*((across+((i-1)*fontsize*4.3))+adjust), -down)
end
end--of function


function conky_draw_text()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
--setup for ascii

text=("time " .. (os.date("%H : %M : %S")))
fontsize=8
across=10
down=20
texttoascii(text, fontsize, across, down)

text=("date " .. (os.date("%m / %d / %y")))
fontsize=8
across=168
down=90
texttoascii(text, fontsize, across, down)

text=("cpu " .. (addzero100(tonumber(conky_parse('${cpu}')))) .. " %")
fontsize=10
across=308
down=160
texttoascii(text, fontsize, across, down)

text=("mem " .. (addzero100(tonumber(conky_parse('${memperc}')))) .. " %")
fontsize=10
across=388
down=230
texttoascii(text, fontsize, across, down)

text=("hdd " .. (addzero100(tonumber(conky_parse('${fs_used_perc /}')))) .. " %")
fontsize=10
across=418
down=300
texttoascii(text, fontsize, across, down)


end
end

Last edited by mrpeachy (2010-03-09 05:01:50)

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.

945

Re: My Conky Config

mrpeachy wrote:

http://omploader.org/tM3MybA

here is the code for the ascii conversion function:

ha nice.

I blog too much....       geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao

946

Re: My Conky Config

I already had tint2 on the side but took Iman from Arch's idea of integrating conky. I went for a minimal looking conky that provides information from colour.

Top 2 numbers (1:0) are email boxes.

on AC power (battery meter hidden) some upload and download (blue \\ (download) and // (upload)) CPU2 is a little busy (blue +-)
http://omploader.org/tM3M1dA

CPU now calm but temperature is high
http://omploader.org/tM3M1cg

On battery power (battery bar becomes visible)
http://omploader.org/tM3M1dQ

CPU's both doing a little, On AC but charging (battery a bit visible)
http://omploader.org/tM3M1dg

Integrated into tint2
http://omploader.org/tM3M1dw

conky code

# -- Conky settings -- #
background no
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 2048
imlib_cache_size 0
 
# -- Window specifications -- #

own_window yes
own_window_transparent no
own_window_type desktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

border_inner_margin 1
border_outer_margin 0
 
minimum_size 42 107
maximum_width 50
 
alignment bottom_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
 
# -- Text settings -- #
use_xft yes
xftfont Radio Space:size=9
xftalpha 0.4
 
uppercase no

# Default colors and also border colors
default_color FFFFDD
#good blue 1994d1
#medium blue 083146
#dark blue 041e2c
color1 303030
color2 1994d1
color3 a90100
color4 808080
color5 151515
#default_shade_color 888888
#default_outline_color 888888
own_window_colour 151515
default_color 808080
border_width 0
#
# -- Lua Load -- #
#lua_load ~/.conky/lua.lua
#lua_draw_hook_pre ring_stats
 
TEXT
${alignc}${if_up wlan0}${execpi 300 python ~/.conky/my-gmail.py emailbox1 password1 1}${else}x${endif}:${if_up wlan0}${execpi 600 python ~/.conky/my-gmail.py emailbox2 password2 1}${else}x${endif}
${alignc}${if_match ${downspeedf wlan0} >= 20}${color2}${else}${if_match ${downspeedf wlan0} >= 2}${color4}${else}${color5}${endif}${endif}\\${color} ${if_match ${upspeedf wlan0} >= 20}${color2}${else}${if_match ${upspeedf wlan0} >= 2}${color4}${else}${color5}${endif}${endif}//${color}
${alignc}${if_match ${cpu cpu1} >= 90}${color3}${else}${if_match ${cpu cpu1} >= 40}${color2}${else}${if_match ${cpu cpu1} >= 10}${color4}${else}${color5}${endif}${endif}${endif}-+${color}${if_match ${acpitemp} >= 70}${color3}${else}${if_match ${acpitemp} >= 60}${color2}${else}${if_match ${acpitemp} >= 50}${color4}${else}${color5}${endif}${endif}${endif}T${color}${if_match ${cpu cpu2} >= 90}${color3}${else}${if_match ${cpu cpu2} >= 40}${color2}${else}${if_match ${cpu cpu2} >= 10}${color4}${else}${color5}${endif}${endif}${endif}+-${color}
${if_up wlan0}${voffset 10}${goto 6}${color cccccc}${font ConkyWeather:size=25}${execi 600 conkyForecast --location=EZXX0002 --datatype=WF}${font}${color}
${font DejaVu Sans Mono:size=6.5}${goto 12}${execi 600 conkyForecast --location=ASXX0112 --datatype=HT}${endif}
${if_match ${battery_percent BAT0} >= 98}${color5}${else}${if_existing /sys/class/power_supply/ACAD/online 0}${color2}${else}${color1}${endif}${endif}${goto 2}${battery_bar 6,40 BAT0}
${if_existing /sys/class/power_supply/ACAD/online 0}${if_match ${battery_percent BAT0} <= 8}${execi 200 ~/mybin/tawan-lowpower-shutdown}${endif}${endif}

tint2 code

#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------

#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
rounded = 0
border_width = 0
background_color = #151515 100
border_color = #ffffff 40

rounded = 5
border_width = 0
background_color = #000000 40
border_color = #ffffff 50

rounded = 5
border_width = 0
background_color = #000000 10
border_color = #ffffff 70

rounded = 5
border_width = 0
background_color = #ffffff 4
border_color = #ffffff 70

#---------------------------------------------
# PANEL
#---------------------------------------------
panel_monitor = all
panel_position = top left vertical
panel_size = 86% 44
panel_margin = 0 0
panel_padding = 2 2 2
font_shadow = 1
panel_background_id = 1
wm_menu = 1

#---------------------------------------------
# TASKBAR
#---------------------------------------------
taskbar_mode = multi_desktop
#taskbar_mode = single_desktop
taskbar_padding = 2 2 2
taskbar_background_id = 1
taskbar_active_background_id = 4

#---------------------------------------------
# TASKS
#---------------------------------------------
task_icon = 1
task_text = 0
task_maximum_size = 40 40
task_centered = 1
task_padding = 6 3
task_font = sans 7
task_font_color = #ffffff 70
task_active_font_color = #000000 100
task_background_id = 3
task_active_background_id = 2

#---------------------------------------------
# SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 4 4 5
systray_background_id = 1
systray_sort = left2right
systray_icon_size = 16
systray_icon_asb = 100 0 0

#---------------------------------------------
# CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = sans bold 8
time2_format = %h.%e
time2_font = sans 6
clock_font_color = #ffffff 76
clock_padding = 4 2
clock_background_id = 1
#clock_lclick_command = xclock
clock_rclick_command = zenity --calendar

#---------------------------------------------
# BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0

#---------------------------------------------
# TOOLTIP
#---------------------------------------------
tooltip = 1
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #ffffff 80
tooltip_font = sans 10

#---------------------------------------------
# MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

Last edited by tawan (2010-03-09 13:33:40)

I blog too much....       geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao

Re: My Conky Config

to mrpeachy
Hello. I have done everything like you say [e-mail], but it still don't working for me.
1. I created .conkyrc_flower in /home/ku/

##############################################
# Settings
##############################################
max_specials 10000
max_user_text 150000
background yes
use_xft yes
xftfont mono:size=12
xftalpha 1
update_interval 1
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 600, 640
maximum_width 600
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_right
gap_x 10
gap_y 40
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
default_color 000000
color1 735046

lua_load /home/ku/.lua/flower.lua
lua_draw_hook_pre draw_flower

TEXT

#end of conkyrc code

2. I created conkyrc_flower in /home/ku/ and made it executable

#!/bin/bash
conky -c ~/.conkyrc_flower

 
But when I type in terminal further:

[ku@ku-la ~]$ /home/ku/conky_start
Conky: /home/ku/.conkyrc_flower: 36: no such configuration: 'lua_load'
Conky: /home/ku/.conkyrc_flower: 37: no such configuration: 'lua_draw_hook_pre'
Conky: forked to background, pid is 3776
[ku@ku-la ~]$ 
Conky: desktop window (60008d) is subwindow of root window (101)
Conky: window type - desktop
Conky: drawing to created window (0x2600001)
Conky: drawing to double buffer

...nothing is happing sad

p.s. I'm on Archlinux, LXDE. I have conky 1.7.2-5, cairo 1.8.8-1, lua 5.1.4-4

Last edited by noMaster (2010-03-13 20:36:33)

Re: My Conky Config

@ noMaster

hi...well it looks like you do not have the lua script saved anywhere...
go to the post that contains the lua script for the configuration you want
you can tell its a lua script because it will have:

require "cairo"

somewhere at the top

copy the code and paste it into a file as in your conkyrc:

/home/ku/.lua/flower.lua

you have to make sure that you type all the paths correctly!

your version of conky should support lua with cairo bindings... so apart from making sure you have the lua script and making sure all the paths are correct, I'm not too sure what else it could be!

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.

Re: My Conky Config

mrpeachy wrote:

@ noMaster

hi...well it looks like you do not have the lua script saved anywhere...
go to the post that contains the lua script for the configuration you want
you can tell its a lua script because it will have:

require "cairo"

somewhere at the top

copy the code and paste it into a file as in your conkyrc:

/home/ku/.lua/flower.lua

you have to make sure that you type all the paths correctly!

your version of conky should support lua with cairo bindings... so apart from making sure you have the lua script and making sure all the paths are correct, I'm not too sure what else it could be!

  I suppose that is conky version. My lua script is already exist that line:

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)
end
end
function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
deg=(start-finish)/(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+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end

function flower (output, hori, vert, scale, rotation, red, green, blue, alpha, petals)

--BACKGROUND FLOWER FLAT
if background==1 then
inner=60+100
outer1=60+(100*2)
outer2=(60+(100*2))
outer3=outer1
varth1=0.5
varth2=0.5
for i=1,petals do
cairo_translate (cr, hori, vert)
cairo_scale (cr, scale, scale)
cairo_rotate (cr, (rotation*(math.pi/180)))
cairo_rotate (cr, ((360/petals*(i-1))*(math.pi/180)))
--inner arc from
cairo_move_to (cr, 0, 0)
text_arc=((2*math.pi/(petals*2))*(3))
txs1=0+inner*(math.sin(text_arc))
tys1=0-inner*(math.cos(text_arc))
--outer arc through
text_arc=((2*math.pi/(petals*2))*(3+varth1))
txs2=0+outer1*(math.sin(text_arc))
tys2=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/(petals*2))*(4))
txs3=0+outer2*(math.sin(text_arc))
tys3=0-outer2*(math.cos(text_arc))
cairo_move_to (cr, txs1, tys1)
cairo_curve_to (cr, txs1, tys1, txs2, tys2, txs3, tys3)
--outer arc through
text_arc=((2*math.pi/(petals*2))*(4+varth2))
txs4=0+outer3*(math.sin(text_arc))
tys4=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/(petals*2))*(5))
txs5=0+inner*(math.sin(text_arc))
tys5=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs3, tys3, txs4, tys4, txs5, tys5)
cairo_line_to (cr,0,0)
cairo_set_source_rgba (cr, bgred, bggreen, bgblue, 1)
cairo_fill (cr)
cairo_rotate (cr, ((360/petals*(i-1))*(math.pi/180))*-1)
cairo_rotate (cr, (rotation*(math.pi/180))*-1)
cairo_scale (cr, 1/scale, 1/scale)
cairo_translate (cr, hori*-1, vert*-1)
end
end

--BACKGROUND FLOWER PETALS
inner=60+100
outer1=60+(100*2)
outer2=(60+(100*2))
outer3=outer1
varth1=0.5
varth2=0.5
for i=1,petals do
cairo_translate (cr, hori, vert)
cairo_scale (cr, scale, scale)
cairo_rotate (cr, (rotation*(math.pi/180)))
cairo_rotate (cr, ((360/petals*(i-1))*(math.pi/180)))
--inner arc from
cairo_move_to (cr, 0, 0)
text_arc=((2*math.pi/(petals*2))*(3))
txs1=0+inner*(math.sin(text_arc))
tys1=0-inner*(math.cos(text_arc))
--outer arc through
text_arc=((2*math.pi/(petals*2))*(3+varth1))
txs2=0+outer1*(math.sin(text_arc))
tys2=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/(petals*2))*(4))
txs3=0+outer2*(math.sin(text_arc))
tys3=0-outer2*(math.cos(text_arc))
cairo_move_to (cr, txs1, tys1)
cairo_curve_to (cr, txs1, tys1, txs2, tys2, txs3, tys3)
--outer arc through
text_arc=((2*math.pi/(petals*2))*(4+varth2))
txs4=0+outer3*(math.sin(text_arc))
tys4=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/(petals*2))*(5))
txs5=0+inner*(math.sin(text_arc))
tys5=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs3, tys3, txs4, tys4, txs5, tys5)
cairo_line_to (cr,0,0)
pat = cairo_pattern_create_radial (100, 120, 10,
                                   100,  100, 128.0);
cairo_pattern_add_color_stop_rgba (pat, 0, red, green, blue, alpha/2)
cairo_pattern_add_color_stop_rgba (pat, 1, red*0.7, green*0.7, blue*0.7, alpha/2)
cairo_set_source (cr, pat)
cairo_fill (cr)
cairo_rotate (cr, ((360/petals*(i-1))*(math.pi/180))*-1)
cairo_rotate (cr, (rotation*(math.pi/180))*-1)
cairo_scale (cr, 1/scale, 1/scale)
cairo_translate (cr, hori*-1, vert*-1)
end
--INDICATOR FLOWER
inner=60+output
outer1=60+(output*2)
outer2=(60+(output*2))
outer3=outer1
varth1=0.5
varth2=0.5
for i=1,petals do
cairo_translate (cr, hori, vert)
cairo_scale (cr, scale, scale)
cairo_rotate (cr, (rotation*(math.pi/180)))
cairo_rotate (cr, ((360/petals*(i-1))*(math.pi/180)))
--inner arc from
cairo_move_to (cr, 0, 0)
text_arc=((2*math.pi/(petals*2))*(3))
txs1=0+inner*(math.sin(text_arc))
tys1=0-inner*(math.cos(text_arc))
--outer arc through
text_arc=((2*math.pi/(petals*2))*(3+varth1))
txs2=0+outer1*(math.sin(text_arc))
tys2=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/(petals*2))*(4))
txs3=0+outer2*(math.sin(text_arc))
tys3=0-outer2*(math.cos(text_arc))
cairo_move_to (cr, txs1, tys1)
cairo_curve_to (cr, txs1, tys1, txs2, tys2, txs3, tys3)
--outer arc through
text_arc=((2*math.pi/(petals*2))*(4+varth2))
txs4=0+outer3*(math.sin(text_arc))
tys4=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/(petals*2))*(5))
txs5=0+inner*(math.sin(text_arc))
tys5=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs3, tys3, txs4, tys4, txs5, tys5)
cairo_line_to (cr,0,0)
pat = cairo_pattern_create_radial (100, 120, 10,
                                   100,  100, 128.0);
cairo_pattern_add_color_stop_rgba (pat, 0, red, green, blue, alpha)
cairo_pattern_add_color_stop_rgba (pat, 1, red*0.7, green*0.7, blue*0.7, alpha)
cairo_set_source (cr, pat)
cairo_fill (cr)
cairo_rotate (cr, ((360/petals*(i-1))*(math.pi/180))*-1)
cairo_rotate (cr, (rotation*(math.pi/180))*-1)
cairo_scale (cr, 1/scale, 1/scale)
cairo_translate (cr, hori*-1, vert*-1)
end
--draw center circle
cairo_translate (cr, hori, vert)
cairo_scale (cr, scale, scale)
circrad=60
circx=0
circy=0
cairo_move_to (cr, 100, 100);
cairo_arc(cr,circx,circy,circrad,0,2*math.pi)
cairo_close_path(cr)
cairo_set_source_rgba (cr, 1, 1, 0, 1);
cairo_fill (cr);
cairo_scale (cr, 1/scale, 1/scale)
cairo_translate (cr, -hori, -vert)

--draw hearts delete or comment out this part to remove the hearts
scale=0.75
xpos=hori
ypos=vert+200
--cairo_set_source_rgba (cr, 255/255, 100/255, 130/255, 1)
cairo_translate (cr, xpos, ypos)
cairo_translate (cr, 200*scale*-1, 150*scale*-1);
cairo_move_to (cr, 200*scale, 150*scale);
--top right bump
cairo_curve_to (cr, 210*scale, 100*scale, 290*scale, 90*scale, 300*scale, 160*scale);
--right side
cairo_curve_to (cr, 300*scale, 160*scale, 320*scale, 270*scale, 200*scale, 320*scale);
--left side
cairo_curve_to (cr, 200*scale, 320*scale, 80*scale, 270*scale, 100*scale, 160*scale);
--left bump
cairo_curve_to (cr, 110*scale, 100*scale, 190*scale, 90*scale, 200*scale, 160*scale);
pat = cairo_pattern_create_radial (150*scale, 160*scale, 10*scale,
                                   150*scale,  160*scale, 128*scale);
cairo_pattern_add_color_stop_rgba (pat, 0, red, green, blue, alpha)
cairo_pattern_add_color_stop_rgba (pat, 1, red*0.7, green*0.7, blue*0.7, alpha)
cairo_set_source (cr, pat)
cairo_close_path (cr);
cairo_fill (cr)
cairo_translate (cr, 200*scale, 150*scale)
cairo_translate (cr, -xpos, -ypos)

end

function conky_draw_flower()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)

output=tonumber(conky_parse('${fs_used_perc /}'))
hori=210
vert=200
scale=0.4
rotation=0
red, green, blue, alpha=241/255,39/255,167/255,1
petals=5
--for flat opaque background enter 1
background=1
bgred=0.9
bggreen=0.7
bgblue=0.7
flower (output, hori, vert, scale, rotation, red, green, blue, alpha, petals)
circlewriting(cr, "FILESYSTEM USED", "Teenage Fantasy Romance Novel", 22, 110, hori, vert, red, green, blue, alpha, 270, 390, 0)

output=tonumber(conky_parse('${cpu}'))
hori=425
vert=200
scale=0.4
rotation=0
red, green, blue, alpha=241/255,39/255,115/255,1
petals=7
--for flat opaque background enter 1
background=1
bgred=0.9
bggreen=0.7
bgblue=0.7
flower (output, hori, vert, scale, rotation, red, green, blue, alpha, petals)
circlewriting(cr, "CENTRAL PROCESSOR", "Teenage Fantasy Romance Novel", 22, 110, hori, vert, red, green, blue, alpha, 300, 420, -0.05)

output=tonumber(conky_parse('${memperc}'))
hori=640
vert=200
scale=0.4
rotation=0
red, green, blue, alpha=243/255,39/255,40/255,1
petals=6
--for flat opaque background enter 1
background=1
bgred=0.9
bggreen=0.7
bgblue=0.7
flower (output, hori, vert, scale, rotation, red, green, blue, alpha, petals, background, bgred, bggreen, bgblue)
circlewriting(cr, "RANDOM ACCESS MEMORY", "Teenage Fantasy Romance Novel", 22, 110, hori, vert, red, green, blue, alpha, 320, 440, 0)
end
end

Re: My Conky Config

@ noMaster

I'm sorry it's not working for you.
it could be your version of conky but you have 1.7.2 which should be high enough...

can you get other lua scripts working in conky?

it could be an arch thing too... maybe ask at the arch forum about getting conky with lua and cairo suppoert running?

I do not know anything about using arch

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.