SEARCH

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

You are not logged in.

#3826 2012-11-15 20:29:55

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

Re: The New Monster Conky Thread

speaking of v9000 i feel an update coming soon.  I should have time over the thanksgiving break to implement an enhanced text function, including ability to set italic and bold as well as many different things

it will be a drop in replacement and will run all existing code without anyone having to make changes (unless they want the new options)

Offline

Be excellent to each other!

#3827 2012-11-15 20:35:17

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

Re: The New Monster Conky Thread

mrpeachy wrote:

speaking of v9000 i feel an update coming soon.  I should have time over the thanksgiving break to implement an enhanced text function, including ability to set italic and bold as well as many different things

it will be a drop in replacement and will run all existing code without anyone having to make changes (unless they want the new options)

You scared me for a second there lol, i saw

speaking of v9000 i feel an update coming soon

and all I could think was "I finally figured out how to set-up weather using the lua script, and now it's gonna be different", and then I read on and saw it is gonna be a drop-in, lol.
So, what are the chances of getting reflection in the update?
Also, I have a question, how can I change what color wind icons the config uses? I want to use the red ones, but it defaults to green, or is it set-up so that it changes colors as the wind gets faster and faster?


monkey Got /? | 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

#3828 2012-11-15 20:52:53

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

McLovin wrote:

Well, thank you. I'm actually working on a reconfigured chrono-weather using v9000 in the clock instead of conkyForecast, as it doesn't work on some systems, for example, my Arch install, for some reason or another, conkyForecast doesn't work at all, also on the system that I'm on now, a custom built Debian Sid based system that I built, it's really flakey, coming and going randomly, so I think the v9000 will make it more stable, and a better layout all around.
I also have figured out how to make different areas different colors, as I posted earlier, you can see my progress in the screenshot below.

http://t.imgbox.com/ackPO3lv.jpg

You're welcome, you did the work  big_smile

Hey!  Nice!!!!!!  Yea I saw that about the colours ... Looking forward to seeing the code.  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3829 2012-11-15 20:58:06

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

mrpeachy wrote:

speaking of v9000 i feel an update coming soon.  I should have time over the thanksgiving break to implement an enhanced text function, including ability to set italic and bold as well as many different things

it will be a drop in replacement and will run all existing code without anyone having to make changes (unless they want the new options)

Ooooooooooooooooooooooooo good stuff ... kiss  Oops! ops your a mr not a miss.  All meant in good fun!  angel


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3830 2012-11-15 20:59:31

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

Re: The New Monster Conky Thread

@Sector11,
Is there something we should know about?  tongue

Last edited by McLovin (2012-11-15 20:59:46)


monkey Got /? | 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

#3831 2012-11-15 21:16:02

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

Re: The New Monster Conky Thread

I have another question, how do I get the script to show the current moon phase icon? I have tried

image({x=140,y=60,h=70,w=70,file=now["moon_icon"]})

as well as

image({x=140,y=60,h=70,w=70,file=moon_icon[0]})

and even

image({x=140,y=60,h=70,w=70,file=moon_icon[]})

but all I seem to be able to get, is the next days moon phase icon. Anyone have any ideas? I'm also still trying to figure out how to change wind direction compass color, still no luck with that, so I'm open for suggestions.


monkey Got /? | 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

#3832 2012-11-15 21:42:48

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

Re: The New Monster Conky Thread

^ remember that forecast day 1 is today
so moon_icon[1] is todays moon phase

Offline

#3833 2012-11-15 21:44:34

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

Re: The New Monster Conky Thread

mrpeachy wrote:

^ remember that forecast day 1 is today
so moon_icon[1] is todays moon phase

Oh, ok, I'm just retarded and didn't think, I really need to start thinking before I ask dumb questions lol.
And thank you for the answer on that, appreciate it.
Any ideas about the wind compass color?


monkey Got /? | 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

#3834 2012-11-15 21:47:14

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

Re: The New Monster Conky Thread

the wind compass color is directly related to the wind speed - green, yellow, orange and red
take a look in the weather icons folder

you could recolor the icons themselves or rename them but you cant control the color via the template itself

Last edited by mrpeachy (2012-11-15 21:48:12)

Offline

#3835 2012-11-15 21:52:11

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

Re: The New Monster Conky Thread

ok, I was thinking that when I looked at the all the files and the v9000 itself, I'll create my own and if ppl end up liking them, I'll make an archive and upload them to my site for download, we'll see how it goes. Thank you again for the help.


monkey Got /? | 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

#3836 2012-11-15 22:58:59

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

McLovin wrote:

@Sector11,
Is there something we should know about?  tongue

E=MC²

pie-R-round

sin^2(x) + cos^2(x) = 1

monkey + devil = cool


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3837 2012-11-16 00:10:58

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

Re: The New Monster Conky Thread

Alright I got the temps put in and I was able to get 4 in like I thought... and I got my sensors to work finally.

So here is the new look and thanks sector11 for the wallpaper. (had to change the alpha values for the fill to see the picture under it)

2012_11_15_1352994247_1280x1024_scrot.jpg

I have the new code but I think it is still in need of a clean so I will be doing that here soon as well as making it quad core friendly, maybe.
oh and conky_parse("S{hwmod ....}") is what I used to get the temp values so you will probably have to change them, per your system.

