Code: Select all
conky.config = {
alignment = 'top_right',
background = false,
cpu_avg_samples = 2,
top_cpu_separate = false,
default_color = '#FFFFFF',
draw_borders = true,
border_width = 1,
border_inner_margin = 3,
use_xft = true,
font = 'DejaVu Sans Mono:bold:size=11',
gap_x = 10,
gap_y = 10,
net_avg_samples = 2,
no_buffers = true,
double_buffer = true,
imlib_cache_size = 0,
out_to_console = false,
out_to_stderr = false,
extra_newline = false,
own_window = true,
minimum_width = 333,
own_window_type = 'normal',
own_window_hints = 'undecorated,below,sticky,skip_taskbar',
own_window_class = 'Conky',
own_window_transparent = true,
override_utf8_locale = true,
stippled_borders = 0,
update_interval = 30,
uppercase = false,
use_spacer = 'none',
hddtemp_host,
hddtemp_port,
hddtemp_refresh,
temperature_unit = celsius
--[[ lua_load = '~/.config/conky/clockexp.lua',
lua_draw_hook_pre = 'draw_clock' ]]
}
conky.text = [[
$alignc${font DejaVu Sans Mono:bold:size=12}${color green}$sysname $kernel $Distribution Sid
$font${color green}$alignc Uptime:$uptime # ${image /home/sade/Pictures/splasht.png -p 7,36 -n}
# ${image /home/sade/Downloads/Tux2_sm2.png -p 0,576 -n}
# ${image /home/sade/Downloads/Tux2_sm1.png -p 261,576 -n}
${alignc}${color}CPU composite:${cpu cpu0}%
${color}Core1:$color${cpu cpu1}% $alignr Temp:${hwmon 1 temp 2}°C
Core2:$color${cpu cpu2}% $alignr Temp:${hwmon 1 temp 3}°C
Core3:$color${cpu cpu3}% $alignr Temp:${hwmon 1 temp 4}°C
Core4:$color${cpu cpu4}% $alignr Temp:${hwmon 1 temp 5}°C
Fan:${hwmon 2 fan 1}rpm ${alignr}Freq:${freq}mhz
${hr 1}
$font$color RAM: $mem $memwithbuffers $memperc% of $memmax
Swap:$alignc$swap $swapperc%
${hr 1}
$alignc HDD Temp:$color${hddtemp /dev/sda}°C
Root:$alignc${fs_used /} ${fs_used_perc /}% of ${fs_size /}
Home:$alignc${fs_used /home} ${fs_used_perc /home}% of ${fs_size /home}
LMDE:$alignc ${fs_used /data} ${fs_used_perc /data}% of ${fs_size /data}
Data:$alignc${fs_used /data1} ${fs_used_perc /data1}% of ${fs_size /data1}
${hr 1}
Top Process ${alignc}CPU ${alignr}Memory
${top name 1} $alignc${top cpu 1}% $alignr${top mem 1}%
${top name 2} $alignc${top cpu 2}% $alignr${top mem 2}%
${top name 3} $alignc${top cpu 3}% $alignr${top mem 3}%
${top name 4} $alignc${top cpu 4}% $alignr${top mem 4}%
${top name 5} $alignc${top cpu 5}% $alignr${top mem 5}%
${hr 1}
# $alignc$font${color}${execpi 50 python ~/.config/conky/conkycal.py}
${alignc}${color green}Battery $alignc${battery BAT0}]]
clockexp.lua (combined Mr. Peachy's clock with Alison Pitt's glassy border)
Code: Select all
--[[drawing a clock
in conkyrc
lua_load /path/clock.lua
lua_draw_hook_pre main
TEXT
]]
require 'cairo'
function conky_draw_clock()
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)
--#########################################################################################################
--CLOCK SETTINGS
clock_radius=53
clock_centerx=171
clock_centery=200
--set border options
clock_border_width=12
--set color and alpha for clock border
cbr,cbg,cbb,cba=0,0.7,0,0.2--full opaque white
shadow_width=3
shadow_xoffset=0
shadow_yoffset=0
--gap from clock border to hour marks
b_to_m=12
--set mark length
m_length=6
--set mark line width
m_width=3
--set mark line cap type
m_cap=CAIRO_LINE_CAP_ROUND
--set mark color and alpha,red blue green alpha
mr,mg,mb,ma=0,1,0,1--opaque white
--seconds hand setup
--show_seconds=false
--set length of seconds hand
--sh_length=40
--set hand width
--sh_width=1.5
--set hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
--set seconds hand color
--shr,shg,shb,sha=1,0.8,0.8,1--fully opaque orange
--minues hand setup
--set length of minutes hand
mh_length=35
--set hand width
mh_width=3
--set hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
--set minute hand color
mhr,mhg,mhb,mha=0,1,0,1--fully opaque white
--hour hand setup
--set length of hour hand
hh_length=26
--set hand width
hh_width=5
--set hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
--set hour hand color
hhr,hhg,hhb,hha=0,1,0,1--fully opaque white
--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)
local border_pat=cairo_pattern_create_linear(clock_centerx,clock_centery-clock_radius,clock_centerx,clock_centery+clock_radius)
cairo_pattern_add_color_stop_rgba(border_pat,0,1,1,1,0.7)
cairo_pattern_add_color_stop_rgba(border_pat,0.3,1,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,0.5,1,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,0.7,1,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,1,1,1,1,0.7)
cairo_set_source(cr,border_pat)
cairo_arc(cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_close_path(cr)
cairo_set_line_width(cr,clock_radius*0.25)
cairo_stroke(cr)
--draw shadow
local ds_pat=cairo_pattern_create_radial(clock_centerx+shadow_xoffset,clock_centery+shadow_yoffset,clock_radius,clock_centerx+shadow_xoffset,clock_centery+shadow_yoffset,clock_radius+shadow_width)
cairo_pattern_add_color_stop_rgba(ds_pat,0,0,0,0,0.2)
cairo_pattern_add_color_stop_rgba(ds_pat,1,0,0,0,0)
--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
--set line cap type
cairo_set_line_cap (cr, m_cap)
--set line width
cairo_set_line_width (cr,m_width)
--set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
--start for loop
for i=1,12 do
--drawing code uisng the value of i to calculate degrees
--calculate start point for 12 oclock mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*30)
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 oclock mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*30)
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
--time calculations###########################
hours=tonumber(os.date("%I"))--12 hour clock
--convert hours to seconds
h_to_s=hours*60*60
minutes=tonumber(os.date("%M"))
--convert minutes to seconds
m_to_s=minutes*60
--get current seconds
seconds=tonumber(os.date("%S"))
--draw hours hand ############################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*12))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw seconds hand #############################
--calculate degrees for the hand each second
sec_degs=seconds*6
--set radius we will use to calculate hand points
radius=sh_length
--set our starting 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))
--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)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap (cr, sh_cap)
cairo_stroke (cr)
--#########################################################################################################
cairo_pattern_destroy(pat)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
Anyway, the clock and calendar have already been commented out so that part shouldn't figure in..
Btw, Sunday is not highlighted, that's the color i have chosen for it, as i have chosen different colors for the days of the week.