My desktop and conky:
https://dl.dropbox.com/s/qh101pz5en31c8o/a1.png
https://dl.dropbox.com/s/mujyqx5es2fgprt/myconky.png
Special thanks to londonali1010 and olgmen.
conkyrc
Code:
# system
background yes
use_xft yes
xftfont Sans:size=7
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1280 150
maximum_width 1280
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
#border_margin 2
window.border_inner_margin 2
border_width 1
default_color white
default_shade_color black
default_outline_color black
alignment bottom_left
gap_x 10
gap_y -440
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer none
show_graph_scale no
show_graph_range no
text_buffer_size 4096
#imlib_cache_size 0
color1 FFFFFF
color2 666666 #008EE8 világoskék, 0B3D58 sötétkék
color3 888888
# color2 0B3D58
##
# stuff after 'TEXT' will be formatted on screen
##
lua_load /home/robiwolf/.conky/lua/rings.lua /home/robiwolf/.conky/lua/bg.lua
lua_draw_hook_post ring_stats
lua_draw_hook_pre draw_content
TEXT
${offset 95}${voffset 42}${font URW Bookman L :size=20}${time %H}
${voffset -42}${goto 135}${font URW Bookman L :size=10}${time %M}
${voffset -8}${goto 137}${font URW Bookman L :size=8}${time %S}
${voffset -70}${goto 447}${color1}${font PizzaDude Bullets:size=8}U${font} Letöltés: ${color3}${downspeed eth0}
${goto 447}${color2}${downspeedgraph eth0 20,120}
${goto 447}${color1}${font PizzaDude Bullets:size=8}T${font} Összes: ${color3}${totaldown eth0}${goto 145}
${goto 447}${color1}${font PizzaDude Bullets:size=8}O${font} Feltöltés: ${color3}${upspeed eth0}
${goto 447}${color2}${upspeedgraph eth0 20,120}
${goto 447}${color1}${font PizzaDude Bullets:size=8}N${font} Összes: ${color3}${totalup eth0}
${execpi 1800 conkyForecast --location=HUXX0034 --template=/usr/share/conkyforecast/example/conkyForecast.template}
conky forecast template:
Code:
${voffset -110}${goto 597}${color1}${font ConkyWeather:style=Bold:size=48}[--datatype=WF]${font}
${voffset -68}${goto 701}${color1}${font Weather:size=48}x${font}
${voffset -60}${goto 717}${font Brave New Era (narrow) G98:size=40} [--datatype=HT]${font}
${voffset -46}${goto 797}${color1}${font ConkyWind:size=48}[--datatype=BS]${font}
${voffset 8}${goto 597}${voffset 10}${color1}Napkelte: ${color3}[--datatype=SR]
${goto 597}${color1}Napnyugta: ${color3}[--datatype=SS]
${goto 597}${color1}Páratartalom: ${color3}[--datatype=HM]
${voffset -38}${goto 763}${color1}Szél: ${color3}[--datatype=WS]
${goto 763}${color1}Harmatpont: ${color3}[--datatype=DP]
${goto 763}${color1}Nyomás: ${color3}[--datatype=BR]
${goto 887}${voffset -100}${color1}${font ConkyWeather:size=42}[--datatype=WF --startday=1 --endday=4 --spaces=2]${font}
${goto 902}${voffset 10}[--datatype=HT --startday=1 --hideunits --centeredwidth=3]/[--datatype=LT --startday=1 --hideunits --centeredwidth=3]${goto 984}[--datatype=HT --startday=2 --hideunits --centeredwidth=3]/[--datatype=LT --startday=2 --hideunits --centeredwidth=3]${goto 1067}[--datatype=HT --startday=3 --hideunits --centeredwidth=3]/[--datatype=LT --startday=3 --hideunits --centeredwidth=3]${goto 1150}[--datatype=HT --startday=4 --hideunits --centeredwidth=3]/[--datatype=LT --startday=4 --hideunits --centeredwidth=3]
${voffset 10}${color1}${font Bitstream Vera Sans Mono:size=7}${goto 932}Utolsó frissítés: ${color3}[--datatype=LU]${font}
bg.lua:
Code:
--[[ backgraund.lua от olgmen 16.11.2010
Выводит в окно conky фон с градиентной окраской
Для запуска скрипта поместите следующие строки в conkyrc выше слова TEXT
Displays the window conky background with gradient color
To run the script put the following lines to the above words conkyrc
lua_load /path/to/the/lua/script/backgraund.lua
lua_draw_hook_pre draw_content
]]
require 'cairo'
function conky_draw_content()
backgraund_settings={
{ -- top
x = 60,
y = 0,
height = 130,
width = 367,
orientation = "ne",
bg_colour = {{0, 0x000000, 0.6},{0.5, 0x000000, 0.6},{1, 0x000000, 0.6}},
},
{ -- middle
x = 437,
y = 0,
height = 130,
width = 140,
orientation = "ww",
bg_colour = {{0, 0x000000, 0.6},{0.5, 0x000000, 0.6},{1, 0x000000, 0.6}},
},
{ -- bottom
x = 587,
y = 0,
height = 130,
width = 280,
orientation = "nn",
bg_colour = {{0, 0x000000, 0.6},{0.5, 0x000000, 0.6},{1, 0x000000, 0.6}},
},
{ -- bottom
x = 877,
y = 0,
height = 130,
width = 326,
orientation = "ss",
bg_colour = {{0, 0x000000, 0.6},{0.5, 0x000000, 0.6},{1, 0x000000, 0.6}},
},
}
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)
for i,v in pairs(backgraund_settings) do
display_background(v)
end
cairo_destroy(cr)
end
-- ---------------------------------------
function display_background(t)
if t.x == nil then t.x = 0 end
if t.y == nil then t.y = 0 end
if t.width == nil then t.width = conky_window.width end
if t.height == nil then t.height = conky_window.height end
if t.radius == nil then t.radius = (t.width+t.height)/2*0.04 end
if t.orientation == nil then t.orientation = "ww" end
if t.bg_colour == nil then
t.bg_colour = {{0, 0x000000, 0.3},{1, 0x000000, 0.3}}
end
local degrees = math.pi / 180.0
cairo_new_sub_path (cr)
cairo_arc (cr, t.x + t.width - t.radius, t.y + t.radius, t.radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, t.x + t.width - t.radius, t.y + t.height - t.radius, t.radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, t.x + t.radius, t.y + t.height - t.radius, t.radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, t.x + t.radius, t.y + t.radius, t.radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
-- линейная градация
if #t.bg_colour == 1 then
cairo_set_source_rgba(cr,rgb_to_r_g_b2(t.bg_colour[1]))
else
local pat
local pts=linear_orientation_bg(t)
pat = cairo_pattern_create_linear (pts[1], pts[2], pts[3], pts[4])
for i=1, #t.bg_colour do
cairo_pattern_add_color_stop_rgba (pat, t.bg_colour[i][1], rgb_to_r_g_b2(t.bg_colour[i]))
end
cairo_set_source (cr, pat)
cairo_fill (cr)
cairo_pattern_destroy(pat)
end
end
-- ---------------------------------------
function rgb_to_r_g_b2(tcolour)
colour, alpha = tcolour[2], tcolour[3]
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-- ----------------------------------------
function linear_orientation_bg(t)
if t.orientation == "nn" then
p = {t.x + t.width/2, t.y, t.x + t.width/2, t.y + t.height}
elseif t.orientation == "ne" then
p = {t.x + t.width, t.y, t.x, t.y + t.height}
elseif t.orientation == "ee" then
p = {t.x + t.width, t.y + t.height/2, t.x, t.y + t.height/2}
elseif t.orientation == "se" then
p = {t.x +t.width, t.y + t.height, t.x, t.y}
elseif t.orientation == "ss" then
p = {t.x + t.width/2, t.y + t.height, t.x + t.width/2, t.y}
elseif t.orientation == "sw" then
p = {t.x, t.y + t.height, t.x + t.width, t.y}
elseif t.orientation == "ww" then
p = {t.x, t.y + t.height/2, t.x + t.width, t.y + t.height/2}
else
p = {t.x, t.y, t.x + t.width, t.y + t.height}
end
return p
end
rings.lua:
Code:
--[[
Ring Meters by londonali1010 (2009)
This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/rings-v1.2.1.lua
lua_draw_hook_pre ring_stats
Changelog:
+ v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]
settings_table = {
{
name='time',
arg='%I',
max=12,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=1.0,
x=125, y=65,
radius=43,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%M.%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.8,
x=125, y=65,
radius=49,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=125, y=65,
radius=55,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='cpu',
arg='cpu0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=245, y=65,
radius=44,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=334, y=36,
radius=24,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='swapperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=393, y=36,
radius=24,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=334, y=95,
radius=24,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='fs_used_perc',
arg='/home',
max=100,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=393, y=95,
radius=24,
thickness=5,
start_angle=0,
end_angle=360
},
}
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function draw_ring(cr,t,pt)
local w,h=conky_window.width,conky_window.height
local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
local angle_0=sa*(2*math.pi/360)-math.pi/2
local angle_f=ea*(2*math.pi/360)-math.pi/2
local t_arc=t*(angle_f-angle_0)
-- Draw background ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end
function conky_ring_stats()
local function setup_rings(cr,pt)
local str=''
local value=0
str=string.format('${%s %s}',pt['name'],pt['arg'])
str=conky_parse(str)
value=tonumber(str)
if value == nil then value = 0 end
pct=value/pt['max']
draw_ring(cr,pct,pt)
end
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=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table[i])
end
end
end
Bookmarks