SEARCH

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

You are not logged in.

#651 2012-02-26 14:28:50

kri5
#! Die Hard
From: L.G.C. UK
Registered: 2011-11-10
Posts: 568

Re: Conky v1.9 Thread

^Thanks again Sector11, i'll get there in the end. lol  I shall try that.

EDIT: for now i have correctected the incorrect link as I'm not on my home PC at present.

Last edited by kri5 (2012-02-26 14:45:40)


#! Waldorf - 64bit - Xfce

Offline

Be excellent to each other!

#652 2012-02-26 15:46:00

kri5
#! Die Hard
From: L.G.C. UK
Registered: 2011-11-10
Posts: 568

Re: Conky v1.9 Thread

@Sector11 and Vastone..

Thanks guys for pointing out a simpler and not to mention easier way of sharing my conky scripts via dropbox.  I have now done as you suggested and archived them and supplied just the one link.

It seems so obvious now that you pointed it out. lol


#! Waldorf - 64bit - Xfce

Offline

#653 2012-02-26 15:57:19

kri5
#! Die Hard
From: L.G.C. UK
Registered: 2011-11-10
Posts: 568

Re: Conky v1.9 Thread

Guys,

Trying to check my emails with conky but all it's returning is a '?'
Could someone take a look and see if they can tell me what i'm missing in y conky please?