--insturment panel beta 2.0
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
--######################################################################
--Settings
--######################################################################
--default settings######################################################
d_line_width=2
deg_math=(math.pi/180)
max_value=100
d_foreground_width=4
d_font_color_red=.8
d_font_color_green=.8
d_font_color_blue=.8
d_font_color_alpha=1
d_gauge_color_red=1
d_gauge_color_green=0
d_gauge_color_blue=0
d_gauge_color_alpha=1
d_foreground_color_red=.5
d_foreground_color_green=0
d_foreground_color_blue=.1
d_foreground_color_alpha=1
d_inner_arc_color_red=.2
d_inner_arc_color_green=.2
d_inner_arc_color_blue=.2
d_inner_arc_color_alpha=1
d_fill_color_red=.05
d_fill_color_green=.05
d_fill_color_blue=.05
d_fill_color_alpha=.75
d_font="mono"
d_font_size=11
d_font_slant=CAIRO_FONT_SLANT_NORMAL
d_font_face=CAIRO_FONT_WEIGHT_NORMAL
rotate_d=-90
rotate_r=deg_math*rotate_d
--colors################################################################
--panel border
panel_border_color_red=.3
panel_border_color_green=.3
panel_border_color_blue=.3
panel_border_color_alpha=1
--sperators fill
seperator_fill_color_red=.1
seperator_fill_color_green=.1
seperator_fill_color_blue=.1
seperator_fill_color_alpha=.75
--temp background
tempbg_red=.1
tempbg_green=.1
tempbg_blue=.1
tempbg_alpha=1
--conky values##########################################################
cpu_core_1=conky_parse("${cpu cpu0}")
cpu_core_2=conky_parse("${cpu cpu1}")
cpu_core_avg=((cpu_core_1+cpu_core_2)/2)
cpu_temp=conky_parse("${hwmon temp 1}")
mb_temp=conky_parse("${hwmon temp 2}")
case_temp=conky_parse("${hwmon temp 3}")
mem_perc=conky_parse("${memperc}")
mem_used=conky_parse("${mem}")
mem_max=conky_parse("${memmax}")
swap_perc=conky_parse("${swapperc}")
swap_used=conky_parse("${swap}")
swap_max=conky_parse("${swapmax}")
system_perc=conky_parse("${fs_used_perc /}")
system_used=conky_parse("${fs_used /}")
system_size=conky_parse("${fs_size /}")
home_perc=conky_parse("${fs_used_perc /home}")
home_used=conky_parse("${fs_used /home}")
home_size=conky_parse("${fs_size /home}")
down_speed_limited=conky_parse("${if_match 1000 < ${downspeedf}}1001${else}${downspeedf}${endif}")
down_scale_adjuster=conky_parse("${if_match 1000 < ${downspeedf}}1001${else}${if_match 500 < ${downspeedf}}1000${else}${if_match 250 < ${downspeedf}}500${else}${if_match 100 < ${downspeedf}}250${else}100${endif}${endif}${endif}${endif}")
up_speed_limited=conky_parse("${if_match 100 < ${upspeedf}}101${else}${upspeedf}${endif}")
up_scale_adjuster=conky_parse("${if_match 100 < ${upspeedf}}101${else}${if_match 50 < ${upspeedf}}100${else}50${endif}${endif}")
--panel and seperators##################################################
--panel points
--left line
panel_start_x=5
panel_start_y=35
panel_point2_x=5
panel_point2_y=175
--bottom line
panel_point3_x=35
panel_point3_y=205
panel_point4_x=775
panel_point4_y=205
--right line
panel_point5_x=805
panel_point5_y=175
panel_point6_x=805
panel_point6_y=35
--top line
panel_point7_x=775
panel_point7_y=5
panel_point8_x=35
panel_point8_y=5
--seperators points
--seperator 1
seperator1_start_x=55
seperator1_start_y=5
seperator1_point1_x=205
seperator1_point1_y=105
seperator1_end_x=255
seperator1_end_y=202
--seperator 2
seperator2_start_x=755
seperator2_start_y=5
seperator2_point1_x=605
seperator2_point1_y=105
seperator2_end_x=555
seperator2_end_y=202
--cpu###################################################################
cpu_center_x=405
cpu_center_y=135
cpu_radius=120
--cpu background arc
cpu_arc_center_x=cpu_center_x
cpu_arc_center_y=cpu_center_y
cpu_arc_radius=cpu_radius
cpu_arc_start_degree=150
cpu_arc_end_degree=390
cpu_arc_start_angle=cpu_arc_start_degree*deg_math
cpu_arc_end_rad=cpu_arc_end_degree*deg_math
cpu_arc_end_math=cpu_arc_end_rad-cpu_arc_start_angle
cpu_arc_scale=cpu_arc_end_math/max_value
cpu_arc_end_angle_value=cpu_core_avg*cpu_arc_scale
cpu_arc_end_angle=cpu_arc_end_angle_value+cpu_arc_start_angle
--cpu foreground arc
cpu_foreground_arc_center_x=cpu_center_x
cpu_foreground_arc_center_y=cpu_center_y
cpu_foreground_arc_radius=cpu_radius
cpu_foreground_arc_start_degree=150
cpu_foreground_arc_end_degree=390
cpu_foreground_arc_start_angle=cpu_foreground_arc_start_degree*deg_math
cpu_foreground_arc_end_angle=cpu_foreground_arc_end_degree*deg_math
--cpu needle
cpu_needle_line_x=405
cpu_needle_line_y=175
--cpu inner arc
cpu_inner_arc_center_x=405
cpu_inner_arc_center_y=175
cpu_inner_arc_radius=20
cpu_inner_arc_start_degree=0
cpu_inner_arc_end_degree=360
cpu_inner_arc_start_rad=cpu_inner_arc_start_degree*deg_math
cpu_inner_arc_end_rad=cpu_inner_arc_end_degree*deg_math
--temp##################################################################
temp_radius=cpu_radius+11
temp_max=90
--temp backgound
tempbg_width=d_foreground_width+d_foreground_width
tempbg_br_width=tempbg_width+d_line_width
--backgound 1
tempbg1_start_deg=150
tempbg1_end_deg=240
tempbg1_start=tempbg1_start_deg*deg_math
tempbg1_end=tempbg1_end_deg*deg_math
--background 2
tempbg2_start_deg=300
tempbg2_end_deg=30
tempbg2_start=tempbg2_start_deg*deg_math
tempbg2_end=tempbg2_end_deg*deg_math
--temp1
temp1_start_deg=150
temp1_end_deg=190
temp1_start=temp1_start_deg*deg_math
temp1_end_rad=temp1_end_deg*deg_math
temp1_end_math=temp1_end_rad-temp1_start
temp1_scale=temp1_end_math/temp_max
temp1_end_math2=cpu_temp*temp1_scale
temp1_end=temp1_end_math2+temp1_start
--temp2
temp2_start_deg=240
temp2_end_deg=200
temp2_start=temp2_start_deg*deg_math
temp2_end_rad=temp2_end_deg*deg_math
temp2_end=temp2_end_rad
--temp3
temp3_start_deg=300
temp3_end_deg=340
temp3_start=temp3_start_deg*deg_math
temp3_end_rad=temp3_end_deg*deg_math
temp3_end=temp3_end_rad
--temp4
temp4_start_deg=30
temp4_end_deg=-10
temp4_start=temp4_start_deg*deg_math
temp4_end_rad=temp4_end_deg*deg_math
temp4_end_math=temp4_end_rad-temp4_start
temp4_scale=temp4_end_math/temp_max
temp4_end_math2=mb_temp*temp4_scale
temp4_end=temp4_end_math2+temp4_start
--ram###################################################################
--mem background arc
mem_arc_center_x=215
mem_arc_center_y=60
mem_arc_radius=40
mem_arc_start_degree=-270
mem_arc_end_degree=-505
mem_arc_start_angle=mem_arc_start_degree*deg_math
mem_arc_end_rad=mem_arc_end_degree*deg_math
mem_arc_scale_math=mem_arc_end_rad-mem_arc_start_angle
mem_arc_scale=mem_arc_scale_math/max_value
mem_arc_end_angle_math=mem_perc*mem_arc_scale
mem_arc_end_angle=mem_arc_end_angle_math+mem_arc_start_angle
--mem foreground arc
mem_foreground_arc_center_x=mem_arc_center_x
mem_foreground_arc_center_y=mem_arc_center_y
mem_foreground_arc_radius=mem_arc_radius
mem_foreground_arc_start_degree=mem_arc_start_degree
mem_foreground_arc_end_degree=mem_arc_end_degree
mem_foreground_arc_start_angle=mem_foreground_arc_start_degree*deg_math
mem_foreground_arc_end_angle=mem_foreground_arc_end_degree*deg_math
--mem needle
mem_needle_line_x=mem_inner_arc_center_x
mem_needle_line_y=mem_inner_arc_center_y
--mem inner arc
mem_inner_arc_center_x=mem_arc_center_x
mem_inner_arc_center_y=mem_arc_center_y
mem_inner_arc_radius=8
mem_inner_arc_start_degree=0
mem_inner_arc_end_degree=360
mem_inner_arc_start_rad=mem_inner_arc_start_degree*deg_math
mem_inner_arc_end_rad=mem_inner_arc_end_degree*deg_math
--swap##################################################################
--swap background arc
swap_arc_center_x=595
swap_arc_center_y=60
swap_arc_radius=40
swap_arc_start_degree=90
swap_arc_end_degree=325
swap_arc_start_angle=swap_arc_start_degree*deg_math
swap_arc_end_rad=swap_arc_end_degree*deg_math
swap_arc_scale_math=swap_arc_end_rad-swap_arc_start_angle
swap_arc_scale=swap_arc_scale_math/max_value
swap_arc_end_angle_math=swap_perc*swap_arc_scale
swap_arc_end_angle_math2=swap_arc_end_angle_math+swap_arc_start_angle
swap_arc_end_angle=swap_arc_end_angle_math2
--swap foreground arc
swap_foreground_arc_center_x=swap_arc_center_x
swap_foreground_arc_center_y=swap_arc_center_y
swap_foreground_arc_radius=swap_arc_radius
swap_foreground_arc_start_degree=swap_arc_start_degree
swap_foreground_arc_end_degree=swap_arc_end_degree
swap_foreground_arc_start_angle=swap_foreground_arc_start_degree*deg_math
swap_foreground_arc_end_angle=swap_foreground_arc_end_degree*deg_math
--swap needle
swap_needle_line_x=swap_inner_arc_center_x
swap_needle_line_y=swap_inner_arc_center_y
--swap inner arc
swap_inner_arc_center_x=swap_arc_center_x
swap_inner_arc_center_y=swap_arc_center_y
swap_inner_arc_radius=8
swap_inner_arc_start_degree=0
swap_inner_arc_end_degree=360
swap_inner_arc_start_rad=swap_inner_arc_start_degree*deg_math
swap_inner_arc_end_rad=swap_inner_arc_end_degree*deg_math
--file system###########################################################
file_system_center_x=745
file_system_center_y=105
file_system_radius=50
file_system_inner_radius=8
file_system_inner_arc_start_degree=0
file_system_inner_arc_start_angle=file_system_inner_arc_start_degree*deg_math
file_system_inner_arc_end_degree=360
file_system_inner_arc_end_angle=file_system_inner_arc_end_degree*deg_math
--system partition
system_arc_start_degree=100
system_arc_start_angle=system_arc_start_degree*deg_math
system_arc_end_degree=260
system_arc_end_rad=system_arc_end_degree*deg_math
system_arc_difference=system_arc_end_rad-system_arc_start_angle
system_arc_end_scale=system_arc_difference/max_value
system_arc_end_angle_math=system_perc*system_arc_end_scale
system_arc_end_angle=system_arc_end_angle_math+system_arc_start_angle
--home partition
home_arc_start_degree=-280
home_arc_start_angle=home_arc_start_degree*deg_math
home_arc_end_degree=-440
home_arc_end_rad=home_arc_end_degree*deg_math
home_arc_scale_math=home_arc_end_rad-home_arc_start_angle
home_arc_scale=home_arc_scale_math/max_value
home_arc_end_angle_math=home_perc*home_arc_scale
home_arc_end_angle=home_arc_end_angle_math+home_arc_start_angle
--network###############################################################
network_center_x=65
network_center_y=105
network_radius=50
network_inner_radius=8
network_inner_arc_start_degree=0
network_inner_arc_start_angle=network_inner_arc_start_degree*deg_math
network_inner_arc_end_degree=360
network_inner_arc_end_angle=network_inner_arc_end_degree*deg_math
--down speed
down_max_value=down_scale_adjuster
down_arc_start_degree=100
down_arc_start_angle=down_arc_start_degree*deg_math
down_arc_end_degree=260
down_arc_end_rad=down_arc_end_degree*deg_math
down_arc_difference=down_arc_end_rad-down_arc_start_angle
down_arc_end_scale=down_arc_difference/down_scale_adjuster
down_arc_end_angle_math=down_speed_limited*down_arc_end_scale
down_arc_end_angle=down_arc_end_angle_math+down_arc_start_angle
--up speed
up_max_value=up_scale_adjuster
up_arc_start_degree=-280
up_arc_start_angle=up_arc_start_degree*deg_math
up_arc_end_degree=-440
up_arc_end_rad=up_arc_end_degree*deg_math
up_arc_scale_math=up_arc_end_rad-up_arc_start_angle
up_arc_scale=up_arc_scale_math/up_scale_adjuster
up_arc_end_angle_math=up_speed_limited*up_arc_scale
up_arc_end_angle=up_arc_end_angle_math+up_arc_start_angle
--labels################################################################
--font settings
cpu_avg_size=19
cpu_value_size=16
network_scale_size=10
--text
--cpu
cpu_label="cpu"
cpu_avg_label="Average"
cpu_core_1_label="Core 1: "
cpu_core_2_label="Core 2: "
cpu_avg=""..cpu_core_avg.."%"
cpu_value1=""..cpu_core_1.."%"
cpu_value2=""..cpu_core_2.."%"
cpu_scale_low="0"
cpu_scale_high="100"
--temp1
temp1_value=""..cpu_temp.."C"
--temp4
temp4_label="M/B"
temp4_value=""..mb_temp.."C"
--mem text
mem_label="Ram"
mem_perc_text=""..mem_perc.."%"
--swap text
swap_label="Swap"
swap_perc_text=""..swap_perc.."%"
--system
system_label="System"
system_label2="System: "..system_used.." / "..system_size..""
--home
home_label="Home"
home_label2="Home: "..home_used.." / "..home_size..""
--down
down_label="Down"
down_speed_value=conky_parse("${downspeedf}")
down_speed_text=""..down_speed_value.."KiB/s"
down_label2="Down: "..down_speed_text..""
down_scale=down_scale_adjuster
--up
up_label="Up"
up_speed_value=conky_parse("${upspeedf}")
up_speed_text=""..up_speed_value.."KiB/s"
up_label2="Up: "..up_speed_text..""
up_scale=up_scale_adjuster
--x and y values
--cpu
cpu_label_x=393
cpu_label_y=150
cpu_avg_label_x=365
cpu_avg_label_y=55
cpu_avg_x=cpu_avg_label_x+20
cpu_avg_y=cpu_avg_label_y+20
cpu_value1_x=355
cpu_value1_y=105
cpu_value2_x=cpu_value1_x
cpu_value2_y=cpu_value1_y+15
cpu_scale_low_x=305
cpu_scale_low_y=180
cpu_scale_high_x=605
cpu_scale_high_y=180
--temp1
temp1_label_x=240
temp1_label_y=135
temp1_value_x=temp1_label_x
temp1_value_y=temp1_label_y+15
--temp4
temp4_label_x=548
temp4_label_y=135
temp4_value_x=temp4_label_x
temp4_value_y=temp4_label_y+15
--mem
mem_label_x=182
mem_label_y=62
mem_perc_text_x=227
mem_perc_text_y=63
mem_used_x=195
mem_used_y=85
mem_max_x=130
mem_max_y=30
--swap
swap_label_x=605
swap_label_y=62
swap_perc_text_x=563
swap_perc_text_y=63
swap_used_x=575
swap_used_y=85
swap_max_x=630
swap_max_y=30
--system
system_label_x=720
system_label_y=125
system_label2_x=600
system_label2_y=175
--home
home_label_x=775
home_label_y=120
home_label2_x=system_label2_x
home_label2_y=system_label2_y+12
--down
down_label_x=40
down_label_y=117
down_label2_x=panel_point3_x
down_label2_y=panel_point2_y
down_scale_x=35
down_scale_y=50
--up
up_label_x=95
up_label_y=110
up_label2_x=down_label2_x
up_label2_y=down_label2_y+12
up_scale_x=72
up_scale_y=50
--######################################################################
-- Main Body Backgound and Labels Section
--######################################################################
-- panel fill
cairo_set_line_width(cr,d_line_width)
cairo_move_to(cr,panel_start_x,panel_start_y)
cairo_line_to(cr,panel_point2_x,panel_point2_y)
cairo_line_to(cr,panel_point3_x,panel_point3_y)
cairo_line_to(cr,panel_point4_x,panel_point4_y)
cairo_line_to(cr,panel_point5_x,panel_point5_y)
cairo_line_to(cr,panel_point6_x,panel_point6_y)
cairo_line_to(cr,panel_point7_x,panel_point7_y)
cairo_line_to(cr,panel_point8_x,panel_point8_y)
cairo_close_path(cr)
cairo_set_source_rgba(cr,d_fill_color_red,d_fill_color_green,d_fill_color_blue,d_fill_color_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,panel_border_color_red,panel_border_color_green,panel_border_color_blue,panel_border_color_alpha)
cairo_stroke(cr)
--seperator 1
cairo_set_line_width(cr,d_line_width)
cairo_move_to(cr,seperator1_start_x,seperator1_start_y)
cairo_line_to(cr,seperator1_point1_x,seperator1_point1_y)
cairo_line_to(cr,seperator1_end_x,seperator1_end_y)
cairo_close_path(cr)
cairo_set_source_rgba(cr,seperator_fill_color_red,seperator_fill_color_green,seperator_fill_color_blue,seperator_fill_color_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_stroke(cr)
--seperator 2
cairo_set_line_width(cr,d_line_width)
cairo_move_to(cr,seperator2_start_x,seperator2_start_y)
cairo_line_to(cr,seperator2_point1_x,seperator2_point1_y)
cairo_line_to(cr,seperator2_end_x,seperator2_end_y)
cairo_close_path(cr)
cairo_set_source_rgba(cr,seperator_fill_color_red,seperator_fill_color_green,seperator_fill_color_blue,seperator_fill_color_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_stroke(cr)
--panel border
cairo_set_line_width(cr,d_line_width)
cairo_move_to(cr,panel_start_x,panel_start_y)
cairo_line_to(cr,panel_point2_x,panel_point2_y)
cairo_line_to(cr,panel_point3_x,panel_point3_y)
cairo_line_to(cr,panel_point4_x,panel_point4_y)
cairo_line_to(cr,panel_point5_x,panel_point5_y)
cairo_line_to(cr,panel_point6_x,panel_point6_y)
cairo_line_to(cr,panel_point7_x,panel_point7_y)
cairo_line_to(cr,panel_point8_x,panel_point8_y)
cairo_close_path(cr)
cairo_set_source_rgba(cr,panel_border_color_red,panel_border_color_green,panel_border_color_blue,panel_border_color_alpha)
cairo_stroke(cr)
--labels################################################################
--cpu label
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,cpu_label_x,cpu_label_y)
cairo_show_text (cr,cpu_label)
cairo_stroke (cr)
--cpu average label
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,cpu_avg_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,cpu_avg_label_x,cpu_avg_label_y)
cairo_show_text (cr,cpu_avg_label)
cairo_stroke (cr)
--cpu average
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,cpu_avg_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,cpu_avg_x,cpu_avg_y)
cairo_show_text (cr,cpu_avg)
cairo_stroke (cr)
--cpu core 1
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,cpu_value_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,cpu_value1_x,cpu_value1_y)
cairo_show_text (cr,cpu_core_1_label)
cairo_show_text (cr,cpu_value1)
cairo_stroke (cr)
--cpu core 2
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,cpu_value_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,cpu_value2_x,cpu_value2_y)
cairo_show_text (cr,cpu_core_2_label)
cairo_show_text (cr,cpu_value2)
cairo_stroke (cr)
--temp 1 label
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,temp1_label_x,temp1_label_y)
cairo_show_text (cr,cpu_label)
cairo_stroke (cr)
--temp 1 value
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,temp1_value_x,temp1_value_y)
cairo_show_text (cr,temp1_value)
cairo_stroke (cr)
--temp 4 label
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,temp4_label_x,temp4_label_y)
cairo_show_text (cr,temp4_label)
cairo_stroke (cr)
--temp 4 value
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,temp4_value_x,temp4_value_y)
cairo_show_text (cr,temp4_value)
cairo_stroke (cr)
--mem_label
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,mem_label_x,mem_label_y)
cairo_show_text (cr,mem_label)
cairo_stroke (cr)
--mem_perc
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,mem_perc_text_x,mem_perc_text_y)
cairo_show_text (cr,mem_perc_text)
cairo_stroke (cr)
--mem_used
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,mem_used_x,mem_used_y)
cairo_show_text (cr,mem_used)
cairo_stroke (cr)
--mem_max
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,mem_max_x,mem_max_y)
cairo_show_text (cr,mem_max)
cairo_stroke (cr)
--swap_label
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,swap_label_x,swap_label_y)
cairo_show_text (cr,swap_label)
cairo_stroke (cr)
--swap_perc
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,swap_perc_text_x,swap_perc_text_y)
cairo_show_text (cr,swap_perc_text)
cairo_stroke (cr)
--swap_used
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,swap_used_x,swap_used_y)
cairo_show_text (cr,swap_used)
cairo_stroke (cr)
--swap_max
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,swap_max_x,swap_max_y)
cairo_show_text (cr,swap_max)
cairo_stroke (cr)
--system label
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_save(cr)
cairo_translate (cr,system_label_x,system_label_y)
cairo_rotate(cr,rotate_r)
cairo_show_text (cr,system_label)
cairo_stroke (cr)
cairo_restore(cr)
--system label 2
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,system_label2_x,system_label2_y)
cairo_show_text (cr,system_label2)
cairo_stroke (cr)
--home label
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_save(cr)
cairo_translate (cr,home_label_x,home_label_y)
cairo_rotate(cr,rotate_r)
cairo_show_text (cr,home_label)
cairo_stroke (cr)
cairo_restore(cr)
--home label 2
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,home_label2_x,home_label2_y)
cairo_show_text (cr,home_label2)
cairo_stroke (cr)
--down label
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_save(cr)
cairo_translate (cr,down_label_x,down_label_y)
cairo_rotate(cr,rotate_r)
cairo_show_text (cr,down_label)
cairo_stroke (cr)
cairo_restore(cr)
--down label 2
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,down_label2_x,down_label2_y)
cairo_show_text (cr,down_label2)
cairo_stroke (cr)
--down scale
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,network_scale_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,down_scale_x,down_scale_y)
cairo_show_text (cr,down_scale)
cairo_stroke (cr)
--up label
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_save(cr)
cairo_translate (cr,up_label_x,up_label_y)
cairo_rotate(cr,rotate_r)
cairo_show_text (cr,up_label)
cairo_stroke (cr)
cairo_restore(cr)
--up label 2
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,up_label2_x,up_label2_y)
cairo_show_text (cr,up_label2)
cairo_stroke (cr)
--up scale
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,network_scale_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,up_scale_x,up_scale_y)
cairo_show_text (cr,up_scale)
cairo_stroke (cr)
--######################################################################
-- Main Body Gauge Section
--######################################################################
--cpu###################################################################
--cpu arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc(cr,cpu_arc_center_x,cpu_arc_center_y,cpu_arc_radius,cpu_arc_start_angle,cpu_arc_end_angle)
--cpu needle
cairo_line_to(cr,cpu_needle_line_x,cpu_needle_line_y)
cairo_stroke(cr)
--cpu_foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,cpu_foreground_arc_center_x,cpu_foreground_arc_center_y,cpu_foreground_arc_radius,cpu_foreground_arc_start_angle,cpu_foreground_arc_end_angle)
cairo_stroke(cr)
--cpu inner arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_inner_arc_color_red,d_inner_arc_color_green,d_inner_arc_color_blue,d_inner_arc_color_alpha)
cairo_arc(cr,cpu_inner_arc_center_x,cpu_inner_arc_center_y,cpu_inner_arc_radius,cpu_inner_arc_start_rad,cpu_inner_arc_end_rad)
cairo_stroke(cr)
--temp##################################################################
--backgound1
cairo_set_line_width(cr,tempbg_br_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,cpu_center_x,cpu_center_y,temp_radius,tempbg1_start,tempbg1_end)
cairo_stroke(cr)
--temp 1 background
cairo_set_line_width(cr,tempbg_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,tempbg_red,tempbg_green,tempbg_blue,tempbg_alpha)
cairo_arc(cr,cpu_center_x,cpu_center_y,temp_radius,temp1_start,temp1_end_rad)
cairo_stroke(cr)
--temp 2 background
cairo_set_line_width(cr,tempbg_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,tempbg_red,tempbg_green,tempbg_blue,tempbg_alpha)
cairo_arc_negative(cr,cpu_center_x,cpu_center_y,temp_radius,temp2_start,temp2_end_rad)
cairo_stroke(cr)
--background2
cairo_set_line_width(cr,tempbg_br_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,cpu_center_x,cpu_center_y,temp_radius,tempbg2_start,tempbg2_end)
cairo_stroke(cr)
--temp 3 background
cairo_set_line_width(cr,tempbg_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,tempbg_red,tempbg_green,tempbg_blue,tempbg_alpha)
cairo_arc(cr,cpu_center_x,cpu_center_y,temp_radius,temp3_start,temp3_end_rad)
cairo_stroke(cr)
--temp 4 background
cairo_set_line_width(cr,tempbg_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,tempbg_red,tempbg_green,tempbg_blue,tempbg_alpha)
cairo_arc_negative(cr,cpu_center_x,cpu_center_y,temp_radius,temp4_start,temp4_end_rad)
cairo_stroke(cr)
--temp 1
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,cpu_center_x,cpu_center_y,temp_radius,temp1_start,temp1_end)
cairo_stroke(cr)
--temp 2
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc_negative(cr,cpu_center_x,cpu_center_y,temp_radius,temp2_start,temp2_end)
cairo_stroke(cr)
--temp 3
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,cpu_center_x,cpu_center_y,temp_radius,temp3_start,temp3_end)
cairo_stroke(cr)
--temp 4
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc_negative(cr,cpu_center_x,cpu_center_y,temp_radius,temp4_start,temp4_end)
cairo_stroke(cr)
--mem###################################################################
--mem arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc_negative(cr,mem_arc_center_x,mem_arc_center_y,mem_arc_radius,mem_arc_start_angle,mem_arc_end_angle)
--mem needle
cairo_line_to(cr,mem_needle_line_x,mem_needle_line_y)
cairo_stroke(cr)
--mem_foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc_negative(cr,mem_foreground_arc_center_x,mem_foreground_arc_center_y,mem_foreground_arc_radius,mem_foreground_arc_start_angle,mem_foreground_arc_end_angle)
cairo_stroke(cr)
--mem inner arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_inner_arc_color_red,d_inner_arc_color_green,d_inner_arc_color_blue,d_inner_arc_color_alpha)
cairo_arc(cr,mem_inner_arc_center_x,mem_inner_arc_center_y,mem_inner_arc_radius,mem_inner_arc_start_rad,mem_inner_arc_end_rad)
cairo_stroke(cr)
--swap##################################################################
--swap arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc(cr,swap_arc_center_x,swap_arc_center_y,swap_arc_radius,swap_arc_start_angle,swap_arc_end_angle)
--swap needle
cairo_line_to(cr,swap_needle_line_x,swap_needle_line_y)
cairo_stroke(cr)
--swap_foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,swap_foreground_arc_center_x,swap_foreground_arc_center_y,swap_foreground_arc_radius,swap_foreground_arc_start_angle,swap_foreground_arc_end_angle)
cairo_stroke(cr)
--swap inner arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_inner_arc_color_red,d_inner_arc_color_green,d_inner_arc_color_blue,d_inner_arc_color_alpha)
cairo_arc(cr,swap_inner_arc_center_x,swap_inner_arc_center_y,swap_inner_arc_radius,swap_inner_arc_start_rad,swap_inner_arc_end_rad)
cairo_stroke(cr)
--file system###########################################################
--system indicator arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc(cr,file_system_center_x,file_system_center_y,file_system_radius,system_arc_start_angle,system_arc_end_angle)
--system needle
cairo_line_to(cr,file_system_center_x,file_system_center_y)
cairo_stroke(cr)
--system foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,file_system_center_x,file_system_center_y,file_system_radius,system_arc_start_angle,system_arc_end_rad)
cairo_stroke(cr)
--home indicator arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc_negative(cr,file_system_center_x,file_system_center_y,file_system_radius,home_arc_start_angle,home_arc_end_angle)
--home needle
cairo_line_to(cr,file_system_center_x,file_system_center_y)
cairo_stroke(cr)
--home foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc_negative(cr,file_system_center_x,file_system_center_y,file_system_radius,home_arc_start_angle,home_arc_end_rad)
cairo_stroke(cr)
--inner arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_inner_arc_color_red,d_inner_arc_color_green,d_inner_arc_color_blue,d_inner_arc_color_alpha)
cairo_arc(cr,file_system_center_x,file_system_center_y,file_system_inner_radius,file_system_inner_arc_start_angle,file_system_inner_arc_end_angle)
cairo_stroke(cr)
--network###############################################################
--down indicator arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc(cr,network_center_x,network_center_y,network_radius,down_arc_start_angle,down_arc_end_angle)
--down needle
cairo_line_to(cr,network_center_x,network_center_y)
cairo_stroke(cr)
--down foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc(cr,network_center_x,network_center_y,network_radius,down_arc_start_angle,down_arc_end_rad)
cairo_stroke(cr)
--up indicator arc
cairo_set_line_width(cr,d_line_width)
cairo_set_source_rgba(cr,d_gauge_color_red,d_gauge_color_green,d_gauge_color_blue,d_gauge_color_alpha)
cairo_arc_negative(cr,network_center_x,network_center_y,network_radius,up_arc_start_angle,up_arc_end_angle)
--up needle
cairo_line_to(cr,network_center_x,network_center_y)
cairo_stroke(cr)
--up foreground arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_foreground_color_red,d_foreground_color_green,d_foreground_color_blue,d_foreground_color_alpha)
cairo_arc_negative(cr,network_center_x,network_center_y,network_radius,up_arc_start_angle,up_arc_end_rad)
cairo_stroke(cr)
--inner arc
cairo_set_line_width(cr,d_foreground_width)
cairo_set_source_rgba(cr,d_inner_arc_color_red,d_inner_arc_color_green,d_inner_arc_color_blue,d_inner_arc_color_alpha)
cairo_arc(cr,network_center_x,network_center_y,network_inner_radius,network_inner_arc_start_angle,network_inner_arc_end_angle)
cairo_stroke(cr)
--######################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

I found a typo in the down and up speed label now it is fixed. All it was is that they said MiB/s instead of KiB/s

Last edited by ansem_of_nexus (2012-11-16 02:05:00)


You can find my work here

Make everything ok button

Offline

#3838 2012-11-16 04:00:56

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

Re: The New Monster Conky Thread

Ok, I think it;s finished, took quite a bit of tinkering, but its looking good in my eyes, let me know what you all think, and I'll make the tar files later, it's a little late here, and I'm in a ton of pain today.
the usual things from me, now playing changes to be whatever music player you're using, torrents show up when you start transmission, etc.
Let me know what you think.

acxHzO43.jpg


monkey Got /? | 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

#3839 2012-11-16 04:07:57

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

Re: The New Monster Conky Thread

^ What do I think?

&**&^)((^%&%^% Epic!  devil


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#3840 2012-11-16 04:20:12

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

^^ & ^  What VastOne said ... that sound just about right, but cube it:

&**&^)((^%&%^% Epic!³

Last edited by Sector11 (2012-11-16 04:20:37)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3841 2012-11-16 05:46:04

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

Re: The New Monster Conky Thread

Definitely lookin' nice McLovin!
Jed

Offline

#3842 2012-11-16 06:17:06

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

Re: The New Monster Conky Thread

So I have a question what is the proper use of $to_bytes I can't get it to work with a conky command like $fs_size


You can find my work here

Make everything ok button

Offline

#3843 2012-11-16 11:44:16

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

ansem_of_nexus wrote:

So I have a question what is the proper use of $to_bytes I can't get it to work with a conky command like $fs_size

It's broken:  read the ps


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3844 2012-11-16 16:42:55

bozhkov
#! Junkie
Registered: 2009-12-29
Posts: 463

Re: The New Monster Conky Thread

Heya guys,  I had this idea to have conky showing up on demand (via keyboard shortcut). I guess it should by scripted to run conky if its not running and close it, if it is and should probably be easy enough with if/then, but I never really got around how to do that in bash. Can somebody help me with that?

Edit: Crazy enough, I found such script on the ubuntu forums big_smile
It's quite simple:

sh -c 'if pgrep conky; then pkill conky; else conky; fi'

Last edited by bozhkov (2012-11-16 16:48:09)

Offline

#3845 2012-11-16 17:56:25

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

Didier-T over in the Ubuntu-fr forums is a genius!

I saw his "Chronograph" work and thought I would have to reconfigure the lua script to get the 24 hours back yet again!

Not even close he made it simple!  Look at the options:

require 'cairo'
-- Position et taille horloge (Clock position and size) - Configure The Chronograph
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
line=true, --hand secondes true or false
handday=false, --hand day true or false
handdaynum=false, --hand day number true or false
handmonth=false, --hand month 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
}

I have a feeling there will be a few more people over on #! using this version.  I know I will be using it now.

If he falls: He's food!
acc51SgT.jpg
Excellent work Didier!

This is: chronograph-Didier-T.lua with a change to the fonts used: monofur and Liquid Crystal

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

]]

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
line=true, --hand secondes true or false
handday=false, --hand day true or false
handdaynum=false, --hand day number true or false
handmonth=false, --hand month 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,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- 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,1)
    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,1)
    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,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- 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,1)
    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,1)
    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,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
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,1)
    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,1)
    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) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- 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 of a 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=158
  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)
  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,1)
    cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    for i=1,60 do
      local radius=150
      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,1)
      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,1,1,1,1)
        else
          cairo_set_source_rgba (cr,0,1,1,1)
        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,0,0,1,1)
      else
        cairo_set_source_rgba (cr,0,1,1,1)
      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
