Conky Support, Codes and Screenshots

GrouchyGaijin

Quote from: falldown on January 20, 2013, 07:21:22 PM

If you like you can go on over to the introductions thread and meet the community.


Done  :)
Thank you,

GG

falldown

Ok the right side system info is almost complete..
I have to admit this turned out really nice.
right side system info.mpeg

VastOne

If you could somehow get GMB involved within that, I think I would buy it!

I know it can be done, but would require a lot of brain drain to get it done

Very Very nice work!
VSIDO      VSIDO Change Blog    

    I dev VSIDO

falldown

^ I will see what I can do VastOne.

falldown

Ok got something in the works for gmb.. but it will rely on gmb's controls widget..
or maybe ever call that as well. We shall see.  :)

falldown



Working on some ugly script cleanup (mine of course) and a couple of hiccups in the GMB conky..
Very close to being done. 

VastOne

Nice!!!  ;D

I am looking at my future desktop!

WOW, I am so glad you took this on falldown.  Thanks!
VSIDO      VSIDO Change Blog    

    I dev VSIDO

falldown

Thank you.
I like how it looks.

Sector11

#128
¡O ... M ... G!
Beautiful!
Are you going to share the code to all of that?
Stay Home

lwfitz

Don't Be A Dick!

mrpeachy

#130
I don't think I can put it any better than sector11 has above!

Fabulous work as always falldown :D

...that was supposed to be a big smile... but it looks like its laughing! ... how about  ;D

mrpeachy

@ falldown

when drawing your base black box i see you are using this:

g=2
grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}}

since you only want a solid black fill
g=0
grad={{c=0x000000,a=1}}
might be more efficient

falldown

Thanks Peachy, S11 and VastOne..
Means a lot coming from you gents!
Code will be available soon (clean up as Peachy stated)  ;D

lwfitz




conky_chrono
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 355 745
maximum_width 355
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_middle
gap_x 190
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
temperature_unit Fahrenheit

####### Load Lua #########
lua_load ~/Conky/s11_clock.lua
lua_draw_hook_pre main

lua_load /home/luke/Conky/allcombined.lua

## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}

##############################  End LUA  ###
${image ~/Conky/debian_horns.png -s 200x200 -p 85,75}
#${image ~/Conky/vsido_orb_blue.png -s 285x285 -p 25,10}
TEXT


${lua tex_bg {20,0,0,365,750,"/home/luke/Conky/brushed.png"}}${lua draw_bg {20,1,1,365,750,0x000000,1,2,1}}





















${font WhiteRabbit:size=13}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p -5,338 -s 190x165}
${font WhiteRabbit:size=13}${goto 165}TEMP${alignr 3}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 165}WIND${alignr 6}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}HUM${alignr 6}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}PRESS${alignr 3}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CLOUD COVER${alignr 3}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}UV INDEX${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}DEW POINT${alignr 6}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CEILING${alignr 3}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}VISIB.${alignr 3}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNRISE${alignr 6}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNSET${alignr 6}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}


${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 255}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}

${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 20,477 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 135,477 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 255,477 -s 80x67}




${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 255}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}

${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/22.png -p 20,573 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 135,573 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 255,573 -s 80x67}




${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 140}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 255}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/last_days}

${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/N12.png -p 20,667 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N17.png -p 135,667 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N22.png -p 255,667 -s 80x67}


conky_system
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 525
maximum_width 250
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit


## Set the path to your script here.
lua_load /home/luke/Conky/allcombined.lua

## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left

#${lua draw_bg {10,0,0,0,0,0x000000,0.5}}