Mail: ${color 0a84f0}${execi 600 conkyEmail --servertype=pop --servername=pop.ntlworld.com --username=xxxl --password=xxx --ssl

#! Waldorf - 64bit - Xfce

Offline

#654 2012-02-26 17:09:05

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

kri5 wrote:

Guys,

Trying to check my emails with conky but all it's returning is a '?'
Could someone take a look and see if they can tell me what i'm missing in y conky please?

Mail: ${color 0a84f0}${execi 600 conkyEmail --servertype=pop --servername=pop.ntlworld.com --username=xxxl --password=xxx --ssl

A few things:  case sensitive - --servertype=pop should be --servertype=POP

${execi 180 conkyEmail --servername=pop3.xxxxxx.com --servertype=POP --port=110 --username=xxxxxx --password=xxxxxx}

--port=???  probably find that in your email client.

Claws-mail
Configuration > Preferences for current account > Advanced

Then run your on the command line with a "-v" on the end and show us:

  13:45:49 ~
         $ conkyEmail --servername=pop3.xxxxxx.com --servertype=POP --port=110 --username=XXXXXXX --password=XXXXXXXX -v
*** INITIAL OPTIONS:
    servertype: POP
    servername: pop3.xxxxxx.com
    port: 110
    folder: Inbox
    ssl: False
    username: XXXXXXXXX
    password: XXXXXXXXX
    template: None
    mailinfo: 0
    maxwidth: 80
    linelimit: 0
    quote: "
    verbose: True
    errorlogfile: None
    infologfile: None
INFO: Logging on to POP server: pop3.xxxxxx.com
INFO: Getting message count from POP server: pop3.xxxxxx.com
INFO: Logging off from POP server: pop3.xxxxxx.com
0

  13:49:57 ~
         $ 

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#655 2012-02-26 17:25:14

SiNiSTeR
#! Member
From: north carolina
Registered: 2012-02-03
Posts: 55

Re: Conky v1.9 Thread

here goes the script and lua for my conky
@S11 yea im comfortable with the "if it aint broke dont fix it" im running the original conky i got the idea from on my moms acer laptop with #! 10 32bit its like 4 different conkyrc's some of them are own_window_type override some are desktop, had to do it like that because the transperency wasnt right on some of the conky windows. but anyway heres my code. most of the rings in the lua code are commented so u know which rings are which. and thanks much for the compliments although its not totally my code i feel good about the modifications i did to it, gives me a sense of accomplishment.


conkyrc

## Conky script by Dragonias Edited by SuiCiDeSiNiSTeR ##
total_run_times 0
background no
cpu_avg_samples 1                    
net_avg_samples 1
double_buffer yes
no_buffers yes
text_buffer_size 1024
out_to_console no
update_interval 1
alignment tr
minimum_size 1440 300
maximum_width 1440
gap_x 0
gap_y 0
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_width 1
border_inner_margin 0
own_window yes
own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
use_xft yes
xftalpha .8
override_utf8_locale yes
uppercase no
use_spacer right
default_bar_size 82 15
default_color ffffff
default_shade_color 303030
default_outline_color white
color1 64b4ff
pad_percents 2



lua_load /home/junior/.conky/conkynice/clock_rings.lua
lua_draw_hook_post clock_rings
 
 
TEXT

${voffset 117}${goto 105}${font neuropol:size=18}${time %I:%M}${font neuropol:size=10}${voffset -5}${time %p}${font}
${voffset -20}${goto 300}${cpubar cpu6 1,600}
${voffset 10}${goto 310}${font Santana:size=16}${time %A, %d %B %Y}
${font neuropol:size=12}${voffset 30}${goto 300}HDD${goto 450}${font Santana:size=12}used ${fs_used} size ${fs_size}                        
${font neuropol:size=12}${voffset 5}${goto 300}Kernel${goto 450}${font Santana:size=12}${kernel}
${font neuropol:size=12}${voffset 5}${goto 300}Uptime${goto 450}${font Santana:size=12}${uptime}
${font neuropol:size=12}${voffset 5}${goto 300}Os${font Santana:size=12}${goto 450}Crunchbang Linux 10 Statler 64bit

${voffset 100}${goto 1000}${font neuropol:size 12}RAM DDR2 667 MHz
${goto 930}${voffset -7}${cpubar cpu6 1,600}
${voffset 5}${goto 1000}${font neuropol:size 12}In Use${font Santana:size=12}${goto 1250}${mem}
${voffset 2}${goto 1000}${font neuropol:size 12}Total${font Santana:size=12}${goto 1250}${memmax}
${voffset 2}${goto 1000}${font neuropol:size 12}Processes${font Santana:size=12}${goto 1250}${running_processes}/ ${processes}

${goto 1000}${font neuropol:size 12}${top_mem name 1} ${goto 1250}${font Santana:size=12}${top_mem mem 1}
${goto 1000}${font neuropol:size 12}${top_mem name 2} ${goto 1250}${font Santana:size=12}${top_mem mem 2}
${goto 1000}${font neuropol:size 12}${top_mem name 3} ${goto 1250}${font Santana:size=12}${top_mem mem 3}
${goto 1000}${font neuropol:size 12}${top_mem name 4} ${goto 1250}${font Santana:size=12}${top_mem mem 4}
${goto 1000}${font neuropol:size 12}${top_mem name 5} ${goto 1250}${font Santana:size=12}${top_mem mem 5}
${goto 1000}${font neuropol:size 12}${top_mem name 6} ${goto 1250}${font Santana:size=12}${top_mem mem 6}

${voffset 10}${goto 285}${font neuropol:size 12}AMD Phenom x4 9550${goto 900}Current Track
${goto 270}${voffset -10}${hr 2}
${voffset -89}${goto 499}${cpugraph cpu6 75,200 181818 ffffff}
${voffset 10}${goto 285}${font neuropol:size 12}Total Use${font Santana:size=12}${goto 451}${cpu cpu0}%${font neuropol:size 12}${goto 520}Core 1${goto 650}${font santana:size=12}${cpu cpu1}%${goto 1000}${font neuropol:size=18}${if_running rhythmbox}${exec conkyRhythmbox --datatype=PT}
${goto 285}${voffset -14}${font neuropol:size 12}Freq${font Santana:size=12}${goto 416}${freq} mhz${goto 520}${font neuropol:size 12}Core 2${goto 650}${font Santana:size=12}${cpu cpu2}%${goto 1040}${exec conkyRhythmbox --datatype=TI}
${goto 285}${font neuropol:size 12}Temp${goto 451}${font Santana:size=12}${exec sensors | grep 'temp1' | cut -c15-16}°C${goto 520}${font neuropol:size 12}Core 3${goto 650}${font Santana:size=12}${cpu cpu3}%${font neuropol:size=30}${goto 900}${exec conkyRhythmbox --datatype=AR}
${goto 285}${voffset -43}${font neuropol:size 12}Voltage${font Santana:size=12}${goto 435}${exec sensors | grep 'cpu0_vid' | cut -c14-20}${goto 520}${font neuropol:size 12}Core 4${goto 650}${font Santana:size=12}${cpu cpu4}%${goto 1000}${voffset 20}${exec conkyRhythmbox --datatype=AL}${goto 1000}${else}       ..:: rhythmbox not running ::..

${endif}

lua

--[[
Clock Rings by londonali1010 (2009) Editted by SuiCiDeSiNiSTeR (2012)

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua 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 near the end of the script 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/clock_rings-v1.1.1.lua
    lua_draw_hook_pre clock_rings

Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]

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=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xffffff,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "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=150, y=155,
        -- "radius" is the radius of the ring.
        radius=55,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "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 than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.4,
        x=150, y=155,
        radius=76,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0,
        fg_colour=0xffffff,
        fg_alpha=1,
        x=150, y=155,
        radius=82,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=95,
        thickness=5,
        start_angle=93,
        end_angle=208
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=101,
        thickness=5,
        start_angle=93,
        end_angle=208
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=95,
        thickness=5,
        start_angle=212,
        end_angle=329
    },
        {
        name='cpu',
        arg='cpu4',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=101,
        thickness=5,
        start_angle=212,
        end_angle=329
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=98.5,
        thickness=11,
        start_angle=-27,
        end_angle=85
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=125,
        thickness=3,
        start_angle=-120,
        end_angle=-13
    },
    {
        name='fs_used_perc',
        arg='/home',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=125,
        thickness=3,
        start_angle=-10,
        end_angle=120
    },
    {
        name='', --top left outter decoration ring surrounding clock
        arg='',
        max=1,
        bg_colour=0xffffff,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=1,
        x=150, y=155,
        radius=150,
        thickness=4,
        start_angle=50,
        end_angle=190
    },
        {
        name='upspeedf',  --big center ring inner meter
        arg='eth0',
        max=700,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=700, y=455,
        radius=95,
        thickness=9,
        start_angle=10,
        end_angle=180
    },
    {
        name='downspeedf', --middle ring inner meter
        arg='eth0',
        max=3200,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=700, y=455,
        radius=84,
        thickness=9,
        start_angle=10,
        end_angle=180
    },
    {
        name='',  --middle outter decoration ring
        arg='',
        max=1,
        bg_colour=0xffffff,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=1,
        x=700, y=455,
        radius=230,
        thickness=4,
        start_angle=60,
        end_angle=150
    },
    {
        name='memperc', --middle ring outer meter
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=700, y=455,
        radius=215,
        thickness=2,
        start_angle=60,
        end_angle=300
    },
    {
        name='cpu', --middle ring meter
        arg='cpu4',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=700, y=455,
        radius=185,
        thickness=15,
        start_angle=80,
        end_angle=170
    },
    {
        name='cpu', --middle ring meter
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=700, y=455,
        radius=130,
        thickness=4,
        start_angle=0,
        end_angle=360
    },
    {
        name='5', --bottom outer ring
        arg='',
        max=1,
        bg_colour=0xffffff,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=1,
        x=50, y=675,
        radius=220,
        thickness=4,
        start_angle=0,
        end_angle=130
    },
    {
        name='cpu', --bottom cpu ring
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=195,
        thickness=3,
        start_angle=50,
        end_angle=150
    },
    {
        name='cpu', --bottom cpu ring
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.7,
        x=50, y=675,
        radius=170,
        thickness=10,
        start_angle=-10,
        end_angle=170
    },
    {
        name='time', --bottom seconds ring
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=00,
        fg_colour=0xffffff,
        fg_alpha=1,
        x=50, y=675,
        radius=140,
        thickness=3,
        start_angle=20,
        end_angle=130
    },
    {
        name='cpu', --bottom inner cpu ring
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=120,
        thickness=5,
        start_angle=50,
        end_angle=140
    },
    {
        name='cpu', --bottom inner cpu ring
        arg='cpu4',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=113,
        thickness=5,
        start_angle=50,
        end_angle=140
    },
    {
        name='cpu', --bottom inner cpu ring
        arg='cpu4',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=85,
        thickness=9,
        start_angle=-5,
        end_angle=155
    },
    {
        name='6', --bottom left outter decoration ring
        arg='',
        max=1,
        bg_colour=0xffffff,
        bg_alpha=0,
        fg_colour=0xffffff,
        fg_alpha=1,
        x=389, y=697,
        radius=112,
        thickness=2,
        start_angle=80,
        end_angle=100
    },
        
}

-- Use these settings to define the origin and extent of your clock.

clock_r=140

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=150
clock_y=155

-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

-- Do you want to show the seconds hand?

show_seconds=true

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 draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys

    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")

    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12

    -- Draw hour hand

    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
    cairo_stroke(cr)

    -- Draw minute hand

    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)

    cairo_set_line_width(cr,3)
    cairo_stroke(cr)

    -- Draw seconds hand

    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)

        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    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

    -- Check that Conky has been running for at least 5s

    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

    draw_clock_hands(cr,clock_x,clock_y)