end

Here it is running clean:
acuON5tf.jpg adqEmEmd.jpg
I have some circle tweaking to do  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3846 2012-11-16 19:07:40

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,326

Re: The New Monster Conky Thread

bozhkov wrote:

Heya guys,  I had this idea to have conky showing up on demand (via keyboard shortcut). I guess it should by scripted to run conky if its not running and close it, if it is and should probably be easy enough with if/then, but I never really got around how to do that in bash. Can somebody help me with that?

Edit: Crazy enough, I found such script on the ubuntu forums big_smile
It's quite simple:

sh -c 'if pgrep conky; then pkill conky; else conky; fi'

Yes, but I believe this command will kill all running conkies, but will only start the ~/.conkyrc not any customized conky scripts/configurations you're running.

Last edited by PackRat (2012-11-16 20:29:58)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#3847 2012-11-16 19:15:43

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

Re: The New Monster Conky Thread

@Sector11 ...  Nice work and layout.


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#3848 2012-11-16 19:20:11

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

bozhkov wrote:

Heya guys,  I had this idea to have conky showing up on demand (via keyboard shortcut). I guess it should by scripted to run conky if its not running and close it, if it is and should probably be easy enough with if/then, but I never really got around how to do that in bash. Can somebody help me with that?

Edit: Crazy enough, I found such script on the ubuntu forums big_smile
It's quite simple:

sh -c 'if pgrep conky; then pkill conky; else conky; fi'

Check out Start/Stop Conky


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#3849 2012-11-16 19:26:40

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,036
Website

Re: The New Monster Conky Thread

VastOne wrote:

@Sector11 ...  Nice work and layout.

Thanks!  Didier-T gets a big pat on the back for that one..

It's all mepeachy's fault - he started it all with his 4 clocks LUA - my mind went CLICK!  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

Be excellent to each other!

#3850 2012-11-16 19:59:24

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

Re: The New Monster Conky Thread

bozhkov wrote:

Heya guys,  I had this idea to have conky showing up on demand (via keyboard shortcut). I guess it should by scripted to run conky if its not running and close it, if it is and should probably be easy enough with if/then, but I never really got around how to do that in bash. Can somebody help me with that?

Edit: Crazy enough, I found such script on the ubuntu forums big_smile
It's quite simple:

sh -c 'if pgrep conky; then pkill conky; else conky; fi'

I actually use a script, which is in all my config archives, that you can add to a panel, or, as it should work, use a KB shortcut to execute it, here is the scripts that I use, all you would have to change is the location of the start script used to start conky

#!/bin/sh

# click to start, click to stop

if pidof conky | grep [0-9] > /dev/null
then
exec killall conky
else
exec /home/mclovin/chrono-9000/start-1.sh

fi

monkey Got /? | 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

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.

Debian Logo