You are not logged in.

#526 2010-05-07 14:24:11

Perre
Member
Registered: 2008-01-22
Posts: 189

Re: conky configs and screenshots!

drsexbot wrote:

edit:
Perre, i wish i could be more OCD about my comp. i regret putting so much crap on it sometimes but then i do use it a bit. i'm just biding my time till i get a new lappy then i'm storing this one away for media and other storage. maybe testing some things from time to time =P

deep down i want to just set aside some space for this comp, my 360, and a slingbox, so when i get a netbook i'll be able to sit around looking smug.

I actualle ended up re-installing bauerbill and removing clyde. OCD, yes please... or maybe a bit too much. roll
Space for some gadgets is important. I've got my computer (with xbmc) hooked up to a surround system and a plasma TV and next to that, a PS3. I'm smug'ing a lot. tongue

Offline

#527 2010-05-21 10:41:26

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

A slimmed down tint2 and conky to maximize screen space....

V1tfqs.jpg

zgR0Os.jpg

amTn6s.jpg

conky

# -- Conky settings -- #
#background no
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 2048
imlib_cache_size 0
 
# -- Window specifications -- #
 
own_window yes
own_window_transparent yes
own_window_type desktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 1d1d1d

#colors
#good blue 1994d1
#medium blue 083146
#dark blue 041e2c
#lime 86c113
color1 202020
color2 86c113
color3 1994d1
color4 aa0000
color5 1d1d1d
color6 cccccc

border_inner_margin 1
border_outer_margin 0
 
minimum_size 21 158
maximum_width 22
maximum_height 149
 
alignment bottom_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
 
# -- Text settings -- #
use_xft yes
xftfont DejaVu Sans Mono:size=6.5
xftalpha 0.4
 
uppercase no
 
default_color dddddd
border_width 0
 
# -- Lua Load -- #
lua_load ~/.conky/lua.lua
lua_draw_hook_pre ring_stats
 
TEXT
${voffset 88}${goto 3}D${goto 10}U${execpi 30 cat ~/mybin/pacman-status}u${color}
${voffset 20}${goto 3}MEM
${voffset 20}${goto 2}CPU
${font Digital Readout Thick Upright:size=12}${voffset 0}${alignc}${execpi 25 cat ~/mybin/gmail-chris} ${execpi 20 cat ~/mybin/gmail-tawan}${font}${color}
${voffset -1}${if_match ${battery_percent BAT0} >= 98}${color5}${else}${if_existing /sys/class/power_supply/ACAD/online 0}${color2}${else}${color1}${endif}${endif}${goto 4}${battery_bar 4,16 BAT0}${if_existing /sys/class/power_supply/ACAD/online 0}${if_match ${battery_percent BAT0} <= 8}${execi 200 ~/mybin/tawan-lowpower-shutdown}${endif}${endif}

lua

--[[
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)
]]
conky_background_color = 0x151515
conky_background_alpha = 0

ring_background_color = 0xffffff
ring_background_alpha = 0.2
ring_foreground_color = 0x86c113
ring_foreground_color2 = 0x1994d1
ring_foreground_color3 = 0xaa0000
ring_foreground_alpha = 1
 
settings_table = {
--    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
--        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
--        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
--        max=12,
        -- "bg_colour" is the colour of the base ring.
--        bg_colour=ring_background_color,
        -- "bg_alpha" is the alpha value of the base ring.
--        bg_alpha=ring_background_alpha,
        -- "fg_colour" is the colour of the indicator part of the ring.
--        fg_colour=ring_foreground_color,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
--        fg_alpha=ring_foreground_alpha,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
--        x=26, y=25,
        -- "radius" is the radius of the ring.
--        radius=10,
        -- "thickness" is the thickness of the ring, centred around the radius.
--        thickness=6,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
--        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle.
--        end_angle=360
--    },
    {
        name='upspeedf',
        arg='wlan0',
        max=512,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=90,
        radius=11,
        thickness=5,
        start_angle=-90,
        end_angle=0
    },
    {
        name='downspeedf',
        arg='wlan0',
        max=2048,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=90,
        radius=17,
        thickness=5,
        start_angle=-90,
        end_angle=0
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=122,
        radius=17,
        thickness=5,
        start_angle=-90,
        end_angle=0
    },
    {
        name='fs_used_perc',
        arg='/home/tawan/Data',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=122,
        radius=11,
        thickness=4,
        start_angle=-90,
        end_angle=0
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=122,
        radius=6,
        thickness=3,
        start_angle=-90,
        end_angle=0
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=154,
        radius=17,
        thickness=4,
        start_angle=-90,
        end_angle=0
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=154,
        radius=9,
        thickness=4,
        start_angle=-90,
        end_angle=0
    },
    {
        name='acpitemp',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color3,
        fg_alpha=ring_foreground_alpha,
        x=23, y=154,
        radius=13,
        thickness=2,
        start_angle=-90,
        end_angle=0
    }
}
 
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 conky_round_rect(cr, x0, y0, w, h, r)
    if (w == 0) or (h == 0) then return end
    local x1 = x0 + w
    local y1 = y0 + h
    if w/2 < r then
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    else
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    end
    cairo_close_path (cr)
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
 
cs, cr = nil -- initialize our cairo surface and context to nil
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)

    if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
        if cs then cairo_surface_destroy(cs) end
        cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    end
    if cr then cairo_destroy(cr) end
    cr = cairo_create(cs)

 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        conky_round_rect(cr, 3, 0, conky_window.width-6, conky_window.height-3, 15)
        cairo_set_source_rgba(cr, rgb_to_r_g_b(conky_background_color, conky_background_alpha))
        cairo_fill(cr)
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    cairo_destroy(cr)
    cr = nil
end

function conky_cairo_cleanup()
    cairo_surface_destroy(cs)
    cs = nil
end

tint2

#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------

#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
rounded = 0
border_width = 0
background_color = #1d1d1d 0
border_color = #1d1d1d 0

rounded = 10
border_width = 0
background_color = #727272 8
border_color = #ffffff 6

rounded = 10
border_width = 0
background_color = #727272 72
border_color = #ffffff 50

#---------------------------------------------
# PANEL
#---------------------------------------------
panel_monitor = all
panel_position = top left vertical
panel_size = 80% 24
panel_margin = 0 0
panel_padding = 0 0 0
font_shadow = 1
panel_background_id = 1
wm_menu = 1

#---------------------------------------------
# TASKBAR
#---------------------------------------------
taskbar_mode = multi_desktop
#taskbar_mode = single_desktop
taskbar_padding = 0 0 0
taskbar_background_id = 1
taskbar_active_background_id = 2

#---------------------------------------------
# TASKS
#---------------------------------------------
task_icon = 1
task_text = 0
task_maximum_size = 20 20
task_centered = 1
task_padding = 4 1
task_font = sans 7
task_font_color = #ffffff 70
task_active_font_color = #000000 100
task_background_id = 0
task_active_background_id = 3

#---------------------------------------------
# SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 4 4 5
systray_background_id = 1
systray_sort = left2right
systray_icon_size = 12
systray_icon_asb = 100 0 0

#---------------------------------------------
# CLOCK
#---------------------------------------------
time1_format = %H
time1_font = sans bold 8
time2_format = %M
time2_font = sans bold 8
clock_font_color = #ffffff 76
clock_padding = 4 2
clock_background_id = 1
#clock_lclick_command = xclock
clock_rclick_command = zenity --calendar

#---------------------------------------------
# BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0

#---------------------------------------------
# TOOLTIP
#---------------------------------------------
tooltip = 1
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #ffffff 80
tooltip_font = sans 10

#---------------------------------------------
# MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

Last edited by tawan (2010-05-24 09:00:38)

Offline

#528 2010-05-27 09:40:06

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

As above but improved tint2 clock (and calendar function) plus visual and user changes to conky

vVcOxl.jpg

tint2

#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------

#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
rounded = 0
border_width = 0
background_color = #1d1d1d 0
border_color = #1d1d1d 0

rounded = 10
border_width = 0
background_color = #727272 8
border_color = #ffffff 6

rounded = 10
border_width = 0
background_color = #727272 72
border_color = #ffffff 50

#---------------------------------------------
# PANEL
#---------------------------------------------
panel_monitor = all
panel_position = top left vertical
panel_size = 84% 24
panel_margin = 0 0
panel_padding = 0 0 0
font_shadow = 1
panel_background_id = 1
wm_menu = 1

#---------------------------------------------
# TASKBAR
#---------------------------------------------
taskbar_mode = multi_desktop
#taskbar_mode = single_desktop
taskbar_padding = 0 0 0
taskbar_background_id = 1
taskbar_active_background_id = 2

#---------------------------------------------
# TASKS
#---------------------------------------------
task_icon = 1
task_text = 0
task_maximum_size = 20 20
task_centered = 1
task_padding = 4 1
task_font = sans 7
task_font_color = #ffffff 70
task_active_font_color = #000000 100
task_background_id = 0
task_active_background_id = 3

#---------------------------------------------
# SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 4 4 5
systray_background_id = 1
systray_sort = left2right
systray_icon_size = 12
systray_icon_asb = 100 0 0

#---------------------------------------------
# CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = Digital Readout Thick Upright Bold 8
time2_format = %a
time2_font = Sans Upright 7
clock_font_color = #727272 100
clock_padding = 4 2
clock_background_id = 1
clock_lclick_command = zenity --calendar
clock_rclick_command = zenity --calendar

#---------------------------------------------
# BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0

#---------------------------------------------
# TOOLTIP
#---------------------------------------------
tooltip = 1
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #ffffff 80
tooltip_font = sans 10

#---------------------------------------------
# MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

conky

# -- Conky settings -- #
#background no
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 2048
imlib_cache_size 0
 
# -- Window specifications -- #
 
own_window yes
own_window_transparent yes
own_window_type desktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 1d1d1d

#colors
#good blue 1994d1
#medium blue 083146
#dark blue 041e2c
#lime 86c113
color1 202020
color2 86c113
color3 1994d1
color4 aa0000
color5 1d1d1d
color6 cccccc

border_inner_margin 1
border_outer_margin 0
 
minimum_size 21 110
maximum_width 22
maximum_height 112
 
alignment bottom_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
 
# -- Text settings -- #
use_xft yes
xftfont DejaVu Sans Mono:size=6.5
xftalpha 0.4
 
uppercase no
 
default_color 727272
border_width 0
 
# -- Lua Load -- #
lua_load ~/.conky/lua.lua
lua_draw_hook_pre ring_stats
 
TEXT
${voffset 70}${goto 4}${font Digital Readout Thick Upright:size=12}${voffset 0}${alignc}${execpi 25 cat ~/mybin/gmail-chris} ${goto 14}${execpi 20 cat ~/mybin/gmail-tawan}${font}${color}
${voffset 18}${goto 3}D${goto 10}U${execpi 30 cat ~/mybin/pacman-status}${font DejaVu Sans Bold:size=7}^${font}${color}
${voffset 20}${goto 3}MEM
${voffset 20}${goto 2}CPU
${voffset -1}${if_match ${battery_percent BAT0} >= 98}${color5}${else}${if_existing /sys/class/power_supply/ACAD/online 0}${color2}${else}${color1}${endif}${endif}${goto 4}${battery_bar 4,16 BAT0}${if_existing /sys/class/power_supply/ACAD/online 0}${if_match ${battery_percent BAT0} <= 8}${execi 200 ~/mybin/tawan-lowpower-shutdown}${endif}${endif}

lua

--[[
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)
]]
conky_background_color = 0x151515
conky_background_alpha = 0

ring_background_color = 0xffffff
ring_background_alpha = 0.2
ring_foreground_color = 0x86c113
ring_foreground_color2 = 0x1994d1
ring_foreground_color3 = 0xaa0000
ring_foreground_alpha = 1
 