end

Offline

#656 2012-02-26 17:43:04

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

SiNiSTeR wrote:

my moms acer laptop with #! 10 32bit its like 4 different conkyrc's some of them are own_window_type override some are desktop

Your mom! I love it!  I never use 'desktop' it's either 'override' or 'normal'

desktop - does not allow for right-clicking the mouse on the conky to get the menu.
override - if I want conky on ALL desktops, and
normal - if I want to restrict conky to a specific desktop by dropping 'sticky' from

own_window_hints

that way the conky only resides in the desktop it was started on.

SiNiSTeR wrote:

and thanks much for the compliments although its not totally my code i feel good about the modifications i did to it, gives me a sense of accomplishment.

Compliments you deserved, you made a nice conky.  And that last part 'i feel good about the modifications i did to it, gives me a sense of accomplishment' is what makes the whole thing worth it.  By modifying it you made it: yours!

Thank you for sharing!  Now I'm gonna play with it.

Last edited by Sector11 (2012-02-26 17:44:10)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#657 2012-02-26 17:47:05

kri5
#! Die Hard
From: L.G.C. UK
Registered: 2011-11-10
Posts: 568

Re: Conky v1.9 Thread

@Sector11..

Thanks for that, i changed the 'servertype=pop' to 'servertype=POP' and added 'port=995' then ran the command along with '-v' as you suggested and it reported back everything OK, on top of that it also displays the email count.

You are a star, cheers! wink

There does seem to be a delay when i first switch on though in which a '?' is still displayed before the email count pops up, is this normal?

Last edited by kri5 (2012-02-26 20:04:38)


#! Waldorf - 64bit - Xfce

Offline

#658 2012-02-26 20:33:50

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

kri5 wrote:

@Sector11..

Thanks for that, i changed the 'servertype=pop' to 'servertype=POP' and added 'port=995' then ran the command along with '-v' as you suggested and it reported back everything OK, on top of that it also displays the email count.

You are a star, cheers! wink

There does seem to be a delay when i first switch on though in which a '?' is still displayed before the email count pops up, is this normal?

Yup, as it hasn't gone to collect yet.  Also if your connection goes down, you will get a ? as well.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#659 2012-02-26 20:57:55

SiNiSTeR
#! Member
From: north carolina
Registered: 2012-02-03
Posts: 55

Re: Conky v1.9 Thread

[solved]trying to get conky to display the album art i used this post[solved]
http://crunchbanglinux.org/forums/topic … album-art/

but i get nothing. most of my music has the albumart in the albums folder already figured id try that tho incase the albumart is not in the folder with the songs.

Last edited by SiNiSTeR (2012-02-27 01:30:02)

Offline

#660 2012-02-27 02:11:45

jeffeb3
New Member
Registered: 2012-02-27
Posts: 1

Re: Conky v1.9 Thread

Well, I installed #! Yesterday, and I love it. I want to share my conky. I wrote it for ubuntu, but most everything worked out ok. I based it off of the work of a guy names "crinos". But I don't like scripting in bash, or lua for that matter. So I made some scripting in python. I call it conkython. I've been thinking about posting the code on a project somewhere, so people can give me feedback, and even improve things themselves.

Anyway, this is the main config text, which really doesn't tell you much:

TEXT
${execpi 3600 python ~/.conky/conkython/header.py        }#
${execp       python ~/.conky/conkython/cpu.py           }#
${cpubar cpu1 9,160}
${execpi 60   python ~/.conky/conkython/memory.py        }#
${execpi 60   python ~/.conky/conkython/storage.py       }#
${execpi 60   python ~/.conky/conkython/calendarConky.py }#
${execpi 60   python ~/.conky/conkython/clock.py         }#
${execpi 10   python ~/.conky/conkython/battery.py       }#

And this is an example of one of those scripts:

#!/bin/python
#
# calendarConky.py
#

from ConkyUtils import *

import calendar, time, re

Heading('Calendar')

nowYear  = time.localtime().tm_year
nowMonth = time.localtime().tm_mon
nowDate = str(time.localtime().tm_mday)

# Get the calendar printed out.
monthCalendar = calendar.TextCalendar(6).formatmonth(nowYear, nowMonth)

# highlight today's date.

