You are not logged in.
Got it ... beautiful font for B&W backgrounds - OH Elder!
Thank you.
Thats exactly who I thought of when I saw it!
Conky | SMXI HowTo | Super Grub | VastOnes GMB HowTo | VSIDO
Offline
jed wrote:Has anyone ever tried with the chrono's we're all playing with, to get the second hand to "Sweep" instead of "Tick"? Like the Rolex watch does. I think that would add a little more coolness to it!
Fairly easy, instead of 60 ticks do 600 ticks and update Conky every 0.1 second instead every 1s = CPU usage will double or triple but who cares...
Not sure where in the Lua to do this. I've tried a couple things along this line with no luck. hmmmm...
Jed
Last edited by jed (2012-11-21 02:38:56)
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
dk75 wrote:jed wrote:Has anyone ever tried with the chrono's we're all playing with, to get the second hand to "Sweep" instead of "Tick"? Like the Rolex watch does. I think that would add a little more coolness to it!
Fairly easy, instead of 60 ticks do 600 ticks and update Conky every 0.1 second instead every 1s = CPU usage will double or triple but who cares...
Not sure where in the Lua to do this. I've tried a couple things along this line with no luck. hmmmm...
Jed
not quite as easy as dk75 suggests and i dont think it is a particularly good idea as you will seriously up your cpu numbers with conly interval at 0.1
the problem is that there is not time interval you can get in the code shorter than a second
you would have to have an animation effect so that on every change of second, you get the hand movement activated
Offline
(running)What? who? I think I heard my name or saw the E.V.L. signal! Oh! Conky/monochrome, yep you got my number! : )
@Lwifitz - Nice job modifying S11's Conky. I still use it all the time. Work of art with a generous dollop of intelligence thrown in for good measure. : )
Proceed with confidence!
http://eldervlacoste.deviantart.com/
Offline
not quite as easy as dk75 suggests and i dont think it is a particularly good idea as you will seriously up your cpu numbers with conly interval at 0.1
the problem is that there is not time interval you can get in the code shorter than a second
you would have to have an animation effect so that on every change of second, you get the hand movement activated
I didn't think it would be! Upping refresh interval made cpu very hungry! Still think it would be a cool look. However, it doesn't sound worth the effort. And besides, I'm perfectly happy for now with what I have! I agree with it probably having to be an animation effect, as a real sweeping second hand would have no 'ticking' to it. One steady clockwise rotation! Oh well...
Thanks for the advice dk75, and as always, mrpeachy!
Jed
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
jed wrote:dk75 wrote:Fairly easy, instead of 60 ticks do 600 ticks and update Conky every 0.1 second instead every 1s = CPU usage will double or triple but who cares...
Not sure where in the Lua to do this. I've tried a couple things along this line with no luck. hmmmm...
Jed
not quite as easy as dk75 suggests and i dont think it is a particularly good idea as you will seriously up your cpu numbers with conly interval at 0.1
It depends of your code style.
If you broke your code to smaller, simpler functions, then it is a matter of feeding more number of angles for seconds hand to move around.
Easy peasy lemon squeezy.
the problem is that there is not time interval you can get in the code shorter than a second
you would have to have an animation effect so that on every change of second, you get the hand movement activated
Every second start animation, move the hand and then stop - it wouldn't be flawless.
As for interval smaller that second... conkyrc and conky_update 0.1 won't complain and works (tested almost 2 years ago with my moving circle code).
Debian Sid (Minted) x86_64/3.8-5, Conky 2.0_pre, Xorg 7.7/1.12.4, GNOME 3.4.2, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, ST9250827AS 250GB
Linux user No.: 483055 | Conky Pitstop
Offline
@Lwifitz - Nice job modifying S11's Conky. I still use it all the time. Work of art with a generous dollop of intelligence thrown in for good measure. : )
Thanks buddy. Ive been looking for a reason to use it 
Conky | SMXI HowTo | Super Grub | VastOnes GMB HowTo | VSIDO
Offline
(running)What? who? I think I heard my name or saw the E.V.L. signal! Oh! Conky/monochrome, yep you got my number! : )
@Lwifitz - Nice job modifying S11's Conky. I still use it all the time. Work of art with a generous dollop of intelligence thrown in for good measure. : )
Can't argue that, mrpeachy's intelligence with Jed's art and my 'dollop' generous or otherwise.

We need an E.V.L signal ... hmmmmmmmmmmm!
OK - 1920x1080
Because at times we need to call him!
Last edited by Sector11 (2012-11-21 22:08:43)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
@sector11 does that mean that the c.c.c.c. is now taking on a superhero theme and the monster conky thread is really a satellite station orbiting the earth?
Offline
So I decided that the panel I was making lacked in some serious areas as for as my tastes for system information. So I made an addition that works to show the left out information.
so first I wanted to know about what was running and of that information.
then I like many others have more than just the system and home partitions to think about.
here is how I am doing it, I liked the whole balanced look so I run 2.. till I make something else to go on the other side.. maybe
and the code, I did functions to pull them up... I still don't know why I did that. maybe it will make someones life easier.
--this lua script for use in conky
require 'cairo'
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 updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--################################
-- Strings
--################################
--################################
-- Main Body
--################################
--[[ function processes_table arguments
(x,y,type)
x: top left corner
y: top left corner
type:
1 = cpu
2 = mem
3 = pid]]
processes_table(5,5,1)
--[[ function drive_table arguments
(x,y,type)
x: top left corner
y: top left corner
type:
1 = percent
2 = used and size]]
--drive_table(5,5,1)
--################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
--################################
--Functions
--################################
function drive_table(position_x,position_y,type)
--colors
d_font_color_red=.8
d_font_color_green=.8
d_font_color_blue=.8
d_font_color_alpha=1
d_color_red=.5
d_color_green=0
d_color_blue=.1
d_color_alpha=1
d_fill_red=.1
d_fill_green=.1
d_fill_blue=.1
d_fill_alpha=.75
bg_red=.05
bg_green=.05
bg_blue=.05
bg_alpha=.75
br_red=.3
br_green=.3
br_blue=.3
br_alpha=1
g_fill_red=.3
g_fill_green=.3
g_fill_blue=.3
g_fill_alpha=1
g_line_red=1
g_line_green=1
g_line_blue=1
g_line_alpha=1
--settings
d_font="mono"
d_font_size=11
d_font_slant=CAIRO_FONT_SLANT_NORMAL
d_font_face=CAIRO_FONT_WEIGHT_NORMAL
d_line_width=2
d_math=(math.pi/180)
table_type=(type)
--please provide you information here, default is system
--drive1
drive1_name="drive1"
drive1_perc=tonumber(conky_parse("${fs_used_perc /}"))
drive1_used=conky_parse("${fs_used /}")
drive1_size=conky_parse("${fs_size /}")
--drive2
drive2_name="drive2"
drive2_perc=tonumber(conky_parse("${fs_used_perc /}"))
drive2_used=conky_parse("${fs_used /}")
drive2_size=conky_parse("${fs_size /}")
--drive3
drive3_name="drive3"
drive3_perc=tonumber(conky_parse("${fs_used_perc /}"))
drive3_used=conky_parse("${fs_used /}")
drive3_size=conky_parse("${fs_size /}")
--drive4
drive4_name="drive4"
drive4_perc=tonumber(conky_parse("${fs_used_perc /}"))
drive4_used=conky_parse("${fs_used /}")
drive4_size=conky_parse("${fs_size /}")
--drive5
drive5_name="drive5"
drive5_perc=tonumber(conky_parse("${fs_used_perc /}"))
drive5_used=conky_parse("${fs_used /}")
drive5_size=conky_parse("${fs_size /}")
--if you need to move used / size lables left, increase from 10
values_offset=10
--labels
label1="Name"
label2="Percent"
label3="Used / Size"
drive1_perc_text=""..drive1_perc.."%"
drive2_perc_text=""..drive2_perc.."%"
drive3_perc_text=""..drive3_perc.."%"
drive4_perc_text=""..drive4_perc.."%"
drive5_perc_text=""..drive5_perc.."%"
drive1_values_text=""..drive1_used.." / "..drive1_size..""
drive2_values_text=""..drive2_used.." / "..drive2_size..""
drive3_values_text=""..drive3_used.." / "..drive3_size..""
drive4_values_text=""..drive4_used.." / "..drive4_size..""
drive5_values_text=""..drive5_used.." / "..drive5_size..""
--table
--background
offset=30
height=200-(offset*2)
width=230-(offset*2)
bg_p1_x=(position_x)
bg_p1_y=(position_y)+offset
bg_p2_x=bg_p1_x
bg_p2_y=bg_p1_y+height
bg_p3_x=bg_p2_x+offset
bg_p3_y=bg_p2_y+offset
bg_p4_x=bg_p3_x+width
bg_p4_y=bg_p3_y
bg_p5_x=bg_p4_x+offset
bg_p5_y=bg_p4_y-offset
bg_p6_x=bg_p5_x
bg_p6_y=bg_p5_y-height
bg_p7_x=bg_p6_x-offset
bg_p7_y=bg_p6_y-offset
bg_p8_x=bg_p7_x-width
bg_p8_y=bg_p7_y
--columns and rows
column1=bg_p1_x+offset
column2=column1+(width/2)
column3=column2+(width/4)
column4=column1+width
row_height=(height+(offset))/6
row1=bg_p1_y
row2=row1+row_height
row3=row2+row_height
row4=row3+row_height
row5=row4+row_height
row6=row5+row_height
--seperators
radius=14
arc1_s=90*d_math
arc1_e=270*d_math
arc2_s=270*d_math
arc2_e=90*d_math
s1_arc1_x=column1
s1_arc1_y=row1
s1_arc2_x=column4
s1_arc2_y=row1
s2_arc1_x=column1
s2_arc1_y=row2
s2_arc2_x=column4
s2_arc2_y=row2
s3_arc1_x=column1
s3_arc1_y=row3
s3_arc2_x=column4
s3_arc2_y=row3
s4_arc1_x=column1
s4_arc1_y=row4
s4_arc2_x=column4
s4_arc2_y=row4
s5_arc1_x=column1
s5_arc1_y=row5
s5_arc2_x=column4
s5_arc2_y=row5
s6_arc1_x=column1
s6_arc1_y=row6
s6_arc2_x=column4
s6_arc2_y=row6
--gauges
max_value=100
g1_start_x=column1
g1_start_y=row2
g1_end_x=(((column4-column1)/max_value)*drive1_perc)+column1
g1_end_y=row2
g2_start_x=column1
g2_start_y=row3
g2_end_x=(((column4-column1)/max_value)*drive2_perc)+column1
g2_end_y=row3
g3_start_x=column1
g3_start_y=row4
g3_end_x=(((column4-column1)/max_value)*drive3_perc)+column1
g3_end_y=row4
g4_start_x=column1
g4_start_y=row5
g4_end_x=(((column4-column1)/max_value)*drive4_perc)+column1
g4_end_y=row5
g5_start_x=column1
g5_start_y=row6
g5_end_x=(((column4-column1)/max_value)*drive5_perc)+column1
g5_end_y=row6
--labels x and y
text_offset=2
percent_offset=20
label1_x=column1
label1_y=row1+text_offset
label2_x=column3
label2_y=row1+text_offset
label3_x=column2
label3_y=row1+text_offset
--names
drive1_x=column1
drive1_y=row2+text_offset
drive2_x=column1
drive2_y=row3+text_offset
drive3_x=column1
drive3_y=row4+text_offset
drive4_x=column1
drive4_y=row5+text_offset
drive5_x=column1
drive5_y=row6+text_offset
--percents
drive1_perc_x=column3+percent_offset
drive1_perc_y=row2+text_offset
drive2_perc_x=column3+percent_offset
drive2_perc_y=row3+text_offset
drive3_perc_x=column3+percent_offset
drive3_perc_y=row4+text_offset
drive4_perc_x=column3+percent_offset
drive4_perc_y=row5+text_offset
drive5_perc_x=column3+percent_offset
drive5_perc_y=row6+text_offset
--used / size
drive1_values_x=column2-values_offset
drive1_values_y=row2+text_offset
drive2_values_x=column2-values_offset
drive2_values_y=row3+text_offset
drive3_values_x=column2-values_offset
drive3_values_y=row4+text_offset
drive4_values_x=column2-values_offset
drive4_values_y=row5+text_offset
drive5_values_x=column2-values_offset
drive5_values_y=row6+text_offset
--cairo#################################################################
--table
--background
cairo_set_line_width(cr,d_line_width)
cairo_move_to(cr,bg_p1_x,bg_p1_y)
cairo_line_to(cr,bg_p2_x,bg_p2_y)
cairo_line_to(cr,bg_p3_x,bg_p3_y)
cairo_line_to(cr,bg_p4_x,bg_p4_y)
cairo_line_to(cr,bg_p5_x,bg_p5_y)
cairo_line_to(cr,bg_p6_x,bg_p6_y)
cairo_line_to(cr,bg_p7_x,bg_p7_y)
cairo_line_to(cr,bg_p8_x,bg_p8_y)
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_close_path(cr)
cairo_stroke(cr)
--gauges
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,g1_start_x,g1_start_y,radius,arc1_s,arc1_e)
cairo_arc(cr,g1_end_x,g1_end_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,g_fill_red,g_fill_green,g_fill_blue,g_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,g_line_red,g_line_green,g_line_blue,g_line_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,g2_start_x,g2_start_y,radius,arc1_s,arc1_e)
cairo_arc(cr,g2_end_x,g2_end_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,g_fill_red,g_fill_green,g_fill_blue,g_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,g_line_red,g_line_green,g_line_blue,g_line_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,g3_start_x,g3_start_y,radius,arc1_s,arc1_e)
cairo_arc(cr,g3_end_x,g3_end_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,g_fill_red,g_fill_green,g_fill_blue,g_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,g_line_red,g_line_green,g_line_blue,g_line_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,g4_start_x,g4_start_y,radius,arc1_s,arc1_e)
cairo_arc(cr,g4_end_x,g4_end_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,g_fill_red,g_fill_green,g_fill_blue,g_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,g_line_red,g_line_green,g_line_blue,g_line_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,g5_start_x,g5_start_y,radius,arc1_s,arc1_e)
cairo_arc(cr,g5_end_x,g5_end_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,g_fill_red,g_fill_green,g_fill_blue,g_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,g_line_red,g_line_green,g_line_blue,g_line_alpha)
cairo_stroke(cr)
--seperators
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s1_arc1_x,s1_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s1_arc2_x,s1_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s2_arc1_x,s2_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s2_arc2_x,s2_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s3_arc1_x,s3_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s3_arc2_x,s3_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s4_arc1_x,s4_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s4_arc2_x,s4_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s5_arc1_x,s5_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s5_arc2_x,s5_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s6_arc1_x,s6_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s6_arc2_x,s6_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
--labels
--names
--label1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,label1_x,label1_y)
cairo_show_text (cr,label1)
cairo_stroke (cr)
--drive1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive1_x,drive1_y)
cairo_show_text (cr,drive1_name)
cairo_stroke (cr)
--drive2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive2_x,drive2_y)
cairo_show_text (cr,drive2_name)
cairo_stroke (cr)
--drive3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive3_x,drive3_y)
cairo_show_text (cr,drive3_name)
cairo_stroke (cr)
--drive4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive4_x,drive4_y)
cairo_show_text (cr,drive4_name)
cairo_stroke (cr)
--drive5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive5_x,drive5_y)
cairo_show_text (cr,drive5_name)
cairo_stroke (cr)
--percents
if table_type == 1 then
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,label2_x,label2_y)
cairo_show_text (cr,label2)
cairo_stroke (cr)
--drive1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive1_perc_x,drive1_perc_y)
cairo_show_text (cr,drive1_perc_text)
cairo_stroke (cr)
--drive2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive2_perc_x,drive2_perc_y)
cairo_show_text (cr,drive2_perc_text)
cairo_stroke (cr)
--drive3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive3_perc_x,drive3_perc_y)
cairo_show_text (cr,drive3_perc_text)
cairo_stroke (cr)
--drive4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive4_perc_x,drive4_perc_y)
cairo_show_text (cr,drive4_perc_text)
cairo_stroke (cr)
--drive5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive5_perc_x,drive5_perc_y)
cairo_show_text (cr,drive5_perc_text)
cairo_stroke (cr)
end--percents
--used / size
if table_type == 2 then
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,label3_x,label3_y)
cairo_show_text (cr,label3)
cairo_stroke (cr)
--drive1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive1_values_x,drive1_values_y)
cairo_show_text (cr,drive1_values_text)
cairo_stroke (cr)
--drive2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive2_values_x,drive2_values_y)
cairo_show_text (cr,drive2_values_text)
cairo_stroke (cr)
--drive3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive3_values_x,drive3_values_y)
cairo_show_text (cr,drive3_values_text)
cairo_stroke (cr)
--drive4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive4_values_x,drive4_values_y)
cairo_show_text (cr,drive4_values_text)
cairo_stroke (cr)
--drive5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive5_values_x,drive5_values_y)
cairo_show_text (cr,drive5_values_text)
cairo_stroke (cr)
end --used / size
end --function end
--######################################################################
function processes_table(position_x,position_y,type)
--colors
d_font_color_red=.8
d_font_color_green=.8
d_font_color_blue=.8
d_font_color_alpha=1
d_color_red=.5
d_color_green=0
d_color_blue=.1
d_color_alpha=1
d_fill_red=.1
d_fill_green=.1
d_fill_blue=.1
d_fill_alpha=.75
bg_red=.05
bg_green=.05
bg_blue=.05
bg_alpha=.75
br_red=.3
br_green=.3
br_blue=.3
br_alpha=1
--settings
d_font="mono"
d_font_size=11
d_font_slant=CAIRO_FONT_SLANT_NORMAL
d_font_face=CAIRO_FONT_WEIGHT_NORMAL
d_line_width=2
d_math=(math.pi/180)
table_type=(type)
--conky
processes=conky_parse("${processes}")
p1=conky_parse("${top name 1}")
p1_perc=conky_parse("${top cpu 1}")
p1_mem=conky_parse("${top mem 1}")
p1_pid=conky_parse("${top pid 1}")
p2=conky_parse("${top name 2}")
p2_perc=conky_parse("${top cpu 2}")
p2_mem=conky_parse("${top mem 2}")
p2_pid=conky_parse("${top pid 2}")
p3=conky_parse("${top name 3}")
p3_perc=conky_parse("${top cpu 3}")
p3_mem=conky_parse("${top mem 3}")
p3_pid=conky_parse("${top pid 3}")
p4=conky_parse("${top name 4}")
p4_perc=conky_parse("${top cpu 4}")
p4_mem=conky_parse("${top mem 4}")
p4_pid=conky_parse("${top pid 4}")
p5=conky_parse("${top name 5}")
p5_perc=conky_parse("${top cpu 5}")
p5_mem=conky_parse("${top mem 5}")
p5_pid=conky_parse("${top pid 5}")
--table
--background
offset=30
height=200-(offset*2)
width=230-(offset*2)
bg_p1_x=(position_x)
bg_p1_y=(position_y)+offset
bg_p2_x=bg_p1_x
bg_p2_y=bg_p1_y+height
bg_p3_x=bg_p2_x+offset
bg_p3_y=bg_p2_y+offset
bg_p4_x=bg_p3_x+width
bg_p4_y=bg_p3_y
bg_p5_x=bg_p4_x+offset
bg_p5_y=bg_p4_y-offset
bg_p6_x=bg_p5_x
bg_p6_y=bg_p5_y-height
bg_p7_x=bg_p6_x-offset
bg_p7_y=bg_p6_y-offset
bg_p8_x=bg_p7_x-width
bg_p8_y=bg_p7_y
--columns and rows
column1=bg_p1_x+offset
column2=column1+(width/2)
column3=column2+(width/4)
column4=column1+width
row_height=(height+(offset))/6
row1=bg_p1_y
row2=row1+row_height
row3=row2+row_height
row4=row3+row_height
row5=row4+row_height
row6=row5+row_height
--seperators
radius=14
arc1_s=90*d_math
arc1_e=270*d_math
arc2_s=270*d_math
arc2_e=90*d_math
s1_arc1_x=column1
s1_arc1_y=row1
s1_arc2_x=column4
s1_arc2_y=row1
s2_arc1_x=column1
s2_arc1_y=row2
s2_arc2_x=column4
s2_arc2_y=row2
s3_arc1_x=column1
s3_arc1_y=row3
s3_arc2_x=column4
s3_arc2_y=row3
s4_arc1_x=column1
s4_arc1_y=row4
s4_arc2_x=column4
s4_arc2_y=row4
s5_arc1_x=column1
s5_arc1_y=row5
s5_arc2_x=column4
s5_arc2_y=row5
s6_arc1_x=column1
s6_arc1_y=row6
s6_arc2_x=column4
s6_arc2_y=row6
--processes
--text
processes_label="Processes"
p1_perc_text=""..p1_perc.."%"
p2_perc_text=""..p2_perc.."%"
p3_perc_text=""..p3_perc.."%"
p4_perc_text=""..p4_perc.."%"
p5_perc_text=""..p5_perc.."%"
p1_mem_text=""..p1_mem.."M"
p2_mem_text=""..p2_mem.."M"
p3_mem_text=""..p3_mem.."M"
p4_mem_text=""..p4_mem.."M"
p5_mem_text=""..p5_mem.."M"
p1_pid_text=""..p1_pid..""
p2_pid_text=""..p2_pid..""
p3_pid_text=""..p3_pid..""
p4_pid_text=""..p4_pid..""
p5_pid_text=""..p5_pid..""
--x and y
text_offset=2
processes_size=14
processes_label_x=column1
processes_label_y=row1+3
processes_x=column3+20
processes_y=row1+3
--names
p1_x=column1
p1_y=row2+text_offset
p2_x=column1
p2_y=row3+text_offset
p3_x=column1
p3_y=row4+text_offset
p4_x=column1
p4_y=row5+text_offset
p5_x=column1
p5_y=row6+text_offset
--cpu
p1_perc_x=column3
p1_perc_y=row2+text_offset
p2_perc_x=column3
p2_perc_y=row3+text_offset
p3_perc_x=column3
p3_perc_y=row4+text_offset
p4_perc_x=column3
p4_perc_y=row5+text_offset
p5_perc_x=column3
p5_perc_y=row6+text_offset
--mem
p1_mem_x=column3
p1_mem_y=row2+text_offset
p2_mem_x=column3
p2_mem_y=row3+text_offset
p3_mem_x=column3
p3_mem_y=row4+text_offset
p4_mem_x=column3
p4_mem_y=row5+text_offset
p5_mem_x=column3
p5_mem_y=row6+text_offset
--pid
p1_pid_x=column3
p1_pid_y=row2+text_offset
p2_pid_x=column3
p2_pid_y=row3+text_offset
p3_pid_x=column3
p3_pid_y=row4+text_offset
p4_pid_x=column3
p4_pid_y=row5+text_offset
p5_pid_x=column3
p5_pid_y=row6+text_offset
--cairo#################################################################
--table
--background
cairo_set_line_width(cr,d_line_width)
cairo_move_to(cr,bg_p1_x,bg_p1_y)
cairo_line_to(cr,bg_p2_x,bg_p2_y)
cairo_line_to(cr,bg_p3_x,bg_p3_y)
cairo_line_to(cr,bg_p4_x,bg_p4_y)
cairo_line_to(cr,bg_p5_x,bg_p5_y)
cairo_line_to(cr,bg_p6_x,bg_p6_y)
cairo_line_to(cr,bg_p7_x,bg_p7_y)
cairo_line_to(cr,bg_p8_x,bg_p8_y)
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_close_path(cr)
cairo_stroke(cr)
--seperators
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s1_arc1_x,s1_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s1_arc2_x,s1_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s2_arc1_x,s2_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s2_arc2_x,s2_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s3_arc1_x,s3_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s3_arc2_x,s3_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s4_arc1_x,s4_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s4_arc2_x,s4_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s5_arc1_x,s5_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s5_arc2_x,s5_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,s6_arc1_x,s6_arc1_y,radius,arc1_s,arc1_e)
cairo_arc(cr,s6_arc2_x,s6_arc2_y,radius,arc2_s,arc2_e)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_red,d_fill_green,d_fill_blue,d_fill_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_color_red,d_color_green,d_color_blue,d_color_alpha)
cairo_stroke(cr)
--processes
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,processes_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,processes_label_x,processes_label_y)
cairo_show_text (cr,processes_label)
cairo_stroke (cr)
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,processes_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,processes_x,processes_y)
cairo_show_text (cr,processes)
cairo_stroke (cr)
--p1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p1_x,p1_y)
cairo_show_text (cr,p1)
cairo_stroke (cr)
--p2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p2_x,p2_y)
cairo_show_text (cr,p2)
cairo_stroke (cr)
--p3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p3_x,p3_y)
cairo_show_text (cr,p3)
cairo_stroke (cr)
--p4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p4_x,p4_y)
cairo_show_text (cr,p4)
cairo_stroke (cr)
--p5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p5_x,p5_y)
cairo_show_text (cr,p5)
cairo_stroke (cr)
--processes cpu
if table_type == 1 then
--p1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p1_perc_x,p1_perc_y)
cairo_show_text (cr,p1_perc_text)
cairo_stroke (cr)
--p2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p2_perc_x,p2_perc_y)
cairo_show_text (cr,p2_perc_text)
cairo_stroke (cr)
--p3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p3_perc_x,p3_perc_y)
cairo_show_text (cr,p3_perc_text)
cairo_stroke (cr)
--p4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p4_perc_x,p4_perc_y)
cairo_show_text (cr,p4_perc_text)
cairo_stroke (cr)
--p5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p5_perc_x,p5_perc_y)
cairo_show_text (cr,p5_perc_text)
cairo_stroke (cr)
end --processes cpu
--processes mem
if table_type == 2 then
--p1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p1_mem_x,p1_mem_y)
cairo_show_text (cr,p1_mem_text)
cairo_stroke (cr)
--p2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p2_mem_x,p2_mem_y)
cairo_show_text (cr,p2_mem_text)
cairo_stroke (cr)
--p3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p3_mem_x,p3_mem_y)
cairo_show_text (cr,p3_mem_text)
cairo_stroke (cr)
--p4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p4_mem_x,p4_mem_y)
cairo_show_text (cr,p4_mem_text)
cairo_stroke (cr)
--p5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p5_mem_x,p5_mem_y)
cairo_show_text (cr,p5_mem_text)
cairo_stroke (cr)
end --processes mem
--processes pid
if table_type == 3 then
--p1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p1_pid_x,p1_pid_y)
cairo_show_text (cr,p1_pid_text)
cairo_stroke (cr)
--p2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p2_pid_x,p2_pid_y)
cairo_show_text (cr,p2_pid_text)
cairo_stroke (cr)
--p3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p3_pid_x,p3_pid_y)
cairo_show_text (cr,p3_pid_text)
cairo_stroke (cr)
--p4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p4_pid_x,p4_pid_y)
cairo_show_text (cr,p4_pid_text)
cairo_stroke (cr)
--p5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,p5_pid_x,p5_pid_y)
cairo_show_text (cr,p5_pid_text)
cairo_stroke (cr)
end --processes pid
end --function end
--######################################################################Offline
@sector11 does that mean that the c.c.c.c. is now taking on a superhero theme and the monster conky thread is really a satellite station orbiting the earth?
Earth orbiting us. 
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
@ansem_of_nexus
looks really good
i havn't seen a conky looking much like yours before, which is certainly something 
one idea to reduce your line count.... think when to use for loops
an example would be for your drive text
--drive1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive1_values_x,drive1_values_y)
cairo_show_text (cr,drive1_values_text)
cairo_stroke (cr)
--drive2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive2_values_x,drive2_values_y)
cairo_show_text (cr,drive2_values_text)
cairo_stroke (cr)
--drive3
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive3_values_x,drive3_values_y)
cairo_show_text (cr,drive3_values_text)
cairo_stroke (cr)
--drive4
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive4_values_x,drive4_values_y)
cairo_show_text (cr,drive4_values_text)
cairo_stroke (cr)
--drive5
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
cairo_move_to (cr,drive5_values_x,drive5_values_y)
cairo_show_text (cr,drive5_values_text)
cairo_stroke (cr)this could be reduced to something like this
drive_text={drive1_values_text, drive2_values_text, drive3_values_text, drive4_values_text, drive5_values_text}
drive_x={drive1_values_x, drive2_values_x, drive3_values_x, drive4_values_x, drive5_values_x}
drive_y={drive1_values_y, drive2_values_y, drive3_values_y, drive4_values_y, drive5_values_y}
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,d_font_size)
cairo_set_source_rgba (cr,d_font_color_red,d_font_color_green,d_font_color_blue,d_font_color_alpha)
for i=1,5 do
cairo_move_to (cr,drive_x[i],drive_y[i])
cairo_show_text (cr,drive_text[i])
cairo_stroke (cr)
end--for loopLast edited by mrpeachy (2012-11-22 00:56:53)
Offline
Thanks, I will do that, will help me not loose my mind. Lots of times I forget where I am at when I have to do the same thing to many times
Last edited by ansem_of_nexus (2012-11-22 02:46:19)
Offline
Conky | SMXI HowTo | Super Grub | VastOnes GMB HowTo | VSIDO
Offline
Ok, edited the chrono-9000 conky i did a bit, made the 10 day forecast a bit bigger to make it easier to read, and added some stuff to it, and added a lua graph for the network activity.
no media player running
and with the media player running
I also moved the Google Calendar and made it go farther out
Got /? | My Blog, nothing special 
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.
Offline
Ok, edited the chrono-9000 conky i did a bit, made the 10 day forecast a bit bigger to make it easier to read, and added some stuff to it, and added a lua graph for the network activity.
no media player running
http://t.imgbox.com/accuJN6h.jpg
and with the media player running
http://t.imgbox.com/abvUV7W1.jpg
I also moved the Google Calendar and made it go farther out
Beautiful work as always McLovin!
Conky | SMXI HowTo | Super Grub | VastOnes GMB HowTo | VSIDO
Offline
Conky | SMXI HowTo | Super Grub | VastOnes GMB HowTo | VSIDO
Offline
http://t.imgbox.com/abvUV7W1.jpg
I also moved the Google Calendar and made it go farther out
Looking good, even my tired old eyes are relaxed with that.
Could you post the Chronograph you're running please.
Pretty Please!
By the way, the last day of the world is a Mayan myth, they simply ran out of space on the rock at 21 Dec 2012.
Unless Google knows something the Mayans didn't?
For me: 22 Dec 2012 is
I got out an old conky dusted it off, moved the 'mrpeachy' Mayan Calendar Clock into a separate conky on the left, my original Countdown for a Coffee conky still in the middle thanks to Mark's "conkyDaysDiff.py" and a new conky; mrpeachy's LUA calendar that he tacked onto the draw-bg.lua script on the right.
Don't forget now: 22 Dec 2012 is Coffee with Friends Day!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Just finished the last of the coffee which means its bed time......... So heres mine for the night
E.V.L. has B&W competition. That's wonderful!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
OK, I have tried to fix this for D·A·Y·S, my LUA skills are just not up to it.
I've posted this on the Ubuntu French forum as it is Dider-t's mods to The Chronograph that has this problem but I though I'd post it here to see if {cough cough} the creator of the 4-clocks.lua could have a look see. [we need a "whistling smilie"]
I need help. I am not good at LUA and have tried for days to fix this.
Without the "draw-bg.lua" Didier-T's "Chronograph.lua" does not work. I thought maybe I added or changed something so I used the original with no changes and I have the same results
On the left the conky running with:
draw-bg.lua
v9000.lua
mounted.lua
Chronograph-Didier-T-2.lua
- - faded names & numbers not in use
- - centre circle white
In the centre: the circles commented out:
TEXT
${lua get_mounted_data 3} #${lua conky_draw_bg 12 0 0 0 0 0x000000 0.5}
#${lua conky_draw_bg 175 0 0 350 350 0xffffff 0.3}
#${lua conky_draw_bg 60 115 31 120 120 0x000000 0.3}
#${lua conky_draw_bg 58 32 118 116 116 0x000000 0.3}
#${lua conky_draw_bg 58 202 118 116 116 0x000000 0.3}
#${lua conky_draw_bg 60 115 200 120 120 0x000000 0.3}On the right I commented out:
#lua_load /media/5/Conky/LUA/draw-bg.lua
TEXTMy: Chronograph-Didier-T-2.lua
--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
21 Jun 2012 - Chronograph modifications by Sector11
22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
12 Nov 2012 - memory leak plugged - mrpeachy
14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
use in conkyrc
lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT
-- INDEX (use find with):
-- ###### 12 OR 24 CLOCK FACE
-- SET BORDER OPTIONS ###### ALL CLOCKS
-- ### START CLOCK A ######################################
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
-- CLOCK A ###### 24 HR TIME
-- ### START DIAL B ### Top - Week Day Names Dial #########
-- ### START DIAL C ### Right - Month Names Dial ##########
-- ### START DIAL D ### Left - Day Numbers Dial ###########
-- ### START CLOCK E ######################################
-- MARKS AROUND CLOCK E -- Bottom - 12 HR Clock
-- CLOCK E HOUR HAND
-- CLOCK E MINUTE HAND SETUP
-- CLOCK E SECOND HAND SETUP
-- CLOCK E ###### 12 HR TIME
NOTE: Putting ### CLOCK A ### last insures that it's functions are written
over the other dials.
]]
require 'cairo'
--Position et taille horloge
local init={
center_x=175,
center_y=175,
radius=170, -- do not touch
lang="English", --English or Spanish or French
hour=24, --12 or 24
second=true, --true or false - Seconds: dots and numbers
line=true, -- part second hand true or false
handday=false, -- DAY NAME hand - true or false
handdaynum=false, -- DAY NUMBER hand - true or false
handmonth=false, -- MONTH NAME hand - true or false
color=0xFF0000, --color for day, day number and month if no hand
alpha=1 --alpha for day, day number and month if no hand
}
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)
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 extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
-- ########################################################
-- SETTINGS AREA
-- local cpu=conky_parse("${cpu}")
-- local red-1=conky_parse("${image ~/Conky/images/red_1.png -p 0,0 -s 35x35}")
local clock_type_A=init.hour -- Large Main 24 HR Clock
-- ###### CLOCK SETTINGS ##################################
-- SET BORDER OPTIONS FOR "CLOCKS" ########################
local clock_border_width=0
-- set color and alpha for clock border
local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
-- gap from clock border to minute marks
local b_to_m=1
-- ########################################################
-- ### START DIAL B ### Top - Week Day Names Dial #########
-- DIAL POSITION FOR TEXT
local center_x=init.center_x
local center_y=init.center_y-85
local radius=50
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,1,1,1,0) --doesn't work - setting changed location
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end -- English
if init.lang == "Spanish" then text_days={"Dom","Lun","Mar","Mie","Jue","Vie","Sab",} end -- Spanish
if init.lang == "French" then text_days={"Dim","Lun","Mar","Mer","Jeu","Ven","Sam",} end -- French
local day_number=tonumber(os.date("%w"))
if init.handday == true then
for i=1,7 do
-- work out points
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=35
for i=1,7 do
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- DRAW HAND -- snaps to current day of week
local hand_length=30
local point=(math.pi/180)*((360/7)*(day_number))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
local hand_width=2
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
else
for i=1,7 do
-- work out points
if day_number == i-1 then
cairo_set_source_rgba (cr,colr, colg, colb, cola)
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- non-active day names
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=35
for i=1,7 do
if day_number == i-1 then
cairo_set_source_rgba (cr,colr, colg, colb, cola)
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- dots for non-active day name
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ### END DIAL B #########################################
-- ########################################################
-- ### START DIAL C ### Right - Month Names Dial ##########
-- DIAL POSITION FOR TEXT
local center_x=init.center_x+85
local center_y=init.center_y
local radius=45
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,1,1,1,0) -- doesn't work setting moved
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end -- English
if init.lang == "Spanish" then text_days={"Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic",} end -- Spanish
if init.lang == "French" then text_days={"Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aôu","Sep","Oct","Nov","Déc",} end -- French
local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=32
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- DRAW HAND -- snaps to current month
local hand_length=28 --radius for this calculation
local point=(math.pi/180)*((360/12)*(this_month-1))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
else
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,colr, colg, colb, cola)
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- non-active month names
end
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=32
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,colr, colg, colb, cola)
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- dots for non-active month names
end
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ### END CLOCK C ########################################
-- ########################################################
-- ### START DIAL D ### Left - Day Numbers Dial ###########
-- GET NUMBER OF DAYS IN CURRENT MONTH
-- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
-- MONTH TABLE
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
-- TEXT positioning
local center_x=init.center_x-85
local center_y=init.center_y
local radius=50
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr,1,1,1,0) -- does not work - settings relocated
local this_day=tonumber(os.date("%d"))
if init.handdaynum == true then
for i=1,number_days do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
--only print even numbers
if math.mod(i, 2) == 0 then
--set text when even
text=string.format("%02d",i) --formats numbers to double digits
else
--set text when odd
text=""
end--odd even matching
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=40
for i=1,number_days do
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- DRAW HAND -- snaps to current DAY
local hand_length=35--radius for this calculation
local point=(math.pi/180)*((360/number_days)*(this_day-1))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
else
for i=1,number_days do
if this_day == i then
cairo_set_source_rgba (cr,colr, colg, colb, cola)
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- non-active day numbers
end
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
--only print even numbers
if math.mod(i, 2) == 0 then
--set text when even
text=string.format("%02d",i) --formats numbers to double digits
else
--set text when odd
text=""
end--odd even matching
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=40
for i=1,number_days do
if this_day == i then
cairo_set_source_rgba (cr,colr, colg, colb, cola)
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- dots non-active day numbers
end
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ### END CLOCK D ########################################
-- ########################################################
-- ### START CLOCK E ######################################
-- MARKS AROUND CLOCK E -- Bottom - 12 HR Clock
local number_marks_E=12
-- set mark length
local m_length_E=0
-- set mark width
local m_width_E=0
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,0,1-- opaque white
-- SETUP HOUR HANDS #######################################
-- CLOCK E HOUR HAND
-- set length of hour hand
hh_length_E=25
-- set hour hand width
hh_width_E=2
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
hhr,hhg,hhb,hha=1,1,0,1-- fully opaque white
-- SETUP MINUTE HANDS #####################################
-- CLOCK E MINUTE HAND SETUP
-- set length of minute hand
mh_length_E=35
-- set minute hand width
mh_width_E=2
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
mhr,mhg,mhb,mha=1,1,0,1-- fully opaque white
-- SETUP SECOND HANDS #####################################
-- CLOCK E SECOND HAND SETUP
-- set length of seconds hand
sh_length_E=32
-- set hour hand width
sh_width_E=1
-- set hour hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
shr,shg,shb,sha=1,0,0,1-- fully opaque red
-- CLOCK E ###### 12 HR TIME ##############################
-- CLOCK SETTINGS
clock_radius=45
clock_centerx=init.center_x
clock_centery=init.center_y+85
-- DRAWING CODE
-- DRAW BORDER
cairo_set_source_rgba (cr,169/255,169/255,169/255,1)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_E
-- set line cap type
cairo_set_line_cap (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_E)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR SECOND MARKS
for i=1,number_marks_E do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_E))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_E))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line-- MARKS AROUND CLOCK A
cairo_stroke (cr)
end-- of for loop
-- SET MARKS ##############################################
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
-- set mark length
local m_length_A=0
-- set mark width
local m_width_A=0
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,1 -- opaque white
-- SETUP HOUR HANDS #######################################
-- CLOCK A HOUR HAND
-- set length of hour hand
hh_length_A=130
-- set hour hand width
hh_width_A=3
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
hhr,hhg,hhb,hha=1,1,1,.5-- fully opaque white
-- SETUP MINUTE HANDS #####################################
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=145
-- set minute hand width
mh_width_A=2
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
mhr,mhg,mhb,mha=1,1,1,.5-- fully opaque white
-- SETUP SECOND HANDS #####################################
-- CLOCK A SECOND HAND SETUP
-- set length of seconds hand
sh_length_A=150
-- set hour hand width
sh_width_A=2
-- set hour hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
shr,shg,shb,sha=1,0,0,1-- fully opaque red
-- CLOCK A ###### 12 HR TIME ##############################
-- CLOCK SETTINGS
clock_radius=200
clock_centerx=init.center_x
clock_centery=init.center_y
-- DRAWING CODE
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A
-- set line cap type
cairo_set_line_cap (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_A)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end-- of for loop
-- HOUR MARKS
-- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND
-- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A))-- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
--cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_source_rgba (cr,169/255,169/255,169/255,1)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds just as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
--cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_source_rgba (cr,169/255,169/255,169/255,1)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
-- DRAW SECOND HAND
--[[
-- calculate degrees for each second
sec_degs=seconds*6
-- set radius to calculate hand points
radius=sh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of seconds hand
point=(math.pi/180)*sec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))BOLD
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes
cairo_set_line_width (cr,sh_width_A)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap (cr, sh_cap)
cairo_stroke (cr)
]]
-- ####################################################################
local center_x=init.center_x
local center_y=init.center_y
local radius=init.radius-5
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 15)
cairo_set_source_rgba (cr,1,1,1,1) -- 12 HR Clock numbers
-- TABLE OF TEXT -- in order
if init.hour == 12 then
text_days={"00","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=150
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
if init.hour == 24 then
text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
for i=1,24 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
--local extents=cairo_text_extents_t:create()
--tolua.takeownership(extents)
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=150
for i=1,24 do
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
local arc=(math.pi/180)*((360/60)*seconds)
--calculate point 1
local radius1=140
local x1=0+radius1*math.sin(arc)
local y1=0-radius1*math.cos(arc)
--calculate point 2
local radius2=155
local x2=0+radius2*math.sin(arc)
local y2=0-radius2*math.cos(arc)
--draw line connecting points
cairo_move_to (cr, center_x+x1,center_y+y1)
cairo_line_to (cr, center_x+x2, center_y+y2)
cairo_set_source_rgba (cr,255/255,0/255,0/255,1) -- PART SECOND HAND
cairo_stroke (cr)
end
-- ####################################################################
-- POSITION FOR TEXT HOUR NUMBERS
--affiche secondes
if init.hour == 12 and init.second == true then
text_days={"","1","2","3","4","","6","7","8","9","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
-- INNER POINTS POSITION, radius smaller than text circle
cairo_set_source_rgba (cr,1,1,1,0.3) -- does not work -- settings moved
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
for i=1,60 do
local radius=150 -- dots for seconds A Clock
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if seconds == i-1 then
cairo_set_source_rgba (cr,255/255,0/255,0/255,0.3) -- does not work - settings moved
else
if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
cairo_set_source_rgba (cr,0,1,1,1) --??
else
cairo_set_source_rgba (cr,0,1,1,0.3) -- dots for seconds A Clock
end
end
cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
cairo_stroke (cr)
end
radius=radius-3
cairo_set_font_size (cr, 10)
for i=1,60 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
if seconds == tonumber(text) then
cairo_set_source_rgba (cr,1,0,0,1) -- ??
else
cairo_set_source_rgba (cr,1,1,1,0.3) -- seconds numbers
end
--local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
end
-- Fin affiche secondes
-- FONT
-- ########################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
function rgb_to_r_g_b(col,alp) -- ONLY NEED ONE COPY OF THIS FUNCTION
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
endI'm such a
around code!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
I just remembered a question I had a few days ago....
I saw a post S11 had made concerning being able to "Right-Click" on a conky and still get the 'menu' associated with the "Right-Click". I noticed that I had 'lost' this functionality. In using three conky's, much of my desktop is covered!
I couldn't remember how to get it back. I just realized that by changing the 'own_window_type' to 'override' instead of 'normal', I get the "Right-Click" back! Could someone maybe post a link, with perhaps some explanations of what the different variables above "Text" do and the choices you have. I'm prone to "breaking" things, and would like to take some of the guess-work out of this. As I've gotten older, my brain has become weaker! (and forget prone) Thanks everyone...
Jed
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
I'm such a
around code!
Hey, wait a minute! I think I resemble that remark! If your a 'chimp', then what am I? I must be like a 'Prokaryotic bacteria'! 
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
mrpeachy wrote:jed wrote:Not sure where in the Lua to do this. I've tried a couple things along this line with no luck. hmmmm...
Jed
not quite as easy as dk75 suggests and i dont think it is a particularly good idea as you will seriously up your cpu numbers with conly interval at 0.1
It depends of your code style.
If you broke your code to smaller, simpler functions, then it is a matter of feeding more number of angles for seconds hand to move around.
Easy peasy lemon squeezy.
Ok.
I don't have much time, so right now only a test code for that, maybe in Sunday I could modify Chronograph.lua for that (remeber, "update_interval 0.1" in conkyrc):
--[[
test56.lua snippet
testing translate/rotate capabilities of Conky2 and 0.1 seconds updated clock
--]]
do
require 'cairo'
local cr, cs, i ,j = nil
--[[
#############################################################################################
Settings
#############################################################################################
--]]
local settings_table = {
{
x = 100,
y = 100,
r = 90,
},
}
--[[
#############################################################################################
--]]
function cairo_init()
if conky_window == nil then return end
if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
if cs then cairo_surface_destroy(cs) end
cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
end
if cr then cairo_destroy(cr) end
cr = cairo_create(cs)
end
function cairo_clean()
if cr then cairo_destroy(cr) end
if cs then cairo_surface_destroy(cs) end
cr, cs = nil
end
function rgb2rgba(colour,alpha) -- colour = hex color code, alpha = float [0.0 - 1.0] transparency factor
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
-- returns color used by "cairo_set_rgba()" function
end
function draw_marks(t, color, alpha)
cairo_set_line_width(cr, 1)
cairo_set_source_rgba(cr, rgb2rgba(color, alpha))
for i=1,600,10 do
cairo_save(cr)
cairo_translate(cr, t.x, t.y)
cairo_rotate(cr, t.marks[i].a)
cairo_arc(cr, 0, -t.r, 0.5, t.marks[0].a, t.marks[600].a)
cairo_stroke(cr)
cairo_restore(cr)
end
end
function draw_hand_1(x, y, length, width, color, alpha, angle)
cairo_set_line_width(cr, width)
cairo_set_source_rgba(cr, rgb2rgba(color, alpha))
cairo_save(cr)
cairo_translate(cr, x, y)
cairo_rotate(cr, angle)
cairo_move_to(cr, 0, 0)
cairo_line_to(cr, 0, -length)
cairo_stroke(cr)
cairo_restore(cr)
end
function draw_hand_2(x, y, length, width, color, alpha, angle)
cairo_set_line_width(cr, 0.1)
cairo_set_source_rgba(cr, rgb2rgba(color, alpha))
cairo_save(cr)
cairo_translate(cr, x, y)
cairo_rotate(cr, angle)
cairo_move_to(cr, 0, 0)
cairo_line_to(cr, -width/2, -(length/3*2))
cairo_line_to(cr, 0, -length)
cairo_line_to(cr, width/2, -(length/3*2))
cairo_line_to(cr, 0, 0)
cairo_close_path(cr)
cairo_fill(cr)
cairo_restore(cr)
end
function draw_clock(t, updates)
draw_marks(t, 0xffffff, 1)
if not t.up then t.up=settings_table[1].up end
if not t.time then t.time=settings_table[1].time end
if not t.s then t.s=settings_table[1].s end
local sh=((updates-t.up)%600)
local mh=math.floor((t.time.min%60)*10+t.time.sec/6)
local hh=math.floor((t.time.hour%12)*50+t.time.min/6)
draw_hand_2(t.x, t.y, t.r*.75, t.r/5, 0x000000, 0.5, t.marks[hh].a) -- hours hand
draw_hand_2(t.x, t.y, t.r*.99, t.r/15, 0xffffff, 0.8, t.marks[mh].a) -- minutes hand
draw_hand_1(t.x, t.y, t.r-2, 1, 0xff0000, 1, t.marks[sh].a) -- seconds hand
end
--[[
#############################################################################################
init
#############################################################################################
--]]
local _locale = os.setlocale(nil, 'ctype')
os.setlocale(_locale, 'all')
for i in pairs(settings_table) do
local t = settings_table[i]
t.marks = {}; for j=0,600 do t.marks[j] = {} end
t.marks[0].a = math.rad(0)
for j=1,600 do t.marks[j].a=t.marks[j-1].a+math.rad(360/600) end
t.time=os.date('*t')
end
--[[
#############################################################################################
--]]
function conky_main()
settings_table[1].s=settings_table[1].time.sec
settings_table[1].time=os.date('*t')
local updates = tonumber(conky_parse('${updates}'))
if updates <= 5 then return end
if not settings_table[1].up and settings_table[1].s ~= settings_table[1].time.sec then settings_table[1].up=updates-settings_table[1].s*10 end
if not settings_table[1].up then return end
cairo_init()
for i in pairs(settings_table) do draw_clock(settings_table[i], updates) end
cairo_clean()
end
endDebian Sid (Minted) x86_64/3.8-5, Conky 2.0_pre, Xorg 7.7/1.12.4, GNOME 3.4.2, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, ST9250827AS 250GB
Linux user No.: 483055 | Conky Pitstop
Offline
Sector11 wrote:I'm such a
around code!
Hey, wait a minute! I think I resemble that remark! If your a 'chimp', then what am I? I must be like a 'Prokaryotic bacteria'!
Primordial Soup? 
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
As requested - plus one for below:
config_settings (above TEXT)
variables (below TEXT)
I just remembered a question I had a few days ago....
I saw a post S11 had made concerning being able to "Right-Click" on a conky and still get the 'menu' associated with the "Right-Click". I noticed that I had 'lost' this functionality. In using three conky's, much of my desktop is covered!I couldn't remember how to get it back. I just realized that by changing the 'own_window_type' to 'override' instead of 'normal', I get the "Right-Click" back! Could someone maybe post a link, with perhaps some explanations of what the different variables above "Text" do and the choices you have. I'm prone to "breaking" things, and would like to take some of the guess-work out of this. As I've gotten older, my brain has become weaker! (and forget prone) Thanks everyone...
![]()
Jed
Well this is interesting - I use:
own_window_type normaland my conkys are all right clickable.
There are somethings everyone needs to be aware of, things that will affect the conky config_settings (above TEXT):
your choice of Desktop Environment or Window Manager ie: Xfce4, Gnome, OB, FB, etc.
are you using a composite manager? yes | no | huh?
which composite manager are you running? ie: xcpmmgr, cpmpiz, cpmpton xfwm4 (built into Xfce4 ), etc.
Some of those config_settings have a bearing on how other choices will work:
Example:
own_window
Boolean, create own window to draw? yes | no
has an affect on:
own_window_hints
own_window_type
The write up for both of the above start with: If own_window is yes, you may ...
own_window_argb_visual
Boolean, use ARGB visual? ARGB can be used for real transparency, note that a composite manager is required for real transparency. This option will not work as desired (in most cases) in conjunction with 'own_window_type override'.
has an affect on:
own_window_type - - - if you choose: override
Also with:
own_window_type override
this is important: If you use own_window_type override, window manager hints have no meaning and are ignored.
In fact I think with my Xfce4 setup I use:
own_window_type normaland my conkys are all right clickable.
I'll come back when I check.
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.