settings_table = {
--    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
--        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
--        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
--        max=12,
        -- "bg_colour" is the colour of the base ring.
--        bg_colour=ring_background_color,
        -- "bg_alpha" is the alpha value of the base ring.
--        bg_alpha=ring_background_alpha,
        -- "fg_colour" is the colour of the indicator part of the ring.
--        fg_colour=ring_foreground_color,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
--        fg_alpha=ring_foreground_alpha,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
--        x=26, y=25,
        -- "radius" is the radius of the ring.
--        radius=10,
        -- "thickness" is the thickness of the ring, centred around the radius.
--        thickness=6,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
--        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle.
--        end_angle=360
--    },
    {
        name='upspeedf',
        arg='wlan0',
        max=512,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=106,
        radius=11,
        thickness=5,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='downspeedf',
        arg='wlan0',
        max=2048,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=106,
        radius=17,
        thickness=5,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=138,
        radius=17,
        thickness=5,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='fs_used_perc',
        arg='/home/tawan/Data',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=138,
        radius=11,
        thickness=4,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=138,
        radius=6,
        thickness=3,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=170,
        radius=17,
        thickness=4,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=170,
        radius=9,
        thickness=4,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='acpitemp',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color3,
        fg_alpha=ring_foreground_alpha,
        x=23, y=170,
        radius=13,
        thickness=2,
        start_angle=-90,
        end_angle=-20
    }
}
 
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 conky_round_rect(cr, x0, y0, w, h, r)
    if (w == 0) or (h == 0) then return end
    local x1 = x0 + w
    local y1 = y0 + h
    if w/2 < r then
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    else
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    end
    cairo_close_path (cr)
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
 
cs, cr = nil -- initialize our cairo surface and context to nil
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)

    if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
        if cs then cairo_surface_destroy(cs) end
        cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    end
    if cr then cairo_destroy(cr) end
    cr = cairo_create(cs)

 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        conky_round_rect(cr, 3, 0, conky_window.width-6, conky_window.height-3, 15)
        cairo_set_source_rgba(cr, rgb_to_r_g_b(conky_background_color, conky_background_alpha))
        cairo_fill(cr)
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    cairo_destroy(cr)
    cr = nil
end

function conky_cairo_cleanup()
    cairo_surface_destroy(cs)
    cs = nil
end

Offline

#529 2010-05-29 13:53:15

Sia
Member
Registered: 2010-01-17
Posts: 29
Website

Re: conky configs and screenshots!

quhS0.jpg
Conky

own_window yes
own_window_type normal
own_window_transparent no
own_window_class Conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# THIS CONFIG RELIES ON 2 SCRIPTS, CPUSPEED AND CPUTEMP
# YOUR SYSTEM MAY NOT REQUIRE THEM, REPLACE AS DESIRED

# maintain spacing between certain elements
use_spacer yes

# set to yes if you want conky to be forked in the background
background no

use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono-7
#xftfont Andale Mono-9
#xftfont Clean-8
#xftfont cubicfive10:pixelsize=8
#xftfont squaredance10:pixelsize=14
#xftfont swf!t_v02:pixelsize=10

# Text alpha when using Xft
xftalpha 1
mail_spool $MAIL

# Update interval in seconds
update_interval 4.0

# Create own window instead of using desktop (required in nautilus)
own_window no

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
# minimum_size 280 5

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no # amplifies text

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 9

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey90
default_shade_color black
default_outline_color DarkGrey

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 24
gap_y 24

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# stuff after 'TEXT' will be formatted on screen

TEXT
${color #ffcb48}$nodename$color      ${color #D62342}$sysname $kernel on 
$machine$color


${color #ffcb48}PROCESSING$color
   ${color #98c2c7}CPU:$color     ${execi 5 cpuspeed}MHz       $cpu% 
   ${execi 5 cputemp}°C
   ${color #78af78}$cpubar
   ${color #78af78}${cpugraph 78af78 a3a3a3}

   ${color #98c2c7}NAME             PID       CPU%      MEM%
   ${color #e5e5e5}${top name 1} ${top pid 1}   ${top cpu 1}    ${top mem 1}
   ${color #c4c4c4}${top name 2} ${top pid 2}   ${top cpu 2}    ${top mem 2}
   ${color #a3a3a3}${top name 3} ${top pid 3}   ${top cpu 3}    ${top mem 3}
   ${color #828282}${top name 4} ${top pid 4}   ${top cpu 4}    ${top mem 4}

${color #ffcb48}DATA$color
   ${color #98c2c7}RAM:$color     $memperc%         ${color 
#78af78}${membar 6}${color}

   ${color #98c2c7}NAME             PID       CPU%      MEM%
   ${color #e5e5e5}${top_mem name 1} ${top_mem pid 1}   ${top_mem cpu 1} 
    ${top_mem mem 1}
   ${color #c4c4c4}${top_mem name 2} ${top_mem pid 2}   ${top_mem cpu 2} 
    ${top_mem mem 2}
   ${color #a3a3a3}${top_mem name 3} ${top_mem pid 3}   ${top_mem cpu 3} 
    ${top_mem mem 3}
   ${color #828282}${top_mem name 4} ${top_mem pid 4}   ${top_mem cpu 4} 
    ${top_mem mem 4}

   ${color #98c2c7}Swap:$color    $swapperc%         ${color 
#78af78}${swapbar 6}$color
   ${color #98c2c7}/:$color       ${fs_free_perc /}%  $fs_free  ${color 
#78af78}${fs_bar 6 /}$color

   ${color #98c2c7}Upload:$color  ${upspeed eth0}kb/s${color #98c2c7} 
   Download:$color  ${downspeed eth0}kb/s
   
${color #ffcb48}Remote Address$color:${alignr} ${color #49A67D}Local Service/Port:
${color}${tcp_portmon 1 1024 rport 0}
${color}${tcp_portmon 1 65535 rhost 0}${alignr}${tcp_portmon 1 65535 lservice 0}
${color}${tcp_portmon 1 65535 rhost 1}${alignr}${tcp_portmon 1 65535 lservice 1}
${color}${tcp_portmon 1 65535 rhost 2}${alignr}${tcp_portmon 1 65535 lservice 2}
${color}${tcp_portmon 1 65535 rhost 3}${alignr}${tcp_portmon 1 65535 lservice 3}

Last edited by Sia (2010-05-29 13:53:44)

Offline

#530 2010-06-02 10:18:48

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

desktop
tNGg5cA

desktop conky info
tNGg5cw

desktop window and terminal (using fade follow script to automatically send windows at the back to transparent)
tNGg5cg

wallpaper jason-c.deviantart.com/art/Edge-42362298

GTK/Openbox http://gnome-look.org/content/show.php?content=124867

icons gnome-look.org/content/show.php/Any Color You Like?content=102435

pacman sync [run by cron as root once per hour)

#!/bin/bash
pacman -Sy > /dev/null
numberof=$(pacman -Qu | wc -l)
if [ $numberof -ge 9 ]
then
    #red
    mycolour='${color4}'
else
    if [ $numberof -ge 5 ]
    then
        # blue
        mycolour='${color3}'
    else
        if [ $numberof -ge 1 ]
        then
            # green
            mycolour='${color2}'
        else
            # grey / no colour
            mycolour='${color1}'
        fi
    fi
fi
echo $mycolour$numberof > /home/tawan/mybin/pacman-status

update script (called by user when updates available. Called from menu or from Super+U keyboard shortcut) This resets the conky information after it has run so that conky reports that updates have been done.

#!/bin/bash
# get and store the time of this update so that a script can later call a new update if set time has passed.
# get the hour now and store it
date +%H > ~/mybin/last-update-time.log
# anoter script (not made yet) will notice if 24 hours has passed with no update and call one. 
# if another manual or auto update has happened then the new lapse will be 24 from then. 
#
# to business..
# does an update
echo ":: updating system..."
sudo pacman -Syu
echo " "
echo ":: update complete..."
echo " "
sleep 2s
# function to check for and remove orphan packages
# this function looped by the while loop later
function orphanage {
echo ":: checking if orphan packages exist on the system..."
echo " "
ORPHANS=`pacman -Qqdt`
if [ -z "$ORPHANS" ]
then
    echo ":: system is clean, will exit..."
    # signal to conky that no updates available
    echo '${color1}*' > /home/tawan/mybin/pacman-status
    sleep 3s
    exit
else
    echo -e ":: orphans found on the system.\n$ORPHANS\n\n:: Removing..."
    sudo pacman -R --nosave $ORPHANS
fi
}
# end of orphan function
#
#
# infinite loop to find and remove orphan packages
# script exits when none found
while [ 1 ]
do
orphanage
done
# end of loop
#
#
zenity --warning --text="Update script did not exit normally"
sleep 8s
exit

tint2 config (sits at left side of screen and does not take full height of screen, leaving space for conky below)

#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------

#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
rounded = 0
border_width = 0
background_color = #111111 100
border_color = #111111 0

rounded = 0
border_width = 0
background_color = #181818 100
border_color = #202020 0

rounded = 10
border_width = 0
background_color = #727272 50
border_color = #ffffff 50

#---------------------------------------------
# PANEL
#---------------------------------------------
panel_monitor = all
panel_position = top left vertical
panel_size = 84% 28
panel_margin = 0 0
panel_padding = 0 0 0
font_shadow = 1
panel_background_id = 1
wm_menu = 1

#---------------------------------------------
# TASKBAR
#---------------------------------------------
taskbar_mode = multi_desktop
#taskbar_mode = single_desktop
taskbar_padding = 0 0 0
taskbar_background_id = 1
taskbar_active_background_id = 2

#---------------------------------------------
# TASKS
#---------------------------------------------
task_icon = 1
task_text = 0
task_maximum_size = 20 20
task_centered = 1
task_padding = 4 1
task_font = sans 7
task_font_color = #ffffff 70
task_active_font_color = #000000 100
task_background_id = 0
task_active_background_id = 3

#---------------------------------------------
# SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 4 4 5
systray_background_id = 1
systray_sort = left2right
systray_icon_size = 12
systray_icon_asb = 100 0 0

#---------------------------------------------
# CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = Digital Readout Thick Upright Bold 8
time2_format = %d%b
time2_font = Sans 6
clock_font_color = #86c113 100
clock_padding = 4 2
clock_background_id = 1
clock_lclick_command = zenity --calendar
clock_rclick_command = zenity --calendar

#---------------------------------------------
# BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0

#---------------------------------------------
# TOOLTIP
#---------------------------------------------
tooltip = 1
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #ffffff 80
tooltip_font = sans 10

#---------------------------------------------
# MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

conky config

# -- Conky settings -- #
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 2048
imlib_cache_size 0
 
# -- Window specifications -- #
 
own_window yes
own_window_transparent no
own_window_type desktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 111111

#colors
#good blue 1994d1
#medium blue 083146
#dark blue 041e2c
#lime 86c113
color1 202020
color2 86c113
color3 1994d1
color4 aa0000
color5 1d1d1d
color6 cccccc

border_inner_margin 1
border_outer_margin 0
 
minimum_size 28 110
maximum_width 28
maximum_height 112
 
alignment bottom_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
 
# -- Text settings -- #
use_xft yes
xftfont DejaVu Sans Mono:size=6.5
xftalpha 0.4
 
uppercase no
 
default_color 727272
border_width 0
 
# -- Lua Load -- #
lua_load ~/.conky/lua.lua
lua_draw_hook_pre ring_stats
 
TEXT
${voffset 70}${goto 5}${font Digital Readout Thick Upright:size=12}${execpi 25 cat ~/mybin/gmail-chris} ${goto 18}${execpi 20 cat ~/mybin/gmail-tawan}${font}${color}
${voffset 18}${goto 3}D${goto 10}U${goto 18}${execpi 30 cat ~/mybin/pacman-status}${font DejaVu Sans Bold:size=7}${font}${color}
${voffset 20}${goto 3}MEM
${voffset 20}${goto 2}CPU
${voffset -1}${if_match ${battery_percent BAT0} >= 98}${color5}${else}${if_existing /sys/class/power_supply/ACAD/online 0}${color2}${else}${color1}${endif}${endif}${goto 4}${battery_bar 4,20 BAT0}${if_existing /sys/class/power_supply/ACAD/online 0}${if_match ${battery_percent BAT0} <= 8}${execi 200 ~/mybin/tawan-lowpower-shutdown}${endif}${endif}

lua script

--[[
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)
]]
conky_background_color = 0x151515
conky_background_alpha = 0

ring_background_color = 0xffffff
ring_background_alpha = 0.2
ring_foreground_color = 0x86c113
ring_foreground_color2 = 0x1994d1
ring_foreground_color3 = 0xaa0000
ring_foreground_alpha = 1
 
settings_table = {
--    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
--        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
--        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
--        max=12,
        -- "bg_colour" is the colour of the base ring.
--        bg_colour=ring_background_color,
        -- "bg_alpha" is the alpha value of the base ring.
--        bg_alpha=ring_background_alpha,
        -- "fg_colour" is the colour of the indicator part of the ring.
--        fg_colour=ring_foreground_color,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
--        fg_alpha=ring_foreground_alpha,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
--        x=26, y=25,
        -- "radius" is the radius of the ring.
--        radius=10,
        -- "thickness" is the thickness of the ring, centred around the radius.
--        thickness=6,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
--        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle.
--        end_angle=360
--    },
    {
        name='upspeedf',
        arg='wlan0',
        max=512,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=106,
        radius=11,
        thickness=5,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='downspeedf',
        arg='wlan0',
        max=2048,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=106,
        radius=17,
        thickness=5,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=138,
        radius=17,
        thickness=5,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='fs_used_perc',
        arg='/home/tawan/Data',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=138,
        radius=11,
        thickness=4,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=138,
        radius=6,
        thickness=3,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=170,
        radius=17,
        thickness=4,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=170,
        radius=9,
        thickness=4,
        start_angle=-90,
        end_angle=-20
    },
    {
        name='acpitemp',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color3,
        fg_alpha=ring_foreground_alpha,
        x=23, y=170,
        radius=13,
        thickness=2,
        start_angle=-90,
        end_angle=-20
    }
}
 
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 conky_round_rect(cr, x0, y0, w, h, r)
    if (w == 0) or (h == 0) then return end
    local x1 = x0 + w
    local y1 = y0 + h
    if w/2 < r then
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    else
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    end
    cairo_close_path (cr)
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
 
cs, cr = nil -- initialize our cairo surface and context to nil
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)

    if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
        if cs then cairo_surface_destroy(cs) end
        cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    end
    if cr then cairo_destroy(cr) end
    cr = cairo_create(cs)

 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        conky_round_rect(cr, 3, 0, conky_window.width-6, conky_window.height-3, 15)
        cairo_set_source_rgba(cr, rgb_to_r_g_b(conky_background_color, conky_background_alpha))
        cairo_fill(cr)
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    cairo_destroy(cr)
    cr = nil
end

function conky_cairo_cleanup()
    cairo_surface_destroy(cs)
    cs = nil
end

mailchecker script called to run at logon and runs as a sort of deamon

#!/bin/bash
#function
function mailbox {
if [ $mymail -ge 9 ]
then
# I don't want to show double figures as it messes up my formatting, so limit to 9
    $mymail = 9
fi
if [ $mymail -ge 3 ]
then
    # blue
    mycolour='${color3}'
else
    if [ $mymail -ge 1 ]
    then
        # green
        mycolour='${color2}'
    else
        # grey/none
        mycolour='${color1}'
    fi
fi
echo $mycolour$mymail > /home/tawan/mybin/gmail-$myuser
}
#main script
while [ 1 ]
do
    mymail=$(python ~/mybin/my-gmail.py EMAILUSERNAME1)
    myuser=tawan
    mailbox
    sleep 10s
    mymail=$(python ~/mybin/my-gmail.py EMAILUSERNAME2)
    myuser=chris
    mailbox
    sleep 2m
done

gmail checking python script used by above script

## needs The urllib and feedparser Python libraries

import sys
import urllib             # For BasicHTTPAuthentication
import feedparser         # For parsing the feed
from textwrap import wrap

_URL = "https://mail.google.com/gmail/feed/atom"

uname = sys.argv[1]
password = "*****PASSWORDFORGMAIL*****"
maxlen = 1

urllib.FancyURLopener.prompt_user_passwd = lambda self, host, realm: (uname, password)
    
def auth():
    '''The method to do HTTPBasicAuthentication'''
    opener = urllib.FancyURLopener()
    f = opener.open(_URL)
    feed = f.read()
    return feed

def readmail(feed, maxlen):
    '''Parse the Atom feed and print a summary'''
    atom = feedparser.parse(feed)
    print '%s' % (len(atom.entries))
#    for i in range(min(len(atom.entries), maxlen)):
#        print ' ${color}"%s"' % atom.entries[i].title
#        print '    ${color lightgrey}%s' % atom.entries[i].author
#    if len(atom.entries) > maxlen:
#        print ' ${color}more...'

if __name__ == "__main__":
    f = auth()  # Do auth and then get the feed
    readmail(f, int(maxlen)) # Let the feed be chewed by feedparser

Offline

#531 2010-06-03 19:29:48

Wyrm88
Member
Registered: 2010-05-05
Posts: 53

Re: conky configs and screenshots!

@ tawan

Could you please tell me how did you make the file manager to appear without the buttons and the borders?

Offline

#532 2010-06-03 21:02:44

AddiKT1ve
Member
From: France
Registered: 2008-08-22
Posts: 47
Website

Re: conky configs and screenshots!

Wyrm88 wrote:

@ tawan

Could you please tell me how did you make the file manager to appear without the buttons and the borders?

Just disable window decorations in your WM's config.


##hippie irc.freenode.net

Offline

#533 2010-06-04 07:45:54

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

Wyrm88 wrote:

@ tawan

Could you please tell me how did you make the file manager to appear without the buttons and the borders?

I turned them off in the config but then in rc.xml I made it so I can close a window by right clicking the title bar and minimize by middle clicking (or using the panel). I still maximize or restore by double clicking the title bar I think I say more clearly how to do it in an earlier post on this thread.

Offline

#534 2010-06-08 19:44:38

epsilon
Member
Registered: 2009-04-02
Posts: 75

Re: conky configs and screenshots!

I pipe Conky to dzen2, as shown here: http://omploader.org/vNGl5cA

.xinitrc:

(sleep 1s && conky | dzen2 -w '800' -x '224' -e '' -fg '#a6a6a6' -bg '#262729' -ta r -fn '-artwiz-cure-*-r-normal-*-*-*-*-*-*-*-iso8859-1') &

.conkyrc:

background no
out_to_console yes
update_interval 2
total_run_times 0
use_spacer none

TEXT
${if_mpd_playing}^fg(\#659fdb)^i(/home/byte/images/icons/note.xbm) ^fg(\#a6a6a6)${mpd_smart} | ${endif}\
^fg(\#659fdb)^i(/home/byte/images/icons/cpu.xbm) ^fg(\#a6a6a6)${cpu cpu1}% / ${cpu cpu2}% | \
^fg(\#659fdb)^i(/home/byte/images/icons/temp.xbm) ^fg(\#a6a6a6)${acpitemp}C | \
^fg(\#659fdb)^i(/home/byte/images/icons/mem.xbm) ^fg(\#a6a6a6)$memperc% ($mem) | \
^fg(\#659fdb)^i(/home/byte/images/icons/spkr_01.xbm) ^fg(\#a6a6a6)${mixer Speaker} \
^fg(\#659fdb)^i(/home/byte/images/icons/phones.xbm) ^fg(\#a6a6a6)${mixer Headphone} | \
^fg(\#659fdb)^i(/home/byte/images/icons/net_down_03.xbm) ^fg(\#a6a6a6)${downspeedf wlan0} ^fg(\#659fdb)^i(/home/byte/images/icons/net_up_03.xbm) ^fg(\#a6a6a6)${upspeedf wlan0} | \
${tail /home/byte/bin/new_messages 1 300} | \
^fg(\#659fdb)^i(/home/byte/images/icons/pacman.xbm) ^fg(\#a6a6a6)${execi 3600 /home/byte/bin/pacman_listupgrades} | \
${if_match $battery_percent < 30}^fg(\#f03669)^i(/home/byte/images/icons/bat_empty_02.xbm) ${battery_percent}%^fg(\#a6a6a6) | \
${else}${if_match $battery_percent < 70}^fg(\#659fdb)^i(/home/byte/images/icons/bat_low_02.xbm) ^fg(\#a6a6a6)${battery_percent}% | \
${else}^fg(\#659fdb)^i(/home/byte/images/icons/bat_full_02.xbm) ^fg(\#a6a6a6)${battery_percent}% | ${endif}${endif}\
^fg(\#659fdb)^i(/home/byte/images/icons/clock.xbm) ^fg(\#a6a6a6)${time %a %b %d %I:%M}

I should probably place those icons in another directory but it's a work in progress. Battery, pacman, and mail information change to red text/icon on low charge or new mail/package. Conky, for some reason, seems a bit buggy with the mail and package script, at times the indicators disappear or just the icon appears or the color is changed.

To fix the mail script from doing this (I'm using the perl script from wiki Conky page) I have the script croned to execute every five minutes and write the amount of new mail (along with the appropriate icon/color codes for dzen2) to a file that I then just tail in conky. I plan on doing the same with the package notifier, though this solution is less than elegant.

dzen2 icons the sm4tik set found here.


mu @ freenode - Last.fm

Offline

#535 2010-06-09 02:27:47

Hiram
Member
From: Brisbane, Australia
Registered: 2010-02-13
Posts: 67
Website

Re: conky configs and screenshots!

For those who liked tawan's ring meters, I decided they would make an awesome clock. Here's the stuff to put in the lua script to make a nifty clock:

    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color3,
        fg_alpha=ring_foreground_alpha,
        x=23, y=192,
        radius=5,
        thickness=4,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%M',
        max=60,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=23, y=192,
        radius=11,
        thickness=4,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%l',
        max=12,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=23, y=192,
        radius=17,
        thickness=4,
        start_angle=0,
        end_angle=360
    }

Offline

#536 2010-06-09 08:23:14

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

Hiram wrote:

For those who liked tawan's ring meters, I decided they would make an awesome clock.

hiya, if you look at the source of the ring meters lua script you'll see they were made by londonali and she has also made a clock version. - check out her stuff, very nice smile

Offline

#537 2010-06-13 18:04:30

sloth
Member
From: Adelaide, Australia
Registered: 2010-05-01
Posts: 4

Re: conky configs and screenshots!

conkysec.png

background no
font terminus:size=8
#xftfont terminus:size=10
use_xft yes
xftalpha 0.9
update_interval 1.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 220 700
maximum_width 220
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color C0C0C0
default_shade_color black
default_outline_color green
alignment top_right
gap_x 25
gap_y 25
no_buffers yes
cpu_avg_samples 2
override_utf8_locale no
uppercase yes # set to yes if you want all text to be in uppercase
default_bar_size 0 4

TEXT


$alignc ${image /home/sloth/archgreen.png -p 65,0}





${color C0C0C0}SYSTEM ${hr 1} ${color}

Hostname: $alignr$nodename
Kernel: $alignr$kernel
Uptime: $alignr$uptime
Temp: ${alignr}${acpitemp}C

CPU: ${alignr}${freq} MHz
Processes: ${alignr}$processes ($running_processes running)
Load: ${alignr}$loadavg

#CPU1 ${alignr}${cpu cpu1}%
#${color 3eae15}${cpubar 4}${color}
#CPU2 ${alignr}${cpu cpu2}%
#${color 3eae15}${cpubar 4 cpu2}${color}

Ram ${alignr}$mem / $memmax ($memperc%)
${color 3eae15}${membar 4}${color}
swap ${alignr}$swap / $swapmax ($swapperc%)
${color 3eae15}${swapbar 4}${color}

Highest CPU $alignr CPU% MEM%
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}

Highest MEM $alignr CPU% MEM%
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}

${color C0C0C0}Filesystem ${hr 1} ${color}

Root: ${alignr}${fs_used /} / ${fs_size /} (${fs_used_perc /}%)
${color 3eae15}${fs_bar 4 /}${color}
Home: ${alignr}${fs_used /home} / ${fs_size /home} (${fs_used_perc /home}%)
${color 3eae15}${fs_bar 4 /home}${color}

${color C0C0C0}Now Playing ${hr 1} ${color}


${offset 81,0}Title: 
${offset 85,0}${mpd_title} 
${offset 81,0}Artist: 
${offset 85,0}${mpd_artist}

${voffset 5}${color 3eae15}${mpd_bar 4}${color}
${mpd_bitrate}kbps ${alignr}${mpd_elapsed}/${mpd_length}

${execi 1.0 mpd-cover}
${image /tmp/cover -s 75x75 -p 1,525 -n}

Its based on the Hardy Theme 2.0 by Mariux conky. Using an mpd script from somewhere around the forums, this thread I think. You'll have to excuse my embarrassing hardware. A few friends of mine say I shouldn't indent the Now Playing stuff and have it just fill the same height as the arch by adding the album or something, but meh.


Oops, forgot to upload the arch logo in case anyone wants it.
http://dump.seedit.us/archgreen.png

Last edited by sloth (2010-06-13 18:06:32)


cat ~/ > /dev/THEFUTURE

Offline

#538 2010-06-23 16:01:40

orphius1970
Member
From: Modesto (HELL) California
Registered: 2009-02-27
Posts: 151

Re: conky configs and screenshots!

myconkyscreenshotleft.png

I am wondering if anyone knows of a way, by script or other, that I can have conky get the label from
a cd or dvd and display it. Like for example; when I insert a parted magic live cd in my drive, the icon
shows up on the desktop with the disk label Parted-Magic. I would like to reproduce the label part,
using the if_mounted option in my conky.

UPDATE:
I figured it out. All i had to do was add

${exec volname}

Last edited by orphius1970 (2010-06-24 13:07:24)


AMD Phenomx3, 4gb ram, Nvidia Gforce 9400gt,
MSI K9N2 Diamond Motherboard, Arch x86_64

Offline

#539 2010-06-29 10:10:05

thms
Member
Registered: 2010-02-01
Posts: 120

Re: conky configs and screenshots!

Erus_Iluvatar wrote:

I'll post this here to, highly inspired from an old blog post of someone :

http://omploader.org/tNDBqbA

Although the post is a little old - do you like to share your conky configs?

Offline

#540 2010-06-29 10:58:38

Erus_Iluvatar
Wiki Admin
Registered: 2010-04-01
Posts: 124

Re: conky configs and screenshots!

Yep, i'ts one big and awfull mess for the .conkyrc : http://omploader.org/vNHM2Ng

Meteo scripts :
Omploaded '.scripts/meteo2.sh' to http://omploader.org/vNHM2OA
Omploaded '.scripts/meteo.sh' to http://omploader.org/vNHM2Yg
Omploaded '.scripts/meteo.xslt' to http://omploader.org/vNHM2Yw

and the text-conky, used with a long sed to render well in WMFS :  http://omploader.org/vNHM2ZQ

You need to pick some fonts on dafont for the main conkyrc.


I'm french, don't mind my mistakes in english.

Offline

#541 2010-07-01 11:30:16

tabelle
Member
From: Uganda
Registered: 2009-09-09
Posts: 17

Re: conky configs and screenshots!

201007011256161280x800s.th.png

Could someone help me out? I don't want conky to be on the left side, but in the middle. 
For some reason it's always on the left side, ignoring "alignment" (changing the gap parameters
didn't help either).

double_buffer yes

background yes
own_window yes
own_window_transparent yes

own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

draw_borders no
draw_shades no

gap_y 60
gap_x 60

alignment top_middle

update_interval 1
default_color white

use_xft yes
xftfont Sans:size=7

use_spacer none

#cpu_avg_samples 2
#net_avg_samples 2
#no_buffers yes
#text_buffer_size 2048

minimum_size 1680 15
border_inner_margin 0

override_utf8_locale yes

TEXT
${font AR PL UKai TW:size=16}
${color0}${time %A %e %B %R}

(By the way, this is not mine, I got it from someone from the screenshot thread and modified it somewhat.)

Offline

#542 2010-07-01 23:20:08

sen
Member
From: .de
Registered: 2007-02-18
Posts: 153
Website

Re: conky configs and screenshots!

@tabelle
The minimum size is wider than your desktop:

minimum_size >>>1680<<< 15

If you change it to "400 15" or so the alignment option should work.

Offline

#543 2010-07-02 11:39:13

mirhciulica
Member
From: Romania
Registered: 2009-09-23
Posts: 13

Re: conky configs and screenshots!

tNHRjMw

This is my current Conky configuration.

The halfs of the rings show each, from up to bottom, left to right: cpu1 & cpu2, RAM & swap, battery & mpd progress.
The font used for ring icons is Poky.

.conkyrc

# Created on 07.2010 by mirhciulica
 
# -- Conky settings -- #
background no
update_interval 1
update_interval_on_battery 3
 
cpu_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 256
imlib_cache_size 0
 
# -- Window specifications -- #
 
own_window  yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorate,above,sticky,skip_taskbar,skip_pager
 
border_inner_margin 1
border_outer_margin 0
 
minimum_size 50 182
maximum_width 50
 
alignment bottom_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
 
# -- Text settings -- #
use_xft yes
xftfont DejaVu Sans Mono:size=6.5
xftalpha 0.4
 
uppercase no
 
default_color bbbbbb
border_width 0
 
mpd_host 127.0.0.1
mpd_port 6600
 
# -- Lua Load -- #
lua_load ~/scripts/conky-lua1.lua
lua_draw_hook_pre ring_stats
 
 
TEXT
${voffset 9}${goto 17}${font Poky:size=14}P${font}
${voffset 10}${goto 17}${font Poky:size=14}M${font}
${voffset 11}${goto 19}${font Poky:size=16}${if_mpd_playing}${if_match "${mpd_status}"=="Playing"}9${endif}${if_match "${mpd_status}"=="Paused"}6${endif}${endif}${if_match "${mpd_status}"=="Stopped"}8${endif}${font}
 
${execpi 61 cat ~/.temp/conkyFile}

.lua file

--[[
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)
]]
conky_background_color = 0x000000
conky_background_alpha = 0.7
 
ring_background_color = 0xffffff
ring_background_alpha = 0.15
ring_foreground_color = 0xffffff
ring_foreground_alpha = 0.5
 
settings_table = {
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=26, y=23,
        radius=19,
        thickness=4,
        start_angle=0,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=26, y=23,
        radius=15,
        thickness=4,
        start_angle=0,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=26, y=57,
        radius=19,
        thickness=4,
        start_angle=-180,
        end_angle=0
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=26, y=57,
        radius=15,
        thickness=4,
        start_angle=-180,
        end_angle=0
    },
    {
        name='battery_percent',
        arg='BAT1',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=26, y=91,
        radius=15,
        thickness=4,
        start_angle=0,
        end_angle=180
     },
     {
        name='mpd_percent',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=26, y=91,
        radius=19,
        thickness=4,
        start_angle=0,
        end_angle=180
    },
}
 
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 conky_round_rect(cr, x0, y0, w, h, r)
    if (w == 0) or (h == 0) then return end
    local x1 = x0 + w
    local y1 = y0 + h
    if w/2 < r then
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    else
        if h/2 < r then
            cairo_move_to  (cr, x0, (y0 + y1)/2)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2)
        else
            cairo_move_to  (cr, x0, y0 + r)
            cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0)
            cairo_line_to (cr, x1 - r, y0)
            cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r)
            cairo_line_to (cr, x1 , y1 - r)
            cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1)
            cairo_line_to (cr, x0 + r, y1)
            cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r)
        end
    end
    cairo_close_path (cr)
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
 
cs, cr = nil -- initialize our cairo surface and context to nil
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)
 
    if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
        if cs then cairo_surface_destroy(cs) end
        cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    end
    if cr then cairo_destroy(cr) end
    cr = cairo_create(cs)
 
 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        conky_round_rect(cr, 3, 0, conky_window.width-6, conky_window.height-3, 15)
        cairo_set_source_rgba(cr, rgb_to_r_g_b(conky_background_color, conky_background_alpha))
        cairo_fill(cr)
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    cairo_destroy(cr)
    cr = nil
end
 
function conky_cairo_cleanup()
    cairo_surface_destroy(cs)
    cs = nil
end

Last edited by mirhciulica (2010-07-02 11:39:51)

Offline

#544 2010-07-03 13:55:46

Barghest
Member
From: Hanau/Germany
Registered: 2008-01-03
Posts: 563

Re: conky configs and screenshots!

initbox wrote:

So I implemented that volume script in awk:

#!/bin/sh

data=`amixer get Master | awk 'NR==5 {gsub(/\[|\]/, ""); 1; print $6 " " $4}'`

if [ `echo $data | cut -d \  -f 1` == "on" ];
then
    echo `echo $data | cut -d \  -f 2`
else
    echo "muted"
fi

I can't think of any additional optimizations...

Hi,

unfortunately I don't have "Master" and I don't know anything about awk.

So is there a way to print "mute" from the PCM line(s) [off]?

Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 704
  Mono:
  Front Left: Playback 210 [30%] [-27.88dB] [off]
  Front Right: Playback 210 [30%] [-27.88dB] [off]

Offline

#545 2010-07-03 14:12:22

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: conky configs and screenshots!

http://i50.tinypic.com/2e5io9k.jpg

Bottom Conky:

${color grey}CPU$color $cpu% | ${color grey}RAM Usage$color $mem${color grey} Free$color $memfree${color grey} Cached $color$cached| ${color grey}/ $color${fs_free /}/${fs_size /} ${color grey}/home $color${fs_free /home}/${fs_size /home} | ${color grey}Power: $color${execi 2 acpi -a | grep -o "on-line"}${color red}${execi 2 acpi -a | grep -o "off-line"} ${color blue}${execi 10 acpi -b | grep -o Charging}$color | ${color grey}Gmail: $color${execi 60 curl -u user:pass --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | perl -pe 's/^<title>(.*)<\/title>.*<name>(.*)<\/name>.*$/$2 - $1/' | wc -l} new$alignr${color grey} ${execi 5 ncmpcpp --now-playing "{%a - %t}"}

Top Right corner Conky:

${color grey}$alignr${execi 300 cat /path/to/reminder/txt/file}
${color grey}$alignr${time %A}, $alignr${time %d}.${time %m}.${time %Y}.
$alignr${color green}${execi 3600 grep "$(date '+%d %m')" /path/to/dates/txt/file}${color grey}

Offline

#546 2010-07-03 18:11:51

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: conky configs and screenshots!

My left to right Conky bar can be seen here, in the upper middle. It's very simple but gets the job done.

http://img811.imageshack.us/img811/9199 … 0x1080.png

If anyone wants the script let me know.

Offline

#547 2010-07-03 21:50:58

w1ntermute
Member
Registered: 2009-06-28
Posts: 146

Re: conky configs and screenshots!

background yes

update_interval 1

alignment bottom_left

gap_y 310
gap_x 1930

use_xft yes
xftfont Dina:size=8

text_buffer_size 4096

double_buffer yes

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

stippled_borders 3

border_outer_margin 4

border_width 1

override_utf8_locale yes

TEXT
${execpi 5 cat `ls -t ~/.irssi/logs/2010/P2P-NET/\#pre.??-??.log | head -n1` | grep -v XXX | grep "PRE>"| tail -n20 | cut -c 1-8,24-}

Looks like this:
vNHRzZg

background yes

update_interval 1

alignment bottom_right

gap_y 1040
gap_x 460

maximum_width 500

use_xft yes
xftfont Dina:size=8

text_buffer_size 1024

double_buffer yes

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

stippled_borders 3

border_outer_margin 4

border_width 1

override_utf8_locale yes

TEXT
${execpi 10 dmesg | tail -n10}

Looks like this:
vNHRzZw

background yes

update_interval 1

alignment top_right

gap_y 30
gap_x 20

use_xft yes
xftfont Dina:size=8

text_buffer_size 1024

double_buffer yes

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

stippled_borders 3

border_outer_margin 4

border_width 1

override_utf8_locale yes

# Notice that paconky is executed with "execpi" at an interval of 3600 seconds.
# There's no point in checking the AUR more than once an hour or your repo
# pkgs more often than you update your database.
# The voffset at the end seems to keep the list from getting cut off when it grows.
TEXT
${execpi 3600 paconky ~/scripts/paconky/repos.paconky}
${execpi 3600 paconky ~/scripts/paconky/aur.paconky}
${voffset 900}

Looks like this. I linked instead of posting the image because it's so big. If anyone knows how to make the Conky "window" smaller, I'd appreciate some help on that.

Last edited by w1ntermute (2010-07-03 21:51:52)

Offline

#548 2010-07-04 02:48:41

ibnarrashid
Member
From: New York
Registered: 2010-01-14
Posts: 21
Website

Re: conky configs and screenshots!

7ec79787082082.jpg

The conky on the right is mostly a copy of one of the ealier posts on this thread, with slight modifications. I am not completely done yet, so some of the stuff on the conkys are the same information, but currently that's what it looks like. The wallpaper is from http://wlppr.com. Moc is configured to use the green theme from the moc website and I don't really listen to music so it's just playing a random audio file I downloaded (Stevenson's Treasure Island).

Offline

#549 2010-07-05 09:55:52

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

still deciding how this is going to work out... but, obviously I'm aiming for a big conky-lua in the middle of my desktop smile

tNHVheA

Offline

#550 2010-07-05 10:14:07

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: conky configs and screenshots!

wow, i came across this image and decided to try and fit the lua rings into it...

here is just CPU 1 and 2

tNHViNA

tNHViMw

Offline

Board footer

Powered by FluxBB