regexDate = re.compile(r"\b"+nowDate+r"\b")
monthCalendar = regexDate.sub(GetColor('Highlight') + nowDate + GetColor('Calendar'),monthCalendar)

SetColor('Calendar')
SetFont('Mono',8)

print monthCalendar
exit(0)

This is the best example of why I like python. printing the calendar and highlighting today is possible in sh, but it doesn't look as nice.

This is the db that has the whole config:
http://dl.dropbox.com/u/1675101/jeffeb3.conky.tgz

Image:
http://dl.dropbox.com/u/1675101/jeffeb3.conky.jpg

I think it would be great if you could write everything in python, because there are python modules for everything. Unfortunatly, it's not there yet. You still have to know python and conky to debug anything...

Let me know what you think.

Offline

#661 2012-02-27 02:51:10

nablacksax
#! Member
From: Houghton, MI
Registered: 2011-08-26
Posts: 58

Re: Conky v1.9 Thread

Well this seems to be the best place on the forums to get conky help, so here goes:

I recently installed scrotwm on my laptop so I could play around with a tiling window manager. With scrotwm's lack of icons, I have begun to look for ways to get (almost) the same info from the status bar as I have with tint2 when running openbox. There are a few things I can't figure out or aren't sure about. Hopefully, there is someone that can answer my questions.

[SOLVED] (See Post 687)
1.) I was trying to get the mixer object added to my status bar so I could see my volume level. Looking at conky --version, I do not have ALSA Support, but can't figure out how to add it. I have found numerous people talking about recompiling conky with an alsa-enabled flag, but I am running conky from the repos and according to the documentation I have read, conky-all should have ALSA Support.

2.) Not sure if this is possible with the default scrotwm status bar, but I would like some sort of indicator of which workspaces have windows on them. Maybe something that looks like:

 [x] [x] [] [] [] [] [] [] [] [] 

where the "x" indicates open windows. Not sure conky can do this, but is there maybe a bash command  that I can use to figure out where my windows are? I don't need icons or a description of what is where, just a simple binary yes/no.

Concerning the scrotwm status bar:
I have heard good things about dzen2, but I would rather not have the extra bar running if I can help it.

Thanks for your help.

Last edited by nablacksax (2012-02-27 16:31:32)

Offline

#662 2012-02-27 03:03:15

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

jeffeb3 wrote:

Well, I installed #! Yesterday, and I love it. I want to share my conky. I wrote it for ubuntu, but most everything worked out ok. I based it off of the work of a guy names "crinos". But I don't like scripting in bash, or lua for that matter. So I made some scripting in python. I call it conkython. I've been thinking about posting the code on a project somewhere, so people can give me feedback, and even improve things themselves.

Let me know what you think.

Crinos512 is a legend!  His scripts are still used by some today.  Some no longer needed as there are native commands that do the same thing now but I still have his scripts here.  Love the radar thing he did for his "SunkenFortress" conky.

Yours looks good, grabbed the python scripts to look at - and I'm NOT a programmer!

Way I see it you have two options.

1. put your scripts here - they concern conky, or
2. Start a thread: jeffeb3 - Python for conky.

Do what Mark did on Ubuntu - for his python scripts.

And, last but certainly NOT least: Welcome to #!

Last edited by Sector11 (2012-02-27 03:27:03)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#663 2012-02-27 03:12:59

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

Re: Conky v1.9 Thread

@jeffeb3

Excellent work - liked it so much, I borrowed it big_smile

dt-IAHK.jpg


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

Offline

#664 2012-02-27 03:14:02

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

nablacksax wrote:

Well this seems to be the best place on the forums to get conky help, so here goes:

Thanks for your help.

Unfortunately you need someone that runs scrotwm as well, gutterslob I believe.  Check the monthly screenshot threads and find someone that used scrot and conky.

When, not 'if' because it will happen, you get the answer I hope you post it here.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#665 2012-02-27 03:24:48

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

I've been in and out all day so I started a project that just sat there while I was out.  New computer parts give me more power soooooooooooooo I reinvented SiNiSTeR's conky.  His was way to wide for my 1280 screen and I have 3 cores vs his 4 but I added two partitions, /media/5 and /media/6 the / and /home he had.

Here it is:
e09c62176963894.jpg

Conky:

## Conky script by Dragonias Edited by SuiCiDeSiNiSTeR ##
# killall conky && conky -c ~/conky/SiNiSTeR/sinister_conky &

total_run_times 0
background no
cpu_avg_samples 1                    
net_avg_samples 1
double_buffer yes
no_buffers yes
text_buffer_size 1024
out_to_console no
update_interval 1
alignment tl
#minimum_size 30 0
#maximum_width 1000
gap_x 10 # left-right
gap_y 240 # up-down
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no #yes   #################################    no
border_width 1
border_inner_margin 0
own_window yes
own_window_type normal
# own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
use_xft yes
xftalpha .8
override_utf8_locale yes
uppercase no
use_spacer right
default_bar_size 82 15

#default_color ffffff
#color1 64b4ff
#default_shade_color 303030
#default_outline_color white

###  Color Settings  #########################################################
default_shade_color grey
default_outline_color black

default_color DCDCDC #Gainsboro
color0 DAA520 #Goldenrod  FFFFF0 #Ivory
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
#####################################################  End Color Settings  ###

pad_percents 2
xftfont Anonymous Pro:size=9
# top_name_width 9
short_units yes

lua_load ~/conky/SiNiSTeR/clock_rings.lua
lua_draw_hook_post clock_rings

lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
 
 
TEXT
${voffset 145}${goto 305}${time %A, %d %B %Y}
${goto 305}${cpubar cpu0 1,170}
${goto 305}${time %T}
${voffset 20}${goto 300}HDD${goto 360}used ${fs_used} size ${fs_size}                        
${voffset 5}${goto 290}Kernel${goto 360}${kernel}
${voffset 5}${goto 280}Uptime${goto 360}${uptime}
${voffset 5}${goto 270}OS${goto 360}CrunchBang 10 - r20120207-amd64





${goto 20}${cpugraph cpu0 60,400 181818 ffffff}
${goto 568}RAM DDR3 ${freq} MHz
${goto 568}${cpubar cpu0 1,150}
${goto 568}In Use${goto 660}${mem}

${goto 564}Total${goto 660}${memmax}

${goto 560}Processes${goto 670}${running_processes}/ ${processes}
${goto 552}NAME${goto 657}MEM    CPU
${goto 545}${top_mem name 1}${goto 640}${top_mem mem 1} ${top_mem cpu 1}
${goto 535}${top_mem name 2} ${goto 640}${top_mem mem 2} ${top_mem cpu 2}
${goto 525}${top_mem name 3} ${goto 640}${top_mem mem 3} ${top_mem cpu 3}
${goto 505}${top_mem name 4} ${goto 640}${top_mem mem 4} ${top_mem cpu 4}
${goto 486}${top_mem name 5} ${goto 640}${top_mem mem 5} ${top_mem cpu 5}
${goto 465}${top_mem name 6} ${goto 640}${top_mem mem 6} ${top_mem cpu 6}



${goto 249}${execi 1800 cat /proc/cpuinfo | grep -n 'model name' |sed -n 1p | awk -F':' '{print $3}' | sed -e 's/^[ \t]*//'}
${goto 250}${cpubar cpu0 1,240}
${goto 254}Avg Use${goto 316}${cpu cpu0}%${goto 390}Freq  ${freq_g} GHz
${goto 253}Core 1 =${goto 316}${cpu cpu1}%${goto 390}Temp${goto 451}${hwmon 1 temp 1}°C
${goto 252}Core 2 =${goto 316}${cpu cpu2}%${goto 390}Fan${goto 435}${exec sensors | grep 'fan1:' | cut -c14-21}
${goto 251}Core 3 =${goto 316}${cpu cpu3}%${goto 390}Mem${goto 435}${memperc}%

clock_rings.lua

--[[
Clock Rings by londonali1010 (2009) Editted by SuiCiDeSiNiSTeR (2012)

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua 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 near the end of the script 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/clock_rings-v1.1.1.lua
    lua_draw_hook_pre clock_rings

Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]

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=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xffffff,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "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=150, y=155,
        -- "radius" is the radius of the ring.
        radius=55,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "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 than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=150, y=155,
        radius=73,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%M',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=150, y=155,
        radius=63,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xff0000,
        fg_alpha=0.5,
        x=150, y=155,
        radius=148,
        thickness=5,
        start_angle=0,
        end_angle=119
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0000ff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=148,
        thickness=5,
        start_angle=121,
        end_angle=239
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x00ff00,
        fg_alpha=0.5,
        x=150, y=155,
        radius=148,
        thickness=5,
        start_angle=241,
        end_angle=359
    },
        {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=140,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=125,
        thickness=3,
        start_angle=1 ,
        end_angle=89
    },
    {
        name='fs_used_perc',
        arg='/home',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=125,
        thickness=3,
        start_angle=91,
        end_angle=179
    },
    {
        name='fs_used_perc',
        arg='/media/5',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=125,
        thickness=3,
        start_angle=181,
        end_angle=269
    },
    {
        name='fs_used_perc',
        arg='/media/6',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=150, y=155,
        radius=125,
        thickness=3,
        start_angle=271,
        end_angle=359
    },
    {
        name='upspeedf',  --big center ring inner meter
        arg='eth0',
        max=3200,
        bg_colour=0xffffff, --red
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.3,
        x=400, y=425,
        radius=95,
        thickness=9,
        start_angle=10,
        end_angle=180
    },
    {
        name='downspeedf', --middle ring inner meter
        arg='eth0',
        max=3200,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.3,
        x=400, y=425,
        radius=84,
        thickness=9,
        start_angle=10,
        end_angle=180
    },
    {
        name='time', --middle ring meter
        arg='%M',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.3,
        x=400, y=425,
        radius=155,
        thickness=15,
        start_angle=80,
        end_angle=170
    },
    {
        name='time', --middle ring meter
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=400, y=425,
        radius=130,
        thickness=4,
        start_angle=0,
        end_angle=360
    },
    {
        name='time', --bottom cpu ring
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.3,
        x=50, y=675,
        radius=195,
        thickness=3,
        start_angle=80,
        end_angle=109
    },
    {
        name='cpu', --bottom cpu ring
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.7,
        x=50, y=675,
        radius=170,
        thickness=10,
        start_angle=-10,
        end_angle=170
    },
    {
        name='time', --bottom seconds ring
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.3,
        x=50, y=675,
        radius=140,
        thickness=3,
        start_angle=20,
        end_angle=116
    },
    {
        name='cpu', --bottom inner cpu ring
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=120,
        thickness=5,
        start_angle=50,
        end_angle=140
    },
    {
        name='cpu', --bottom inner cpu ring
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=113,
        thickness=5,
        start_angle=50,
        end_angle=140
    },
    {
        name='cpu', --bottom inner cpu ring
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=50, y=675,
        radius=85,
        thickness=9,
        start_angle=-5,
        end_angle=155
    },
        
}

-- Use these settings to define the origin and extent of your clock.

clock_r=140

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=150
clock_y=155

-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

-- Do you want to show the seconds hand?

show_seconds=true

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 draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys

    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")

    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12

    -- Draw hour hand

    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
    cairo_stroke(cr)

    -- Draw minute hand

    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)

    cairo_set_line_width(cr,3)
    cairo_stroke(cr)

    -- Draw seconds hand

    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)

        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    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

    -- Check that Conky has been running for at least 5s

    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

    draw_clock_hands(cr,clock_x,clock_y)
end

draw-bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT - requires a composite manager or it blinks.

 lua_load ~/wea_conky/draw_bg.lua
 TEXT
 ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

OR Both above TEXT (No composite manager required - no blinking!)

 lua_load ~/wea_conky/draw_bg.lua
 lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
 TEXT

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
  See below:        1  2 3 4 5 6        7 

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
3 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) 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)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end

Thank you SiNiSTeR!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#666 2012-02-27 03:25:12

nablacksax
#! Member
From: Houghton, MI
Registered: 2011-08-26
Posts: 58

Re: Conky v1.9 Thread

@Sector11, I already have conky running in scrotwm. I am just trying to configure it to do those two additional things. The issues are purely conky related, not conky + scrotwm.

Offline

#667 2012-02-27 03:56:24

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

Re: Conky v1.9 Thread

@nablacksax

For what you're trying to do, I think you are going to have to go with a bash (python, perl) script for your status bar rather than have it as bash scripts being called by conky. In he screenshot, the status bar is displaying a bash script - no conky:

february13303145341600x900.jpg

in the .scrotwm.conf

bar_action = ~/bin/ScrotBar.sh

A good place to look/ask are the Arch Linux Wiki and Forums - no shortage of script kiddies over there.

Another option would be a tiling window manager with a system tray (for the volume etc ...) like i3-wm or wmfs.


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

Offline

#668 2012-02-27 04:02:08

nablacksax
#! Member
From: Houghton, MI
Registered: 2011-08-26
Posts: 58

Re: Conky v1.9 Thread

@PackRat, I have my conky in the status bar and that is all good. (Would post a screenshot, but I haven't decided on an image hosting site yet, but that's another story...). I am willing to give up on my 2nd question for now, but maybe you or someone else can help me get ALSA support for conky, like I described in question 1? I would really like to be able to use the ${mixer} object in my conky script.

Offline

#669 2012-02-27 04:16:44

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

Re: Conky v1.9 Thread

^ Is this what you are looking for with ${mixer}?


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#670 2012-02-27 04:17:28

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

nablacksax wrote:

@Sector11, I already have conky running in scrotwm. I am just trying to configure it to do those two additional things. The issues are purely conky related, not conky + scrotwm.

Sorry I mis-understood.

nablacksax wrote:

1.) I was trying to get the mixer object added to my status bar so I could see my volume level. Looking at conky --version, I do not have ALSA Support, but can't figure out how to add it. I have found numerous people talking about recompiling conky with an alsa-enabled flag, but I am running conky from the repos and according to the documentation I have read, conky-all should have ALSA Support.

mixer should work for you:

3af78a176967849.jpg

# killall conky && conky -c ~/conky/test206 &
#
##############################################
#  Settings
##############################################
background yes
use_xft yes
xftfont Monospace:size=12
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_colour grey20
own_window_type override
own_window_title Infos System
double_buffer yes

draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_inner_margin 0
border_width 1
draw_graph_borders no

default_color DCDCDC #Gainsboro
color0 FFFFF0 #Ivory
color1 CCCCCC #Marks Grey 778899 #LightSlateGrey
color2 7095BB #Marks Blue #FF8C00 #Darkorange
color3 C6FF8E #Light Green #FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

default_shade_color grey20
default_outline_color white
default_bar_size 100 3
no_buffers yes
uppercase no
text_buffer_size 1024
imlib_cache_size 0
cpu_avg_samples 2
show_graph_scale no
show_graph_range no
short_units yes
override_utf8_locale yes
use_spacer none
if_up_strictness address

## own_window_argb_visual yes
alignment tl
gap_x 100
gap_y 100

minimum_size 300 0
maximum_width 300
TEXT

     Vol: ${if_match ${mixer}!=0}${mixer}${else}--${endif}
Real Vol: ${mixer}
  01:05:49 ~
         $ conky --version
Conky 1.8.1 compiled Wed Sep  7 23:22:15 UTC 2011 for Linux 3.0.0-1-amd64 (x86_64)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

 X11:
  * Xdamage extension
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual

 Music detection:
  * Audacious
  * MPD
  * MOC
  * XMMS2

 General:
  * math
  * hddtemp
  * portmon
  * Curl
  * RSS
  * Weather (METAR)
  * Weather (XOAP)
  * wireless
  * support for IBM/Lenovo notebooks
  * nvidia
  * eve-online
  * config-output
  * Imlib2
  * apcupsd
  * iostats
  * ncurses
  * Lua

  Lua bindings:
   * Cairo
   * Imlib2

  01:05:56 ~
         $ 

No ALSA in there either but it is what I use!

The desktop thing I don't know about, there are only three commands:

desktop = the # of the desktop you are on
desktop_name = the name
desktop_number = total number of desktops

So I'm guessing a bash script - if OpenBox can do this ... there has to be a way...
49f9dc176967904.jpg

We need a bash writer!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#671 2012-02-27 04:20:17

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

VastOne wrote:

^ Is this what you are looking for with ${mixer}?

lol lol DOH!!! lol lol
Forgot about that! But used the same test conky  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#672 2012-02-27 04:22:36

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

Re: Conky v1.9 Thread

^ LOLZ  I did a search of

${mixer} object in my conky script

and that came up on the first hit...


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#673 2012-02-27 04:29:40

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

^^ go figure roll!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#674 2012-02-27 04:30:53

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

Re: Conky v1.9 Thread

^WOW

5K...  big time!

The #! community is lucky to have you here...

(I have a gold watch around here somewhere...)

marc-ecko-prez-gold-watch.jpg


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

Be excellent to each other!

#675 2012-02-27 04:40:30

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

VastOne wrote:

^WOW

5K...  big time!

The #! community is lucky to have you here...

POP! FIZZZ! Pour - sip --- ahhhhhhhhhhhhh!!!
Dom Pérignon - Only the best will do!

Problem is 3500 of those are in the conky thread.  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo