Re: My Conky Config

Bruce wrote:
wlourf wrote:

I read your note on your blog and I see I tried to do something like you this morning.
The capture:

I'd like to see the conky - the code and everything that did that.  It's great.

How did you get the graph sideways?

Have a nice day.
Bruce

all the various codes should be posted above for the charts and bars.  Not the sideways one however, although that should be pretty easy to replicate now that the basic data capturing mechanism is sorted.  You could really feed the data into no end of different display "widgets".

and as for being a noob... maybe not a "total" noob... but it really is like learning a spoken language... you pick up a few words here or there but when it comes to the complicated parts like conjugating verbs or using slang I have no idea smile

Last edited by mrpeachy (2010-02-14 18:09:04)

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.

877

Re: My Conky Config

mrpeachy wrote:

all the various codes should be posted above for the charts and bars.  Not the sideways one however, although that should be pretty easy to replicate now that the basic data capturing mechanism is sorted.  You could really feed the data into no end of different display "widgets".

OK, I'll check that out.

mrpeachy wrote:

and as for being a noob... maybe not a "total" noob... but it really is like learning a spoken language... you pick up a few words here or there but when it comes to the complicated parts like conjugating verbs or using slang I have no idea smile

OK, who told you I teach English?  That's is a GREAT analogy!
And of course you are talking verbs in another language not English, right?  We don't conjugate verbs compared to other languages.  But slang, well, that's another matter.  It's a language all on it's own and probably more alive than the actual language that it's based on.

I must get my nose into a "bash" book some day soon.

Have a nice day.
Bruce

Re: My Conky Config

Bruce wrote:
mrpeachy wrote:

all the various codes should be posted above for the charts and bars.  Not the sideways one however, although that should be pretty easy to replicate now that the basic data capturing mechanism is sorted.  You could really feed the data into no end of different display "widgets".

OK, I'll check that out.

mrpeachy wrote:

and as for being a noob... maybe not a "total" noob... but it really is like learning a spoken language... you pick up a few words here or there but when it comes to the complicated parts like conjugating verbs or using slang I have no idea smile

OK, who told you I teach English?  That's is a GREAT analogy!
And of course you are talking verbs in another language not English, right?  We don't conjugate verbs compared to other languages.  But slang, well, that's another matter.  It's a language all on it's own and probably more alive than the actual language that it's based on.

I must get my nose into a "bash" book some day soon.

Have a nice day.
Bruce

Hi Bruce,
I'm not sure to understand "sideways" in the context of the script ! But as the bar is a widget you can set up like you want like on this picture :
http://img130.imageshack.us/img130/4880/equalizerwidget.th.png
(full code on my deviant page)
The moving graph I posted before is just for fun because it use too much cpu, actually I work on "reminder" bar  like on this video

EDIT:
so I finished the "reminder" bar :see it in action here
It use the same widget as before (version 1.1) but the trick was to retain the previous value and to draw the bar with an alpha less than the bar and behind the actual bar.
The code for the script :

--[[ THE WIDGET CODE GOES HERE (paste it from previous post)]]

function conky_main()
    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 x0,y0 = 10,conky_window.height-10
    local blocks = 30
    local cap_round = CAIRO_LINE_CAP_ROUND
    local cap_square = CAIRO_LINE_CAP_SQUARE
    local cap_butt = CAIRO_LINE_CAP_BUTT
    local w,h=25,10
    local s=1
    local bgc,bga = 0x009933, 0.3
    local fgc,fga = 0x66FF00, 1
    local alc,ala = 0xFF0000, 1
    local mid_color,mid_alpha = 0xFFFF00, 1.0
    local led_effect, led_alpha = true ,  1.0
    local alarm = 80
    local smooth = false
    local angle = 0
    

--reminder : the order of the parameters:
--(name, arg, max, nb_blocks, cap, xb, yb, w, h, space, bgc, bga, fgc, fga,alc,ala,alarm,led_effect,led_alpha,smooth,mid_color,mid_alpha,rotation)    

    local updates=tonumber(conky_parse('${updates}'))
    if updates==0 then
        value0=0
        value1=0
        value2=0        
    else
        oldvalue0=value0
        oldvalue1=value1
        oldvalue2=value2                
        value0=tonumber(conky_parse('${cpu cpu0}'))+30
        value1=tonumber(conky_parse('${cpu cpu1}'))+50
        value2=math.random(50,90)
    end
    equalizer('',oldvalue0,    100,    blocks, cap_butt, x0, y0,             w,h,s,bgc,0, fgc,0.5, alc,0.25, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,0)
    equalizer('',oldvalue1,    100,    blocks, cap_butt, x0+w+s,     y0,     w,h,s,bgc,0, fgc,0.5, alc,0.25, alarm, led_effect, led_alpha,true,mid_color,mid_alpha,0)    
    equalizer('',oldvalue2,    100,    blocks, cap_round, x0+2*(w+s)+5, y0,     w/2,h,s,bgc,0, bgc,1, alc,0.25, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,0)        

    equalizer('',value0,    100,    blocks, cap_butt, x0, y0,             w,h,s,bgc,0, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,0)
    equalizer('',value1,    100,    blocks, cap_butt, x0+w+s, y0,         w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,true,mid_color,mid_alpha,0)    
    equalizer('',value2,    100,    blocks, cap_round, x0+2*(w+s)+5, y0,     w/2,h,s, bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,0)    

    cairo_destroy(cr)
    cairo_surface_destroy(cs)
end

Now, do you know if an audio spectrum exist for conky. I saw one for gnome and screenlets but didn't manage to get it work :
http://linux.softpedia.com/get/Multimed … 6924.shtml

If it does not exist, I think I will try to make it  ;-)

Last edited by wlourf (2010-02-14 23:48:07)

Re: My Conky Config

here is an example of the possibilities of displaying output

http://omploader.org/tM2s0bA

and watch (on white bg coz of record my dsktop)
http://blip.tv/file/3218696

current cpu value is represented at the top with the full black bar and then makes its way around the circle, getting more and more transparent.

here is the code

--[[circlebargraph 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 circlewriting(inum, text, ival, font, fsize, radi, horiz, verti, tred, tgreen, tblue, var1, var2)
deg=360/inum
text_arc=((2*math.pi/inum)*ival+var1)
txs=0+radi*(math.sin(text_arc))
tys=0-radi*(math.cos(text_arc))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 22);
cairo_set_source_rgba (cr, tred, tgreen, tblue, ival/10);


cairo_translate (cr, txs+horiz, tys+verti)
cairo_rotate (cr, (deg*(ival+var2)*(math.pi/180)))
cairo_rectangle (cr, 0, 0, 20, (text*-1))
cairo_fill (cr)
cairo_rotate (cr, ((deg*(ival+var2)*(math.pi/180)*-1)))
cairo_translate (cr, -1*(txs+horiz), -1*(tys+verti))


--you can reinstate these lines to get a text output around the circle
--cairo_move_to (cr, txs+horiz, tys+verti);
--cairo_rotate (cr, (deg*(ival+var2)*(math.pi/180)))
--cairo_show_text (cr, (addzero100(text)))
--cairo_rotate (cr, ((deg*(ival+var2)*(math.pi/180)*-1)))
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==1 then     
        len_t=10
        t1={}   
    end
    if updates> 3 then
      for i = 1, tonumber(len_t) do
            if t1[i+1]==nil then t1[i+1]=0 end
            t1[i]=t1[i+1]    
            if i==len_t then
                t1[len_t]=tonumber(conky_parse('${cpu}'))
            end
            --circlewriting (inum, text, ival, font, fsize, radi, horiz, verti, tred, tgreen, tblue, var1, var2)
            circlewriting(len_t, t1[i], i, "Mono", 22, 40, 200, 200, 0, 0, 0, -0.25, 0)
      end        
      cairo_destroy(cr)
      cairo_surface_destroy(cs)
   end
end

is it particularly informative? ...not really ...but I think it looks cool.
Just playing to see what can be done
note - i hate circle math smile

Last edited by mrpeachy (2010-02-23 04:52:20)

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.

880

Re: My Conky Config

cool work mrpeachy

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

Re: My Conky Config

tawan wrote:

cool work mrpeachy

thanks tawan! big_smile
You should have a go at the whole cairo lua thing.
You've come up with some innovative and cool looking conkyrc's.  I think you would be pleased with the results you could achieve from a lua script.

Last edited by mrpeachy (2010-02-15 02:09:20)

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.

882

Re: My Conky Config

mrpeachy wrote:

here is an example of the possibilities of displaying output

http://omploader.org/tM2s0bA

and watch (on white bg coz of record my dsktop)
http://blip.tv/file/3218696

i have copied your script to ~/.conky/cpucircle.lua, then added the following line to an "empty" conky config:

##############################################
#  Output
##############################################
lua_load /home/koegs/.conky/cpucircle.lua
lua_draw_hook_pre draw_graph
TEXT

But all i get on start is:

Conky: llua_do_call: function conky_draw_graph execution failed: /home/koegs/.conky/cpucircle.lua:25: attempt to perform arithmetic on local 'text' (a nil value)


What am i doing wrong?

883

Re: My Conky Config

mrpeachy wrote:

my very first lua cairo thingy in conky!

http://omploader.org/tM2R0aQ

red is cpu
green is mem
blue is filesystem used

i have included angled text labels:
http://omploader.org/tM2R0cQ

and here is the lua script i used

...

Copy&Pasted your lua and the conky config lines, but all i get at start:

koegs@thinkoegs:~$ conky -c .conkysysinfocorner
Conky: llua_load: /home/koegs/.conky/sysinfocorner.lua:1: attempt to call global 're' (a nil value)
Conky: forked to background, pid is 3999
koegs@thinkoegs:~$ 
Conky: desktop window (116) is root window
Conky: window type - desktop
Conky: drawing to created window (0x1800001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_draw_lines execution failed: attempt to call a nil value

Re: My Conky Config

@ kawds

RE this line:
Conky: llua_do_call: function conky_draw_graph execution failed: /home/koegs/.conky/cpucircle.lua:25: attempt to perform arithmetic on local 'text' (a nil value)
I get the same error when I initially launch the script, i think its just to do with the array setting itself up.
But then after that the figure draws itself in the conky window.

Do you get the error repeated again and again?

as for the attempted to call a nil value... are you sure you didn't miss anything when you copied the scripts over? particularly those last 2 lines with "end"?
the other thing that you need to check is that the call lines in the conkyrc match exactly to the location and name of the lua script, and that they are calling the right function... in that case "draw_lines".

otherwise i just tried both scripts, copied from my forum entries and they are working for me.

what version of conky are you running?

Last edited by mrpeachy (2010-02-15 15:38: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.

885

Re: My Conky Config

@mrpeachy

conky config: http://pastebin.com/f167fbd0f

lua script: http://pastebin.com/f622ea1c7

Version:
Conky 1.8.0_rc2 compiled


EDIT: Got the script/lua working. Still working on the cpu circle:

Conky: llua_do_call: function conky_draw_graph execution failed: /home/koegs/.conky/cpucircle.lua:48: 'for' limit must be a number

Last edited by kawds (2010-02-15 16:49:02)

Re: My Conky Config

kawds wrote:

@mrpeachy

conky config: http://pastebin.com/f167fbd0f

lua script: http://pastebin.com/f622ea1c7

Version:
Conky 1.8.0_rc2 compiled


EDIT: Got the script/lua working. Still working on the cpu circle:

Conky: llua_do_call: function conky_draw_graph execution failed: /home/koegs/.conky/cpucircle.lua:48: 'for' limit must be a number

for that error, if you look at the code the value len_t (which is the 'limit' that the error refers to) is set only when conky update number is 1... so to get the cpu ring working you have to restart conky to reset the update number... just make sure you killall conky first, or use the #! obmenu entry to restart conky.  I have found that if you have your conky update interval set to faster than 1 (second) then the script can go wrong and that number doesnt get set.  You could change the numbers to give the script more time ... just change

if updates==1 then     ---> change to 5 for example
        len_t=10
        t1={}   
    end
    if updates> 3 then  --->change to 10 for example
.

Last edited by mrpeachy (2010-02-15 17:45: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.

887

Re: My Conky Config

Ok, it works now.

Any idea how to get this one to the center of the desktop?

888

Re: My Conky Config

EDIT: forgot this image you'll need.

Someone asked me to share this so I'm doing it here. This is very unlikely to work on anyone elses system without all the scripts it relies on but if you want to take an idea you can look at the code.

http://omploader.org/tM2ttZg

#  Settings
##############################################
# Use XftD
use_xft yes
xftfont Bauhaus Md BT:size=8
xftalpha 1.0
text_buffer_size 2048
if_up_strictness address

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window no
own_window_transparent yes
own_window_type desktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
#minimum_size 350
#maximum_width 350

# Draw shadesD
draw_shades yes

# Draw outlinesD
draw_outline no

# Draw borders around text
draw_borders no

# Stippled bordersD
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color FFFFDD
#good blue 1994d1
color1 707070
color2 1994d1
color3 a90100
color4 cccccc
#default_shade_color 888888
#default_outline_color 888888
own_window_colour 000000

# Text alignment, other possible values are commented
alignment tl

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 0

# Subtract file system buffers from used memoryD
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2


# Force UTF8D note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving aboutD  This only affects certain objects.
use_spacer none

TEXT
${image image.png -p 0,4}
${goto 8}${color1}${voffset -20}${font Rebecca:size=84}${execpi 900 python ~/.conky/gmail_parser.py NAME PASSWORD 1}${font}    ${goto 95}${voffset -49}${font pizzadude bullets:size=48}${if_match ${upspeedf wlan0} >= 20}${color2}w${else}${if_match ${upspeedf wlan0} >= 2}${color2}v${else}${color1}v${endif}${endif}${color1}    ${goto 174}${if_match ${downspeedf wlan0} >= 40}${color2}s${else}${if_match ${downspeedf wlan0} >= 2}${color2}r${else}${color1}r${endif}${endif}${color1}    ${goto 357}${execpi 5000 ~/mybin/tawan-check-updates}    ${goto 440}${font StyleBats:size=52}${voffset 5}${if_match ${acpitemp} >= 70}${color3}${else}${if_match ${acpitemp} >= 60}${color2}${else}${color1}${endif}${endif}p${color1}    ${goto 520}${if_match ${battery_percent BAT0} <= 20}${color3}${else}${color2}${endif}${if_existing /sys/class/power_supply/ACAD/online 1}${color1}I${else}O${endif}    ${goto 258}${font StyleBats:size=16}${voffset -4}${if_match ${fs_used_perc /home/tawan/Data} >= 75}${color3}${else}${if_match ${diskio /dev/sda} >= 1}${color2}${else}${color1}${endif}G${endif}${color1}    ${goto 279}${voffset 2}${if_match ${memperc} >= 80}${color3}${else}${if_match ${memperc} >= 40}${color2}${else}${color1}${endif}${endif}y${color1}    ${goto 300}${voffset -2}${if_match ${cpu cpu1} >= 90}${color3}${else}${if_match ${cpu cpu1} >= 40}${color2}${else}${color1}${endif}${endif}l${color1}    ${goto 319}${if_match ${cpu cpu2} >= 90}${color3}${else}${if_match ${cpu cpu2} >= 40}${color2}${else}${color1}${endif}${endif}l${color1}    ${goto 600}${voffset -30}${color2}${font Radio space:size=32}${time %R}${font}
${goto 603}${color4}${font Jura:size=8}${time %A %e%b %Y}${font}${color}    ${if_match ${battery_percent BAT0} <= 80}${color2}${voffset -27}${goto 270}${battery_bar 6,56 BAT0}${endif}

























































${if_existing /sys/class/power_supply/ACAD/online 0}${if_match ${battery_percent BAT0} <= 11}${if_match ${battery_percent BAT0} > 8}${execi 300 ~/mybin/tawan-warn-shutdown}${endif}${endif}${if_match ${battery_percent BAT0} <= 8}${execi 200 ~/mybin/tawan-shutdown-now}${endif}${endif}
${execi 600 ~/mybin/tawan-timed-torrent}

EDIT: added battery bar that only shows when bat below 80% (shows as a bar above the 4 small icons in the middle)

http://omploader.org/vM2t3ZA

Last edited by tawan (2010-02-17 03:22:48)

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

Re: My Conky Config

koegs wrote:

Ok, it works now.

Any idea how to get this one to the center of the desktop?

to center a window use the gap_x and gap_y settings to set how far away the conky window sits from the edges of your screen.

glad that every thing's working!

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.

890

Re: My Conky Config

you can center a conky with the value for

"alignment tm"  (top middle)

bm (bottom middle) and so on.

(if that is what you meant)

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

Re: My Conky Config

conky flowers revisited

http://omploader.org/tM2t3dQ

while looking quite similar to the flower conky I posted a little while ago, I have made some significant changes.
Previously the flower color change "effect" was created by placing a circle that changed size in response to a numerical input from say, cpu usage, behind a flower "cutout".
That's why it was on a black background, and would only work on a flat monotone background.  Otherwise you would have this:
http://omploader.org/tM2t3dg
it was all an illusion! smile ...but i still really like this version

but with the updated version I have used the data output to transform some much more complicated shapes so that the "cutout" is no longer needed.
each flower has 4 components,  background "petals" bg, indicator "petals" in, middle circle, md and a single back flower shape bk.  I included bk so that on busy wallpapers you could set bka (alpha) high to allow the bg petal overlap, if thats what you wanted, without the wallpaper showing through.
here is the code:

UPDATED - now with the improved circlewriting function
and now with a selectable bumpy middle smile
http://omploader.org/tM213ZA

EVEN MORE UPDATES smile
you can now select the number of petals per flower
http://omploader.org/tM214cA

--[[flowers version2 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 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(cr, co, hori, vert, scale, rot, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
inner=167
outer1=260
outer2=251
outer3=265
varth1=0.53
varth2=0.42
cairo_move_to (cr, 0, 0)
cairo_translate (cr, hori, vert)
cairo_scale (cr, scale, scale)
cairo_rotate (cr, (rot*(math.pi/180)))
--flower background
--inner arc from
cairo_set_source_rgba (cr, bkr, bkg, bkb, bka);
text_arc=((2*math.pi/12)*(3))
txs1=0+inner*(math.sin(text_arc))
tys1=0-inner*(math.cos(text_arc))
--outer arc through
text_arc=((2*math.pi/12)*(3+varth1))
txs2=0+outer1*(math.sin(text_arc))
tys2=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(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/12)*(4+varth2))
txs4=0+outer3*(math.sin(text_arc))
tys4=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(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)
--outer arc through
text_arc=((2*math.pi/12)*(5+varth1))
txs6=0+outer1*(math.sin(text_arc))
tys6=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(6))
txs7=0+outer2*(math.sin(text_arc))
tys7=0-outer2*(math.cos(text_arc))
cairo_curve_to (cr, txs5, tys5, txs6, tys6, txs7, tys7)
--outer arc through
text_arc=((2*math.pi/12)*(6+varth2))
txs8=0+outer3*(math.sin(text_arc))
tys8=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(7))
txs9=0+inner*(math.sin(text_arc))
tys9=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs7, tys7, txs8, tys8, txs9, tys9)
--outer arc through
text_arc=((2*math.pi/12)*(7+varth1))
txs10=0+outer1*(math.sin(text_arc))
tys10=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(8))
txs11=0+outer2*(math.sin(text_arc))
tys11=0-outer2*(math.cos(text_arc))
cairo_curve_to (cr, txs9, tys9, txs10, tys10, txs11, tys11)
--outer arc through
text_arc=((2*math.pi/12)*(8+varth2))
txs12=0+outer3*(math.sin(text_arc))
tys12=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(9))
txs13=0+inner*(math.sin(text_arc))
tys13=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs11, tys11, txs12, tys12, txs13, tys13)
--outer arc through
text_arc=((2*math.pi/12)*(9+varth1))
txs14=0+outer1*(math.sin(text_arc))
tys14=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(10))
txs15=0+outer2*(math.sin(text_arc))
tys15=0-outer2*(math.cos(text_arc))
cairo_curve_to (cr, txs13, tys13, txs14, tys14, txs15, tys15)
--outer arc through
text_arc=((2*math.pi/12)*(10+varth2))
txs16=0+outer3*(math.sin(text_arc))
tys16=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(11))
txs17=0+inner*(math.sin(text_arc))
tys17=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs15, tys15, txs16, tys16, txs17, tys17)
--outer arc through
text_arc=((2*math.pi/12)*(11+varth1))
txs18=0+outer1*(math.sin(text_arc))
tys18=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(12))
txs19=0+outer2*(math.sin(text_arc))
tys19=0-outer2*(math.cos(text_arc))
cairo_curve_to (cr, txs17, tys17, txs18, tys18, txs19, tys19)
--outer arc through
text_arc=((2*math.pi/12)*(12+varth2))
txs20=0+outer3*(math.sin(text_arc))
tys20=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(13))
txs21=0+inner*(math.sin(text_arc))
tys21=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs19, tys19, txs20, tys20, txs21, tys21)
--outer arc through
text_arc=((2*math.pi/12)*(13+varth1))
txs22=0+outer1*(math.sin(text_arc))
tys22=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(14))
txs23=0+outer2*(math.sin(text_arc))
tys23=0-outer2*(math.cos(text_arc))
cairo_curve_to (cr, txs21, tys21, txs22, tys22, txs23, tys23)
--outer arc through
text_arc=((2*math.pi/12)*(14+varth2))
txs24=0+outer3*(math.sin(text_arc))
tys24=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/12)*(15))
txs25=0+inner*(math.sin(text_arc))
tys25=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs23, tys23, txs24, tys24, txs25, tys25)
cairo_close_path (cr)
cairo_fill (cr)
--petal background
cpu=150
petals=petals
for i = 1,petals do
cairo_set_source_rgba (cr, bgr, bgg, bgb, bga)
rotate=(i-1)*(360/petals)
cairo_rotate (cr, (rotate*(math.pi/180)))
cairo_curve_to (cr, -100, 0, -100, -1*(100+cpu), 0, -1*(100+cpu))
cairo_line_to (cr, 0, -100)
cairo_arc_negative (cr, 0, 0, 100, (-90*(math.pi/180)), (180*(math.pi/180)))
cairo_close_path (cr)
cairo_fill (cr)
cairo_curve_to (cr, 100, 0, 100, -1*(100+cpu), 0, -1*(100+cpu))
cairo_line_to (cr, 0, -100)
cairo_arc (cr, 0, 0, 100, (270*(math.pi/180)), (0*(math.pi/180)))
cairo_close_path (cr)
cairo_fill (cr)
cairo_rotate (cr, (-rotate*(math.pi/180)))
end
--indicator flower
cpu=co*1.5
if cpu==0 then
ina=0
end
petals=petals
for i = 1,petals do
cairo_set_source_rgba (cr, inr, ing, inb, ina)
rotate=(i-1)*(360/petals)
cairo_rotate (cr, (rotate*(math.pi/180)))
cairo_curve_to (cr, -100, 0, -100, -1*(100+cpu), 0, -1*(100+cpu))
cairo_line_to (cr, 0, -100)
cairo_arc_negative (cr, 0, 0, 100, (-90*(math.pi/180)), (180*(math.pi/180)))
cairo_close_path (cr)
cairo_fill (cr)
cairo_curve_to (cr, 100, 0, 100, -1*(100+cpu), 0, -1*(100+cpu))
cairo_line_to (cr, 0, -100)
cairo_arc (cr, 0, 0, 100, (270*(math.pi/180)), (0*(math.pi/180)))
cairo_close_path (cr)
cairo_fill (cr)
cairo_rotate (cr, (-rotate*(math.pi/180)))
end

--draw center circle
circrad=100
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, mdr, mdg, mdb, mda);
cairo_fill (cr);

if bumps==1 then
inner=100
outer1=120
outer2=115
outer3=120
varth1=0.5
varth2=0.5
number=2*petals
for i = 1,number do
cairo_set_source_rgba (cr, mdr, mdg, mdb, mda);
--inner arc from
text_arc=((2*math.pi/number)*(i+2))
txs1=0+inner*(math.sin(text_arc))
tys1=0-inner*(math.cos(text_arc))
--outer arc through bump1
text_arc=((2*math.pi/number)*((i+2)+varth1))
txs2=0+outer1*(math.sin(text_arc))
tys2=0-outer1*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/number)*(i+3))
txs3=0+outer2*(math.sin(text_arc))
tys3=0-outer2*(math.cos(text_arc))
cairo_move_to (cr, 0, 0)
cairo_line_to (cr, txs1, tys1)
cairo_curve_to (cr, txs1, tys1, txs2, tys2, txs3, tys3)
--outer arc through
text_arc=((2*math.pi/number)*((i+3)+varth2))
txs4=0+outer3*(math.sin(text_arc))
tys4=0-outer3*(math.cos(text_arc))
--outer arc to
text_arc=((2*math.pi/number)*(i+4))
txs5=0+inner*(math.sin(text_arc))
tys5=0-inner*(math.cos(text_arc))
cairo_curve_to (cr, txs3, tys3, txs4, tys4, txs5, tys5)
end
cairo_close_path (cr)
cairo_fill (cr)
end

cairo_rotate (cr, rot*-1*(math.pi/180))
cairo_scale (cr, 1/scale, 1/scale)
cairo_translate (cr, -hori, -vert)
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)
--FLOWER 1 SETUP----------------------------------------------------------------------------------------------------------------------------------
num=tonumber(conky_parse('${cpu}'))
xpos=150
ypos=110
bgr=234/255
bgg=86/255
bgb=162/255
bga=0.5
inr=197/255
ing=29/255
inb=106/255
ina=0.9
mdr=241/255
mdg=219/255
mdb=107/255
mda=1
bkr=1 
bkg=1 
bkb=1 
bka=0
bumps=1
petals=8
flower(cr, num, xpos, ypos, 0.4, 50, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
--circlewriting variable
--text must be in quotes
text=("CENTRAL PROCESSOR") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=30
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=270
finish=450
letterposition=-0.1
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--FLOWER 2 SETUP----------------------------------------------------------------------------------------------------------------------------------
num=tonumber(conky_parse('${memperc}'))
xpos=350
ypos=110
bgr=149/255
bgg=140/255
bgb=203/255
bga=0.5
inr=110/255
ing=107/255
inb=212/255
ina=0.9
mdr=245/255
mdg=227/255
mdb=101/255
mda=1
bkr=1 
bkg=1 
bkb=1 
bka=0
bumps=1
petals=6
flower(cr, num, xpos, ypos, 0.4, 10, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
--circlewriting variable
--text must be in quotes
text=("RANDOM ACCESS") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=30
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=270
finish=450
letterposition=-0.1
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--circlewriting variable
--text must be in quotes
text=("   MEMORY   ") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=37
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=270
finish=90
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--FLOWER 3 SETUP-------------------------------------------------------------------------------------------------------------------------------------
num=tonumber(conky_parse('${fs_used_perc /}'))
xpos=550
ypos=110
bgr=241/255
bgg=169/255
bgb=58/255
bga=0.5
inr=224/255
ing=115/255
inb=12/255
ina=0.9
mdr=242/255
mdg=184/255
mdb=160/255
mda=1
bkr=1 
bkg=1 
bkb=1 
bka=0
bumps=1
petals=7
flower(cr, num, xpos, ypos, 0.4, 50, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
--circlewriting variable
--text must be in quotes
text=("FILESYSTEM USED") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=30
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=270
finish=450
letterposition=-0.1
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--FLOWER 4 SETUP----------------------------------------------------------------------------------------------------------------------------------
num=tonumber(conky_parse('${swapperc}'))
xpos=350
ypos=310
bgr=225/255
bgg=225/255
bgb=0/255
bga=0.5
inr=200/255
ing=100/255
inb=100/255
ina=0.9
mdr=226/255
mdg=198/255
mdb=197/255
mda=1
bkr=1 
bkg=1 
bkb=1 
bka=0
bumps=1
petals=9
flower(cr, num, xpos, ypos, 0.4, 20, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
--circlewriting variable
--text must be in quotes
text=("SWAP PARTITION") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=30
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=270
finish=450
letterposition=-0.1
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--FLOWER 4 SETUP----------------------------------------------------------------------------------------------------------------------------------
num=tonumber(conky_parse('${wireless_link_qual}'))
xpos=550
ypos=310
bgr=230/255
bgg=160/255
bgb=108/255
bga=0.5
inr=238/255
ing=95/255
inb=141/255
ina=0.9
mdr=253/255
mdg=250/255
mdb=209/255
mda=1
bkr=1 
bkg=1 
bkb=1 
bka=0
bumps=1
petals=6
flower(cr, num, xpos, ypos, 0.4, 10, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
--circlewriting variable
--text must be in quotes
text=("WIFI CONNECTION") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=30
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=270
finish=450
letterposition=-0.1
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--FLOWER 6 SETUP----------------------------------------------------------------------------------------------------------------------------------
num=tonumber(conky_parse('${battery_percent}'))
xpos=550
ypos=510
bgr=80/255
bgg=74/255
bgb=180/255
bga=0.5
inr=190/255
ing=128/255
inb=202/255
ina=0.9
mdr=251/255
mdg=208/255
mdb=225/255
mda=1
bkr=1 
bkg=1 
bkb=1 
bka=0
bumps=1
petals=5
flower(cr, num, xpos, ypos, 0.4, 35, bgr, bgg, bgb, bga, inr, ing, inb, ina, mdr, mdg, mdb, mda, bkr, bkg, bkb, bka, bumps, petals)
--circlewriting variable
--text must be in quotes
text=("BATTERY CHARGE") 
--font name must be in quotes
font="White Rabbit"
fontsize=12
radius=30
positionx=xpos
positiony=ypos
colorred=inr
colorgreen=ing
colorblue=inb
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=270
finish=450
letterposition=-0.1
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--END OF FLOWER SETUP----------------------------------------------------------------------------------------------------------------------------
end
end

Last edited by mrpeachy (2010-02-23 04:51:45)

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

New and improved circlewriting functions
http://omploader.org/tM2w2Nw
The function gets the positioning and orientation of the text correct, but for reasons explained below there is a fine tuning variable too

circlewriting writes text across the top of a circle, on the outside
circlewritingdown writes text along the bottom of a circle on the inside as so:

http://omploader.org/tM2w2Yw

UPDATE - i have added a start and finish degree function so you can get this kind of thing:
http://omploader.org/tM2w4NQ
This is what the code below will give you.

Otherwise, just put the circlewriting and circlewritingdown  functions in a lua script above the function you will be calling in conky, then activate the functions as shown below:

I've been messing around with the fine tuning, and I think i have got it as good as I can get.  There is only 1 variable to change, and typically not by much at all to get everything aligned exactly.  It has to do with how cairo writes each letter at each point. 
I believe that bottom left corner of each letter is placed on the plot point, so that when:

letter 1 is set and faces right like so:
|->

but when you turn that upside down you get the opposite:
<-|

So when you have a rotation that lands one letter upside down and directly above another letter you get:

<-|
    |->

So they don't align properly. The variable I have included is so that you can get this:
<-|
|->

and everything looks nice smile

--[[circlewriting 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 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_stroke (cr)
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_stroke (cr)
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end
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)



--circlewriting variable
cpu=tonumber(conky_parse('${cpu}'))
--text must be in quotes
text=("CPU " .. (addzero100(cpu)) .. "%") 
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=80
positionx=100
positiony=150
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=0
finish=120
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewritingdown variables
mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=("MEMORY " .. (addzero100(mem)) .. "%")
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=90
positionx=230
positiony=270
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=300
finish=180
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewritingdown variable
hdd=tonumber(conky_parse('${fs_used_perc /}'))
--text must be in quotes
text=("FILESYS " .. (addzero100(hdd)) .. "%") 
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=80
positionx=260
positiony=280
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=180
finish=0
letterposition=0.06
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewriting variables
swap=tonumber(conky_parse('${swapperc}'))
--text must be in quotes
text=("SWAP " .. (addzero100(swap)) .. "% ") 
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=60
positionx=105
positiony=130
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=200
finish=340
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)


end
end

Last edited by mrpeachy (2011-05-14 06:20:49)

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.

893

Re: My Conky Config

very cool Mr Peachy

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

Re: My Conky Config

tawan wrote:

very cool Mr Peachy

Thank you very much tawan smile

Last edited by mrpeachy (2010-02-18 01:22:35)

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 am back with my attempt to draw an audio equalizer widget with conky !
I post on this thread on ubuntu forums which is more appropriate (Conky Lua & Cairo Troubleshooting):
http://ubuntu-ky.ubuntuforums.org/showp … tcount=174
The result is a bit slow and I try to get it faster but actually I'm stuck with C code, so if you have any idea ...

Re: My Conky Config

Ive been modifying circle meters... added the option for rounded lines, rounded borders, square borders and anticlockwise meters.
http://omploader.org/tM2xnbQ

The list of variables to feed the ring meter functions is quite long so i have put the input into a table form (see bottom of the script) for easier setup.
One example or a clockwise ring meter and one example of an anticlockwise ring meter is included in the code as well as 2 examples of bars.
Just delete the relevant lines, or comment out to remove bars or rings.
Copy and paste, then edit settings to get more bars or rings.

--[[improved bars and rings version2 by mrpeachy (2010), ring meters based on Ring Meters by londonali1010 (2009)]]
require "cairo"
function draw_bar(co, width, height, across, down, bgr, bgg, bgb, bga, inr, ing, inb, ina, lw, lr, lg, lb, la, rotate)
--indicator calculation
conum=tonumber(co)
local inum=(((width-lw)/100)*conum)
--background bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, bgr, bgg, bgb, bga);
cairo_rectangle (cr, 0, 0, (width-lw), (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--indicator bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, inr, ing, inb, ina);
cairo_rectangle (cr, 0, 0, inum, (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--boundary line
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_line_width (cr, lw);
cairo_set_source_rgba (cr, lr, lg, lb, la);
cairo_rectangle (cr, -lw/2, -lw/2, width, height)
cairo_stroke (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
end

function draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina, bolw, bor, bog, bob, boa, bilw, bir, big, bib, bia, rounded, roundedborder, squareborder)
if rounded == 1 then
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
end
deg=(rend-rstart)/100
degrads=1*(math.pi/180)
start=rstart*degrads-math.pi/2
finish=rend*degrads-math.pi/2
interval=degrads*(start+(deg*(co)))
stx=0+rad*(math.sin(degrads*rstart))
sty=0-rad*(math.cos(degrads*rstart))
ftx=0+rad*(math.sin(degrads*rend))
fty=0-rad*(math.cos(degrads*rend))
-- Draw background ring
cairo_move_to (cr, across+stx, down+sty)
cairo_arc(cr,across,down,rad,start,finish)
cairo_set_source_rgba(cr,bgr,bgg,bgb,bga)
cairo_set_line_width(cr,inlw)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc(cr,across,down,rad,start,start+interval)
cairo_set_source_rgba(cr,inr,ing,inb,ina)
cairo_stroke(cr)
--boundary rings
cairo_set_line_cap  (cr, CAIRO_LINE_CAP_BUTT)
--outside boundary
cairo_arc(cr,across,down,(rad+(inlw/2)+(bolw/2)),start,finish)
cairo_set_source_rgba(cr,bor,bog,bob,boa)
cairo_set_line_width(cr,bolw)
cairo_stroke(cr)
if roundedborder == 1 then
xc=across+stx
yc=down+sty
radius=(inlw/2)+(bolw/2)
angle1=rstart*(math.pi/180.0)+math.pi/2
angle2=(rstart+180)*(math.pi/180.0)+math.pi/2
cairo_set_line_width (cr, bolw)
cairo_arc (cr, xc, yc, radius, angle1, angle2)
cairo_stroke (cr)
xc=across+ftx
yc=down+fty
radius=(inlw/2)+(bolw/2)
angle1=(rend+180)*(math.pi/180.0)+math.pi/2
angle2=rend*(math.pi/180.0)+math.pi/2
cairo_set_line_width (cr, bolw)
cairo_arc (cr, xc, yc, radius, angle1, angle2)
cairo_stroke (cr)
cairo_arc(cr,across,down,(rad-(inlw/2)-(bolw/2)),start,finish)
cairo_stroke(cr)
elseif roundedborder == 0 and squareborder == 0 then
--inside boundary
cairo_arc(cr,across,down,(rad-(inlw/2)-(bilw/2)),start,finish)
cairo_set_source_rgba(cr,bir,big,bib,bia)
cairo_set_line_width(cr,bilw)
cairo_stroke(cr)
end
if squareborder == 1 then
cairo_set_source_rgba(cr,bor,bog,bob,boa)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT)
cairo_set_line_width(cr, bolw)
cairo_translate (cr, across+stx, down+sty)
cairo_rotate (cr, rstart*degrads)
cairo_move_to (cr, (bolw/2)*-1, (inlw/2)+bolw) 
cairo_rel_line_to (cr, 0 ,-1*((bolw*2)+inlw))
cairo_stroke (cr)
cairo_rotate (cr, rstart*degrads*-1)
cairo_translate (cr, -across-stx, -down-sty)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT)
cairo_set_line_width(cr, bolw)
cairo_translate (cr, across+ftx, down+fty)
cairo_rotate (cr, rend*degrads)
cairo_move_to (cr, (bolw/2), (inlw/2)+bolw) 
cairo_rel_line_to (cr, 0 ,-1*((bolw*2)+inlw))
cairo_stroke (cr)
cairo_rotate (cr, rend*degrads*-1)
cairo_translate (cr, -across-ftx, -down-fty)
cairo_arc(cr,across,down,(rad-(inlw/2)-(bolw/2)),start,finish)
cairo_stroke(cr)
end
end


function draw_ringanti(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina, bolw, bor, bog, bob, boa, bilw, bir, big, bib, bia, rounded, roundedborder, squareborder)
if rounded == 1 then
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
end
deg=(rend-rstart)/100
degrads=1*(math.pi/180)
start=rstart*degrads-math.pi/2
finish=rend*degrads-math.pi/2
interval=degrads*(start-(deg*(co)))
stx=0+rad*(math.sin(degrads*rstart))
sty=0-rad*(math.cos(degrads*rstart))
ftx=0+rad*(math.sin(degrads*rend))
fty=0-rad*(math.cos(degrads*rend))
-- Draw background ring
cairo_move_to (cr, across+stx, down+sty)
cairo_arc_negative (cr,across,down,rad,start,finish)
cairo_set_source_rgba(cr,bgr,bgg,bgb,bga)
cairo_set_line_width(cr,inlw)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc_negative (cr,across,down,rad, start, start-interval)
cairo_set_source_rgba(cr,inr,ing,inb,ina)
cairo_stroke(cr)
if rounded == 1 then
--draw center circle
circrad=3
circx=across+stx
circy=down+sty
cairo_arc(cr,circx,circy,circrad,0,2*math.pi)
cairo_close_path(cr)
cairo_fill (cr)
end
--boundary rings
cairo_set_line_cap  (cr, CAIRO_LINE_CAP_BUTT)
--outside boundary
cairo_arc_negative(cr,across,down,(rad+(inlw/2)+(bolw/2)),start,finish)
cairo_set_source_rgba(cr,bor,bog,bob,boa)
cairo_set_line_width(cr,bolw)
cairo_stroke(cr)
if roundedborder == 1 then
xc=across+stx
yc=down+sty
radius=(inlw/2)+(bolw/2)
angle1=rstart*(math.pi/180.0)-math.pi/2
angle2=(rstart+180)*(math.pi/180.0)-math.pi/2
cairo_set_line_width (cr, bolw)
cairo_arc (cr, xc, yc, radius, angle1, angle2)
cairo_stroke (cr)
xc=across+ftx
yc=down+fty
radius=(inlw/2)+(bolw/2)
angle1=(rend+180)*(math.pi/180.0)-math.pi/2
angle2=rend*(math.pi/180.0)-math.pi/2
cairo_set_line_width (cr, bolw)
cairo_arc (cr, xc, yc, radius, angle1, angle2)
cairo_stroke (cr)
cairo_arc_negative(cr,across,down,(rad-(inlw/2)-(bolw/2)),start,finish)
cairo_stroke(cr)
elseif roundedborder == 0 and squareborder == 0 then
--inside boundary
cairo_arc_negative(cr,across,down,(rad-(inlw/2)-(bilw/2)),start,finish)
cairo_set_source_rgba(cr,bir,big,bib,bia)
cairo_set_line_width(cr,bilw)
cairo_stroke(cr)
end
if squareborder == 1 then
cairo_set_source_rgba(cr,bor,bog,bob,boa)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT)
cairo_set_line_width(cr, bolw)
cairo_translate (cr, across+stx, down+sty)
cairo_rotate (cr, rstart*degrads)
cairo_move_to (cr, (bolw/2), (inlw/2)+bolw) 
cairo_rel_line_to (cr, 0 ,-1*((bolw*2)+inlw))
cairo_stroke (cr)
cairo_rotate (cr, rstart*degrads*-1)
cairo_translate (cr, -across-stx, -down-sty)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT)
cairo_set_line_width(cr, bolw)
cairo_translate (cr, across+ftx, down+fty)
cairo_rotate (cr, rend*degrads)
cairo_move_to (cr, (bolw/2)*-1, (inlw/2)+bolw) 
cairo_rel_line_to (cr, 0 ,-1*((bolw*2)+inlw))
cairo_stroke (cr)
cairo_rotate (cr, rend*degrads*-1)
cairo_translate (cr, -across-ftx, -down-fty)
cairo_arc_negative(cr,across,down,(rad-(inlw/2)-(bilw/2)),start,finish)
cairo_stroke(cr)
end
end

function conky_draw_shape()
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)
--settings below
--setup which conky objects to parse
cpu=conky_parse('${cpu}')
mem=conky_parse('${memperc}')
--draw_bar(co, width, height, across, down, bgr, bgg, bgb, bga, inr, ing, inb, ina, lw, lr, lg, lb, la, rotate)
draw_bar(cpu, 150, 20, 75, 150, 0, 1, 0, 0.5, 0, 1, 0, 1, 10, 1, 0, 0, 0.5, -45)
draw_bar(mem, 150, 40, 250, 30, 0, 0, 1, 0.5, 0, 0, 1, 1, 20, 0, 1, 0, 0.5, 90)

--CIRCLE--SETUP-----------------------------------------------------------------
--conky object
cpu=conky_parse('${cpu}')
co=cpu
-- position
across=340
down=370
--radius
rad=50
--start and end degrees
rstart=0
rend=360
--linewidths inlw=indicator, bolw=boundary outside, bilw=boundary insdie
inlw=30
bolw=20
bilw=30
--line colors
--background, reg, green, blue, alpha
bgr, bgg, bgb, bga=1, 1, 0, 0.5
inr, ing, inb, ina=0, 1, 1, 1
bor, bog, bob, boa=1, 0, 1, 0.5
bir, big, bib, bia=0, 1, 1, 0.8
--line end 1=rounded, 0=square
rounded=0
--borders 1=present, 0=absent (if 1 then all boundary lines will take on color of outside boundary)
roundedborder=0 
squareborder=0
--call draw function
draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina, bolw, bor, bog, bob, boa, bilw, bir, big, bib, bia, rounded, roundedborder, squareborder) 
--CIRCLE--SETUP-----------------------------------------------------------------
--conky object
cpu=conky_parse('${cpu}')
co=cpu
-- position
across=500
down=150
--radius
rad=40
--start and end degrees
rstart=360
rend=0
--linewidths inlw=indicator, bolw=boundary outside, bilw=boundary insdie
inlw=30
bolw=0
bilw=0
--line colors
--background, reg, green, blue, alpha
bgr, bgg, bgb, bga=0.5, 0, 0.8, 0.5
inr, ing, inb, ina=1, 1, 0, 1
bor, bog, bob, boa=1, 0, 1, 0.5
bir, big, bib, bia=0, 1, 1, 0.8
--line end 1=rounded, 0=square
rounded=0
--borders 1=present, 0=absent (if 1 then all boundary lines will take on color of outside boundary)
roundedborder=0 
squareborder=0
--call draw function
draw_ringanti(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina, bolw, bor, bog, bob, boa, bilw, bir, big, bib, bia, rounded, roundedborder, squareborder) 
end 
end

Last edited by mrpeachy (2010-02-23 05:16:12)

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

wlourf wrote:

Hi,

I am back with my attempt to draw an audio equalizer widget with conky !
I post on this thread on ubuntu forums which is more appropriate (Conky Lua & Cairo Troubleshooting):
http://ubuntu-ky.ubuntuforums.org/showp … tcount=174
The result is a bit slow and I try to get it faster but actually I'm stuck with C code, so if you have any idea ...

C code and compiling... hmm... I'm not gonna be much help there 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

this one was easy (or i thought it was going to be)
http://omploader.org/tM2x0bg
Going to be a work in progress until i set up all the variables properly... and get my titles right smile
UPDATE- now you can change line thickness without messing it up.  Getting the lines right has made things alot less easy smile
also you can set font, font size and title position

--[[isometric bars by mrpeachy (2010)]]
require 'cairo'
function bar3d(conkyobject, linethick, width, barheight, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, across, down, title, framelines, font, fontsize, txtacross, txtdown)
--line 1 settings end  
local a_num1=tonumber(conkyobject)
local a_num=(height/100)*a_num1


if framelines == 1 then
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
cairo_set_line_width (cr, linethick)
cairo_translate (cr, across, down)
cairo_move_to (cr, width*0.5, -width*0.5)
cairo_rel_line_to (cr, 0, -height)
cairo_stroke (cr)
cairo_translate (cr, -across, -down)
end
--line 1 indicator front face
cairo_translate (cr, across, down)
cairo_move_to (cr, 0, 0);
cairo_rectangle (cr, 0, 0, width, -a_num);
cairo_set_source_rgba (cr, facered, facegreen, faceblue, facealpha);
cairo_fill (cr)
cairo_translate (cr, -across, -down)
--line 1 indicator side face
cairo_translate (cr, across, down)
cairo_move_to (cr, 0, (linethick*0.1));
cairo_rel_line_to (cr, 0, -a_num)
cairo_rel_line_to (cr, -1*(width*0.5), -1*(width*0.5))
cairo_rel_line_to (cr, 0, a_num)
cairo_rel_line_to (cr, (width*0.5), (width*0.5))
cairo_close_path (cr)
cairo_set_source_rgba (cr, facered, facegreen, faceblue, facealpha);
cairo_fill (cr)
cairo_translate (cr, -across, -down)
--line 1 indicator top face
cairo_translate (cr, across, down)
cairo_move_to (cr, 0, -a_num);
cairo_rel_line_to (cr, width, 0)
cairo_rel_line_to (cr, -1*(width*0.5), -1*(width*0.5))
cairo_rel_line_to (cr, -width, 0)
cairo_rel_line_to (cr, (width*0.5), (width*0.5))
cairo_close_path (cr)
cairo_set_source_rgba (cr, facered, facegreen, faceblue, facealpha);
cairo_fill (cr)
cairo_translate (cr, -across, -down)

--line 1 indicator lines
cairo_set_line_width (cr, linethick);
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
--vertical, middle
cairo_move_to (cr, 0, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -a_num-(linethick*0.5))
cairo_stroke (cr)
--vertical right
cairo_move_to (cr, width, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -a_num-(linethick*0.5))
cairo_stroke (cr)
--left line
cairo_move_to (cr, -1*(width*0.5), (-1*(width*0.5))+(linethick));
cairo_rel_line_to (cr, 0, -a_num)
cairo_stroke (cr)
--bottom line
cairo_move_to (cr, -1*(linethick*0.5), (linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top of indicator
cairo_move_to (cr, 0, -a_num+(linethick*0.5))
cairo_rel_line_to (cr, width, 0)
cairo_stroke (cr)
--bottom diagonal
cairo_move_to (cr, -1*(linethick*0.15), (linethick*0.65))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--topline
cairo_move_to (cr, (-1*(width*0.5))-(linethick*0.5), ((-1*(width*0.5))-a_num)+(linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top left diagonal
cairo_move_to (cr, 0, -a_num+(linethick*0.5))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--top right diagopnal
cairo_move_to (cr, width+(linethick*0.15), -a_num+(linethick*0.35))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
cairo_translate (cr, -across, -down)
--title
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
cairo_translate (cr, txtacross, txtdown)
cairo_move_to (cr, 0, 0)
cairo_show_text (cr, title)
cairo_translate (cr, -txtacross, -txtdown)

if framelines == 1 then
--frame lines
cairo_set_line_width (cr, linethick);
cairo_translate (cr, across, down)
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
--vertical, middle
cairo_move_to (cr, 0, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -height-(linethick*0.5))
cairo_stroke (cr)
--vertical right
cairo_move_to (cr, width, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -height-(linethick*0.5))
cairo_stroke (cr)
--left line
cairo_move_to (cr, -1*(width*0.5), (-1*(width*0.5))+(linethick));
cairo_rel_line_to (cr, 0, -height)
cairo_stroke (cr)
--bottom line
cairo_move_to (cr, -1*(linethick*0.5), (linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top of indicator
cairo_move_to (cr, 0, -height+(linethick*0.5))
cairo_rel_line_to (cr, width, 0)
cairo_stroke (cr)
--bottom diagonal
cairo_move_to (cr, -1*(linethick*0.15), (linethick*0.65))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--topline
cairo_move_to (cr, (-1*(width*0.5))-(linethick*0.5), ((-1*(width*0.5))-height)+(linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top left diagonal
cairo_move_to (cr, 0, -height+(linethick*0.5))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--top right diagopnal
cairo_move_to (cr, width+(linethick*0.15), -height+(linethick*0.35))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
cairo_translate (cr, -across, -down)
end
end

function conky_draw_shape ()
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)
conkyobject=conky_parse('${cpu}')
linethick=1.5
width=40
height=150
linered=1
linegreen=1
lineblue=1
linealpha=1
facered=0
facegreen=0
faceblue=1
facealpha=1
across=300
down=200
title="CPU"
font="White Rabbit"
fontsize=18
txtacross=300
txtdown=220
--1 for framelines, 0 for none
framelines=1
bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, across, down, title, framelines, font, fontsize, txtacross, txtdown)

conkyobject=conky_parse('${memperc}')
linethick=1.5
width=40
height=150
linered=1
linegreen=1
lineblue=1
linealpha=1
facered=0
facegreen=0
faceblue=1
facealpha=1
across=200
down=200
title="MEM"
font="White Rabbit"
fontsize=18
txtacross=200
txtdown=220
--1 for framelines, 0 for none
framelines=1
bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, across, down, title, framelines, font, fontsize, txtacross, txtdown)

conkyobject=conky_parse('${fs_used_perc /}')
linethick=1.5
width=40
height=150
linered=1
linegreen=1
lineblue=1
linealpha=1
facered=0
facegreen=0
faceblue=1
facealpha=1
across=100
down=200
title="HDD"
font="White Rabbit"
fontsize=18
txtacross=100
txtdown=220
--1 for framelines, 0 for none
framelines=1
bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, across, down, title, framelines, font, fontsize, txtacross, txtdown)
end
end

Last edited by mrpeachy (2010-02-23 04:49:46)

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

looks great mrpeachy, the only thing I would add is an empty wireframe to show where %100 is big_smile

I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Re: My Conky Config

iggykoopa wrote:

looks great mrpeachy, the only thing I would add is an empty wireframe to show where %100 is big_smile

like this? smile

http://omploader.org/tM2x3aw

For some reason the top and left-most lines look a little blurry... i think i read a fix for it, so sometime I'll have to search that out.
The framelines can be turned on or off through a setting
Updated code above.  Also included ability to make bars as tall as you want.

UPDATE - better lines
http://omploader.org/tM2x4cA
UPDATE2 - final version (for now) above...worked out a few small quirks smile

Last edited by mrpeachy (2010-02-20 01:43:54)

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.