TEXT
${lua tex_bg {20,0,0,260,970,"/home/luke/Conky/brushed.png"}}${lua draw_bg {20,1,1,258,970,0x000000,1,2,1}}${font OpenLogos:size=43} tJ^Jt${font}
${voffset 4}${font Sans:size=10}CPU Average ${lua gradbar {100,67,"${cpu cpu0}",100,33,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu0}%       
#${font Sans:normal:size=10}${color1}k${voffset -1}${font}${color2} TEMP ${hwmon 1 temp 1}°C${lua gradbar {90,127,"${hwmon 1 temp 1}",100,50,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}
${font Sans:size=10}${voffset 1}CPU1 ${lua gradbar {50,82,"${cpu cpu1}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu1}%       
${font Sans:size=10}CPU2 ${lua gradbar {50,97,"${cpu cpu2}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu2}%       
${font Sans:size=10}CPU3 ${lua gradbar {50,112,"${cpu cpu3}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu3}%       
${font Sans:size=10}CPU4 ${lua gradbar {50,127,"${cpu cpu4}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu4}%       
${hr 2}
${font Sans:size=10}${voffset 10}RAM${goto 90}${mem}${goto 140} / ${memmax}
${lua gradbar {5,182,"${memperc}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${memperc}%
${font Sans:size=10}SWAP${goto 90}${swap}${goto 140} / ${swapmax}
${lua gradbar {5,213,"${swapperc}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${swapperc}%
${hr 2}
${font Sans:size=10}${voffset 10}/Root${goto 90}${fs_used /}${goto 140} / ${fs_size /}
${lua gradbar {5,267,"${fs_used_perc /}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /}%
${font Sans:size=10}/Home${goto 90}${fs_used  /home}${goto 140} / ${fs_size  /home}
${lua gradbar {5,298,"${fs_used_perc /home}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc  /home}%
${font Sans:size=10}External${goto 90}${fs_used /media/External}${goto 140} / ${fs_size /media/External}
${lua gradbar {5,328,"${fs_used_perc /media/External}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/External}%
${font Sans:size=10}Software${goto 90}${fs_used /media/sdd5}${goto 140} / ${fs_size /media/sdd5}
${lua gradbar {5,358,"${fs_used_perc /media/sdd5}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sdd5}%
${font Sans:size=10}Music${goto 90}${fs_used /media/sda5}${goto 140} / ${fs_size /media/sda5}
${lua gradbar {5,388,"${fs_used_perc /media/sda5}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sda5}%
${font Sans:size=10}Videos${goto 90}${fs_used /media/sdd1}${goto 140} / ${fs_size /media/sdd1}
${lua gradbar {5,418,"${fs_used_perc /media/sdd1}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sdd1}%
${font Sans:size=10}Storage${goto 90}${fs_used /media/storage}${goto 140} / ${fs_size /media/storage}
${lua gradbar {5,448,"${fs_used_perc /media/storage}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/storage}%
${hr 2}

${font Sans:size=10}CPU Temp
${lua gradbar {5,507,"${platform f71882fg.656 temp 1}",190,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${platform f71882fg.656 temp 1}° F
${font Sans:size=10}System Temp
${lua gradbar {5,536,"${platform f71882fg.656 temp 2}",220,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${platform f71882fg.656 temp 2}° F
${font Sans:size=10}GPU Temp
${lua gradbar {5,566,"${nvidia temp}",220,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${nvidia temp}° F
${hr 2}
NAME ${alignr 5} PID    CPU  MEM
${top name 1} ${alignr 5} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${alignr 5} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${alignr 5} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${alignr 5} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${alignr 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${top name 6} ${alignr 5} ${top pid 6} ${top cpu 6} ${top mem 6}
${top name 7} ${alignr 5} ${top pid 7} ${top cpu 7} ${top mem 7}
${top name 8} ${alignr 5} ${top pid 8} ${top cpu 8} ${top mem 8}
${hr 2}   
#${voffset 10}${goto 50}${font Sans:size=22}${time %I:%M %p}
#${lua luacal {100,425,"Sans",10,0x00FF00,1,"Sans",10,0xFFFFF0,1,"Mono",14,0x00FF00,1," ",20,18,16,0}}
#${goto 15}${font Sans:bold:size=12}${time %d}${font}
#${goto 15}${time %B}
#${goto 15}${time %Y}
#${voffset 40}${hr 2}
#${voffset 10}${font Sans:size=10}Connection Type ${goto 220}${gw_iface}
#I.P${goto 173}${addr eth0}
${voffset 8}Down Speed${goto 100}${downspeed eth0} ${goto 175}${voffset -8}${color yellow}${downspeedgraph eth0 20,75}${color}
${voffset 8}Up Speed${goto 100}${upspeed eth0} ${goto 175}${voffset -8}${color yellow}${upspeedgraph eth0 20,75}${color}
Downloads
Today:${alignr 10}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $2 $3}'}
Week:${alignr 5}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $3 $4}'}
Month:${alignr 10}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}

Uploads
Today: ${alignr 10}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}
Week: ${alignr 5}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $6 $7}'}
Month: ${alignr 10}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}
${voffset 5}


allcombined.lua (by mrpeachy) edited so that draw_bg outlines the config
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end

function conky_gradbar(bartab)
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)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_draw_bg(bgtab)
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)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
local draw=bgtab[8]
local lwidth=bgtab[9]
local olcolor=bgtab[10]
local olalpha=bgtab[11]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_fill (cr)
elseif draw==2 then
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({olcolor,olalpha}))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luacal(caltab)
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)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end     
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]="  "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]="  "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luaimage(imtab)
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)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function

function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
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)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function


s11_clock.lua (by mrpeachy and Sector11)
--[[ 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)
26 Nov 2012 - The Clock - Sector11 (small version)

use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT

-- INDEX
-- ### CLOCK POSITION - AND DEFAULTS ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
--     See lines 39 to 41 for overall size changes
-- ### START DIAL B ### Day Names Dial ###
--     See Lines 84 - 87 and 131 for changes
-- ### START DIAL C ### Month Names Dial ###
--     See Lines 150 -153 and 198 for changes
-- ### START DIAL D ### Day Numbers Dial ###
--     See Lines 234 & 265 for  changes
-- ### START CLOCK A ###
--     See Lines  &  and 441 & 467 changes
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP

NOTE:  Putting ### CLOCK A ### last insures that it's functions are written
       over the other dials.
]]

require 'cairo'
-- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=178,
center_y=160,
radius=140,
lang="English", -- English French Greek Spanish
hour=12, -- 12 | 24
second=false, --true | false - Seconds: dots and numbers IF 12HR
line=false, -- true | false - Part Second Hand
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}

-- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
  return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
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)

-- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
-- ############################ CLOCK 12|24 HR SELECTOR ###

-- ### 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=0
-- #################### SET BORDER OPTIONS FOR "CLOCKS" ###

-- ### START DIAL B ### Day Names Dial ####################
-- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=22
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end

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
    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
else
  for i=1,7 do -- working out points
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,0) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active day names
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    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=7
  for i=1,7 do
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,0) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active
    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 ### Month Names Dial ##################
-- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=53
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- 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
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end

local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
  for i=1,12 do
-- OUTER POINTS POSTION FOR -- ### START DIAL D ## 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
    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
else
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,0) -- active month colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active month names
    end
-- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    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=38
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- dots for non-active month names
    end
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
-- ######################################### END DIAL C ###

-- ### START DIAL D ### 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
local center_y=init.center_y
local radius=85
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
  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 and math.mod(this_day, 2)==0 then
    text=string.format("%02d",i) --formats numbers to double digits
    elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
    text=string.format("%02d",i) --formats numbers to double digits
    else
    text=""
    end --odd even matching
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim inactive numbers
end
     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=70
  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))
if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim the points
end
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
-- ######################################### END DIAL D ###

-- ### START CLOCK A ######################################
-- 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 -- doesn't work but can't delete
-- set mark width
local m_width_A=0 -- doesn't work but can't delete
-- 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,0 -- opaque white -- doesn't work but can't delete
-- SETUP HOUR HANDS ###
-- CLOCK A HOUR HAND
hh_length_A=95
-- set hour hand width
hh_width_A=6
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
-- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
-- SETUP MINUTE HANDS ###
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=115
-- set minute hand width
mh_width_A=6
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work

-- SETUP SECOND HAND ###
-- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
-- set length of seconds hand -- yes I know it is commented out!
--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

-- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
  local arc=(math.pi/180)*((360/60)*seconds)
  --calculate point 1
  local radius1=100
  local x1=0+radius1*math.sin(arc)
  local y1=0-radius1*math.cos(arc)
  --calculate point 2
  local radius2=107
  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,0) -- PART SECOND HAND
  cairo_stroke (cr)
end

-- CLOCK A ### 12 HR TIME ###
-- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
-- DRAWING CODE
-- 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 -- WHAT IS THIS??
-- 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,1,1,1,1) -- active colour Hour Hand ================
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,1,1,1,1) -- active colour Minute Hand ==============
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
-- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 25)
cairo_set_source_rgba (cr,1,1,1,1) -- HR Clock numbers
-- TABLE OF TEXT -- in order
if init.hour == 12 then
  text_days={"12","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
    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_set_source_rgba (cr,1,1,1,1)
    cairo_stroke (cr)
  end
-- INNER POINTS POSITION, radius smaller than text circle
  local radius=111 -- 12 HR Clock
  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_set_source_rgba (cr,1,1,1,0)
    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
    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=99 -- 24 HR Clock
  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_set_source_rgba (cr,1,1,1,0)
    cairo_stroke (cr)
  end
end

-- ############################################################################
-- POSITION FOR TEXT HOUR NUMBERS
  if init.hour == 12 and init.second == true then
    text_days={"","01","02","03","04","","06","07","08","09","","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,.5) -- does not work -- settings moved
    cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    for i=1,60 do
      local radius=99 -- dots for seconds A Clock
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
      if seconds == i-1 then
        cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- does not work - settings moved
      else
        if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
          cairo_set_source_rgba (cr,1,1,1,0) -- active colour
        else
          cairo_set_source_rgba (cr,1,1,1,0) -- dots for seconds A Clock
        end
      end
      cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
      cairo_stroke (cr)
    end
    radius=radius-3
    cairo_set_font_size (cr, 9)
    for i=1,60 do
-- OUTTER POINTS POSTION FOR TEXT
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
      local text=text_days[i]--gets text from table
      if seconds == tonumber(text) then
      cairo_set_source_rgba (cr,1,1,1,0) -- active colour
      else
        cairo_set_source_rgba (cr,1,1,1,0) -- seconds numbers
      end
      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
-- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function


The weather script is by TeoBigusGeekus and you can get the full script along with the edited images by me here

The wallpaper can be found here and the conky background image by jst_joe (but resized) can be found here
Don't Be A Dick!

Sector11

@ lwfitz,  my wife just smacked me for looking that it!

She said I was not looking at the conky.   :D
Nice one though, all spiced up like that ... not like the plain jane conky I'm about to post.
Stay Home