SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#3901 2012-11-20 22:05:43

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Offline

Be excellent to each other!

#3902 2012-11-21 02:37:37

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Last edited by jed (2012-11-21 02:38:56)

Offline

#3903 2012-11-21 03:55:41

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Offline

#3904 2012-11-21 10:55:32

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 817

Re: Conky v1.9 Thread

(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.  : )


Things are not as they seem, nor are they otherwise.
- Lankavatara Sutra

Offline

#3905 2012-11-21 11:16:54

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Offline

#3906 2012-11-21 13:11:38

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

Offline

#3907 2012-11-21 21:07:58

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Offline

#3908 2012-11-21 21:47:28

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Last edited by Sector11 (2012-11-21 22:08:43)

Offline

#3909 2012-11-22 00:16:08

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: Conky v1.9 Thread

@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

#3910 2012-11-22 00:34:34

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: Conky v1.9 Thread

--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

#3911 2012-11-22 00:41:30

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Offline

#3912 2012-11-22 00:56:34

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

@ansem_of_nexus
looks really good
i havn't seen a conky looking much like yours before, which is certainly something smile

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 loop

Last edited by mrpeachy (2012-11-22 00:56:53)

Offline

#3913 2012-11-22 01:01:24

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: Conky v1.9 Thread

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

#3914 2012-11-22 02:39:38

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Offline

#3915 2012-11-22 08:48:02

McLovin
#! CrunchBanger
From: my computer chair
Registered: 2009-02-28
Posts: 105
Website

Re: Conky v1.9 Thread

Offline

#3916 2012-11-22 10:18:02

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Offline

#3917 2012-11-22 10:22:21

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Offline

#3918 2012-11-22 11:51:24

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Offline

#3919 2012-11-22 11:53:54

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Offline

#3920 2012-11-22 13:32:52

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

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}

Offline

#3921 2012-11-22 15:06:40

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

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!  ops   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... glasses

Jed

Offline

#3922 2012-11-22 16:23:49

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Offline

#3923 2012-11-22 16:30:15

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

 --[[
 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
 end

Offline

#3924 2012-11-22 16:31:16

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

Offline

Be excellent to each other!

#3925 2012-11-22 17:04:20

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

own_window_type normal

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo