Page 2081 of 2299 FirstFirst ... 1081158119812031207120792080208120822083209121312181 ... LastLast
Results 20,801 to 20,810 of 22988

Thread: Post your .conkyrc files w/ screenshots

  1. #20801
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Jedcurtis View Post
    To borrow an expression from Sector11, I "cough-cough" copied this conky from him, after he borrowed it "cough-cough" from the Voyager Linux site.

    I'm getting the same error that Sector11 is getting in the terminal. The error repeats twice then never again. I say 'never again' loosely since for me that meant running it for around 12 hours without terminal showing the error again. I've attached some pic's for your perusal.
    a good idea for future - put errors and code segments in post in code brackets
    so they can be quoted/copied/altered/pasted

    line 203 that reads
    Code:
    local val = value % (max_value +1)
    if you want to get rid of the error, change to
    Code:
    local val = (value % (max_value +1)) or 0
    sometimes it takes conky a couple of cycles to return value via conky_parse in lua scripts, hence the nil value errors

    actually this will get rid of the error
    Code:
    local val = (value or 0) % (max_value +1)
    or find where "value" is first set and change that accordingly
    Last edited by mrpeachy; October 17th, 2012 at 01:40 AM.

  2. #20802
    Join Date
    Aug 2010
    Location
    Detachment 7
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    @mrpeachy, I'll do that from now on. Matter of fact, that'll be easier than the screenshots anyway!

    I was so close to having it solved on my own... I had done the thing with the parenthesis, however I did not add the 'or 0'. I'll give it a try, and thanks for the help...

    And, voila!

    Code:
    local val = (value or 0) % (max_value +1)
    That solves the issue!!!

    Mrpeachy, I'd give anything to have just a 'pinch' of your skills!!!

    Jed
    Last edited by Jedcurtis; October 17th, 2012 at 01:48 AM.
    | [I]Running 'VSIDO' | My blog |

  3. #20803
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    a good idea for future - put errors and code segments in post in code brackets
    so they can be quoted/copied/altered/pasted

    line 203 that reads
    Code:
    local val = value % (max_value +1)
    if you want to get rid of the error, change to
    Code:
    local val = (value % (max_value +1)) or 0
    sometimes it takes conky a couple of cycles to return value via conky_parse in lua scripts, hence the nil value errors
    No that didn't work:

    Code:
      16 Oct 12 | 21:32:41 ~
             $ Conky: llua_load: /home/sector11/.conky/conky6/conky_HUD2.lua:214: malformed number near '1local'
    Conky: desktop window (322) is root window
    Conky: window type - normal
    Conky: drawing to created window (0x1c00002)
    Conky: drawing to double buffer
    Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
    Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
    Conky: received SIGINT or SIGTERM to terminate. bye!
    Code:
        -- arc of value
    --    local val = value % (max_value +1)
        local val = (value % (max_value +1)) or 0
        local start_arc = 0
        local stop_arc = 0
        local i = 1
        while i <= val do
    BTW, the original code has that on line 162 (I added 3 cpu values):

    Code:
        -- arc of value
        local val = value % (max_value + 1)
        local start_arc = 0
        local stop_arc = 0
        local i = 1
        while i <= val do

  4. #20804
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Jedcurtis View Post
    @mrpeachy, I'll do that from now on. Matter of fact, that'll be easier than the screenshots anyway!

    I was so close to having it solved on my own... I had done the thing with the parenthesis, however I did not add the 'or 0'. I'll give it a try, and thanks for the help...

    And, voila!

    Code:
    local val = (value or 0) % (max_value +1)
    That solves the issue!!!

    Mrpeachy, I'd give anything to have just a 'pinch' of your skills!!!

    Jed
    I'd give a pinch for yours. I didn't even see this until after I posted mine

  5. #20805
    Join Date
    Oct 2012
    Beans
    18

    Re: Post your .conkyrc files w/ screenshots

    *EDIT: MUCH THANKS AND PRAISE TO ALL THOSE WHOSE WORK I'M PIRATING!!!! I'M HOPING TO BE ABLE TO WRITE MY OWN STUFF SOMEDAY!!!*
    Hey all.
    I'm getting my confidence up little by little with this programming stuff. I still have LIGHT YEARS to go though. But currently I'm trying to patch together my own custom conky by grabbing bits and pieces of other peoples and putting them together all frankenstein-like. I'm having an issue with my lua script that i just started on and was looking for somebody to look it over for me. First, this is the error i receive upon typing conky into terminal -

    Code:
    Conky: llua_load: /home/moralanarchy/.scripts/Conky/conky_widgets.lua:28: attempt to call global 'ring' (a nil value)
    -then it just goes over and over with the 'llua_do_call:.......... call a nil value' I will attach my lua (it's probably royally jacked up but, meh, I'm winging it) and I'm hoping somebody can point out where it's messed up to me.

    Code:
    --[[
    Conky Widgets by londonali1010 (2009)
    
    This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
    
    To configure:
    + Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
    + To call the widget, add the following just before the last "end" of the entire script:
        cr = cairo_create(cs)
        NAME_OF_FUNCTION(cr, OPTIONS)
        cairo_destroy(cr)
    + Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/.scripts/Conky/conky_widgets.lua):
        lua_load ~/scripts/Conky/conky_widgets.lua
        lua_draw_hook_pre widgets
        
    Changelog:
    + v1.0 -- Original release (17.10.2009)
    ]]
    
    require 'cairo'
    require 'imlib2'
    
    -------------------[[ STORAGE RINGS SETTINGS ]]---------------
    
        cr = cairo_create(cs)
        ring(cr, 'fs_used_perc', '/media/AHD0', 100, 0xFFFF00, 0.3, 0xFF0000, 1, 260, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
        cairo_destroy(cr)
    
        
    
        cr = cairo_create(cs)
        ring(cr, 'fs_used_perc', '/media/2E48-9992', 100, 0xFFFF00, 0.3, 0xFF5A00, 1, 460, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
        cairo_destroy(cr)
    
        
    
        cr = cairo_create(cs)
        ring(cr, 'fs_used_perc', '/media/AHD1', 100, 0xFFFF00, 0.3, 0xFFFF00, 1, 660, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
        cairo_destroy(cr)
    
    -------------------[[ END STORAGE RINGS SETTINGS ]]---------------
    
    -------------------[[ CLOCK RINGS SETTINGS ]]---------------
    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=870, y=148,
            -- "radius" is the radius of the ring.
            radius=50,
            -- "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 (e.g. more clockwise) than start_angle.
            end_angle=360
        },
        {
            name='time',
            arg='%M.%S',
            max=60,
            bg_colour=0xffffff,
            bg_alpha=0.1,
            fg_colour=0x4a89a7,
            fg_alpha=0.4,
            x=870, y=148,
            radius=56,
            thickness=5,
            start_angle=0,
            end_angle=360
        },
        {
            name='time',
            arg='%S',
            max=60,
            bg_colour=0xffffff,
            bg_alpha=0.1,
            fg_colour=0xe83737,
            fg_alpha=0.6,
            x=870, y=148,
            radius=62,
            thickness=5,
            start_angle=0,
            end_angle=360
        },
        {
            name='swapperc',
            arg='',
            max=100,
            bg_colour=0xffffff,
            bg_alpha=0,
            fg_colour=0xffffff,
            fg_alpha=0.1,
            x=870, y=148,
            radius=70,
            thickness=5,
            start_angle=60,
            end_angle=120
        },
        {
            name='memperc',
            arg='%m',
            max=100,
            bg_colour=0xffffff,
            bg_alpha=0.1,
            fg_colour=0xebff46,
            fg_alpha=0.6,
            x=870, y=148,
            radius=72,
            thickness=11,
            start_angle=122,
            end_angle=210
        },
        {
            name='fs_used_perc',
            arg='/media/AHD0',
            max=100,
            bg_colour=0xffffff,
            bg_alpha=0.1,
            fg_colour=0xebff46,
            fg_alpha=0.8,
            x=870, y=148,
            radius=83.5,
            thickness=8,
            start_angle=122,
            end_angle=210
        },
        {
            name='time',
            arg='%d',
            max=31,
            bg_colour=0xffffff,
            bg_alpha=0.1,
            fg_colour=0xebff46,
            fg_alpha=0.8,
            x=870, y=148,
            radius=70,
            thickness=5,
            start_angle=212,
            end_angle=360
        },
        {
            name='time',
            arg='%m',
            max=12,
            bg_colour=0xffffff,
            bg_alpha=0.1,
            fg_colour=0xf4732d,
            fg_alpha=0.8,
            x=870, y=148,
            radius=76,
            thickness=5,
            start_angle=212,
            end_angle=360
        },
        {
            name='cpu',
            arg='cpu0',
            max=100,
            bg_colour=0xb7b7b7,
            bg_alpha=0.5,
            fg_colour=0x46a646,
            fg_alpha=1.0,
            x=870, y=148,
            radius=120,
            thickness=17,
            start_angle=-90,
            end_angle=30
        },
            {
            name='cpu',
            arg='cpu1',
            max=100,
            bg_colour=0xb7b7b7,
            bg_alpha=0.2,
            fg_colour=0x46a646,
            fg_alpha=1.0,
            x=870, y=148,
            radius=116,
            thickness=17,
            start_angle=82,
            end_angle=180
        },
        {
            name='fs_used_perc',
            arg='/home',
            max=100,
            bg_colour=0xffffff,
            bg_alpha=0.5,
            fg_colour=0xffffff,
            fg_alpha=0.6,
            x=870, y=148,
            radius=95,
            thickness=5,
            start_angle=0,
            end_angle=90
        },
    }
    
    
    clock_r=125
    
    
    
    clock_x=870
    clock_y=148
    
    
    
    clock_colour=0xffffff
    clock_alpha=0.5
    
    
    
    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)
    
        
    
        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)
    
        
    
        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
    
        
    
        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)
    
        
    
        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)
    
        
    
        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
    
        
    
        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
    -------------------[[ END CLOCK RINGS SETTINGS ]]---------------
    -------------------[[ RING WIDGET ]]-------------
    --[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
        "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        "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 ''.
        "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        "bg_colour" is the colour of the base ring.
        "bg_alpha" is the alpha value of the base ring.
        "fg_colour" is the colour of the indicator part of the ring.
        "fg_alpha" is the alpha value of the indicator part of the ring.
        "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.
        "radius" is the radius of the ring.
        "thickness" is the thickness of the ring, centred around the radius.
        "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        "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. ]]
    
    function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
        local function rgb_to_r_g_b(colour,alpha)
            return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
        end
        
        local function draw_ring(pct)
            local angle_0=sa*(2*math.pi/360)-math.pi/2
            local angle_f=ea*(2*math.pi/360)-math.pi/2
            local pct_arc=pct*(angle_f-angle_0)
    
            -- Draw background ring
    
            cairo_arc(cr,xc,yc,r,angle_0,angle_f)
            cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
            cairo_set_line_width(cr,t)
            cairo_stroke(cr)
        
            -- Draw indicator ring
    
            cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
            cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
            cairo_stroke(cr)
        end
        
        local function setup_ring()
            local str = ''
            local value = 0
            
            str = string.format('${%s %s}', name, arg)
            str = conky_parse(str)
            
            value = tonumber(str)
            if value == nil then value = 0 end
            pct = value/max
            
            draw_ring(pct)
        end    
        
        local updates=conky_parse('${updates}')
        update_num=tonumber(updates)
        
        if update_num>5 then setup_ring() end
    end
    
    ----------------[[ END RING WIDGET ]]---------------
    Here's my conkyrc incase you need that too:

    Code:
    background yes
    own_window yes
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    # own_window_class conky
    use_xft yes
    #xftfont ariel:size=8
    xftfont MgOpen Modata-07
    xftalpha 1.0 #0.2
    override_utf8_locale yes
    update_interval 1
    total_run_times 0
    double_buffer yes
    no_buffers yes
    cpu_avg_samples 1
    net_avg_samples 2
    use_spacer left
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    alignment tr
    uppercase no
    imlib_cache_size 0
    
    minimum_size 1024 2500
    #maximum_width 1024 
    
    gap_x 0 # left-right
    gap_y 0 # up-down
    border_inner_margin 0
    border_outer_margin 0
     
    # Colors
    default_color 00BFFF #DeepSkyBlue
    color0 FFD700 #Gold  #7FFFD4 #Aquamarine
    color1 FFA07A #LightSalmon #CD5C5C IndianRed #00CED1 DarkTurquoise #00FFFF Cyan
    color2 FF8C00 #Darkorange
    color3 7FFF00 #Chartreuse
    color4 778899 #LightSlateGrey
    color5 FFDEAD #NavajoWhite
    color6 00BFFF #DeepSkyBlue
    color7 48D1CC #MediumTurquoise
    color8 FFFF00 #Yellow
    color9 FF0000 #Red
    text_buffer_size 6144 # 256 is the minimum
    short_units yes
    
    # -- Lua Load -- #
    lua_load ~/.scripts/Conky/conky_widgets.lua
    lua_draw_hook_pre widgets
    
    TEXT
    #------------------------External Storage--------------------------#
    #------------------------Alex's Harddrive--------------------------#
    ${voffset -138}${goto 237}${color yellow}AHD0
    ${color} ${if_existing /media/AHD0}
    ${voffset 00}${goto 225}${fs_used /media/AHD0}
    ${color yellow} of${color} ${fs_size /media/AHD0}
    ${voffset 00}${goto 248}${color green}used
    ${else}${voffset 20}${goto 224}${color8} NOT MOUNTED${voffset 40}${endif}${color}
    #------------------------Thumb Drive--------------------------#
    ${voffset -48}${goto 637}${color yellow}2E48-9992
    ${color} ${if_existing /media/2E48-9992}
    ${voffset 00}${goto 623}${fs_used /media/2E48-9992}
    ${color yellow} of${color} ${fs_size /media/2E48-9992}
    ${voffset 00}${goto 647}${color green}used
    ${else}${voffset 20}${goto 622}${color8} NOT MOUNTED${voffset 15}${endif}${color}
    #------------------------Alex's Harddrive 2--------------------------#
    ${voffset -72}${goto 435}${color yellow}AHD1
    ${color} ${if_existing /media/AHD1}
    ${voffset 00}${goto 425}${fs_used /media/AHD1}
    ${color yellow} of${color} ${fs_size /media/AHD1}
    ${voffset 00}${goto 448}${color green}used
    ${else}${voffset 20}${goto 422}${color8} NOT MOUNTED${voffset 16}${endif}${color}
    Last edited by MoralAnarchy; October 17th, 2012 at 07:50 AM. Reason: Thanks to the creators

  6. #20806
    Join Date
    Feb 2011
    Location
    Somewhere...
    Beans
    1,543
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Post your .conkyrc files w/ screenshots

    @MoralAnarchy: I see that you are using londonali's Ring and Clock Hands along with the Widget Block. I don't really know what you put inside your lua script (it looks like a royal mess, no offense ), but the 'proper' way to use the Conky Widget script is to use the whatever_wb.txt files that comes with the Rings and Clock Hands with it. Here's my lua script for you to use:
    Code:
    --[[
    Conky Widgets by londonali1010 (2009)
    
    This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
    
    To configure:
    + Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
    + To call the widget, add the following between "cr = cairo_create(cs)" and "cairo_destroy(cr)" at the end of the script:
    	NAME_OF_FUNCTION(cr, OPTIONS)
    + Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    	lua_load ~/scripts/conky_widgets.lua
    	lua_draw_hook_pre widgets
    	
    Changelog:
    + v1.1 -- Simplified calls to widgets by implementing a global drawing surface, and included imlib2 by default (03.11.2009)
    + v1.0 -- Original release (17.10.2009)
    ]]
    
    require 'cairo'
    require 'imlib2'
    --[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
    	"name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    	"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 ''.
    	"max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    	"bg_colour" is the colour of the base ring.
    	"bg_alpha" is the alpha value of the base ring.
    	"fg_colour" is the colour of the indicator part of the ring.
    	"fg_alpha" is the alpha value of the indicator part of the ring.
    	"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.
    	"radius" is the radius of the ring.
    	"thickness" is the thickness of the ring, centred around the radius.
    	"start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    	"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. ]]
    
    function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    	local function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    	
    	local function draw_ring(pct)
    		local angle_0=sa*(2*math.pi/360)-math.pi/2
    		local angle_f=ea*(2*math.pi/360)-math.pi/2
    		local pct_arc=pct*(angle_f-angle_0)
    
    		-- Draw background ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_f)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    		cairo_set_line_width(cr,t)
    		cairo_stroke(cr)
    	
    		-- Draw indicator ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    	end
    	
    	local function setup_ring()
    		local str = ''
    		local value = 0
    		
    		str = string.format('${%s %s}', name, arg)
    		str = conky_parse(str)
    		
    		value = tonumber(str)
    		if value == nil then value = 0 end
    		pct = value/max
    		
    		draw_ring(pct)
    	end	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then setup_ring() end
    end
    
    --[[ Options (xc, yc, colour, alpha, show_secs, size):
    	"xc" and "yc" are the x and y coordinates of the centre of the clock hands, in pixels, relative to the top left corner of the Conky window
    	"colour" is the colour of the clock hands, in OxFFFFFF formate
    	"alpha" is the alpha of the hands, between 0 and 1
    	"show_secs" is a boolean; set to TRUE to show the seconds hand, otherwise set to FALSE
    	"size" is the total size of the widget (e.g. twice the length of the minutes hand), in pixels ]]
    
    function clock_hands(cr, xc, yc, colour, alpha, show_secs, size)
    	local function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    	
    	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
    
    	xh=xc+0.4*size*math.sin(hours_arc)
    	yh=yc-0.4*size*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(colour,alpha))
    	cairo_stroke(cr)
    
    	xm=xc+0.5*size*math.sin(mins_arc)
    	ym=yc-0.5*size*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)
    
    	if show_secs then
    		xs=xc+0.5*size*math.sin(secs_arc)
    		ys=yc-0.5*size*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_widgets()
    	if conky_window == nil then return end
    	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    	cr = cairo_create(cs)
    	clock_hands(cr, 830, 200, 0x000000, 0.5, true, 200)
    	ring(cr, 'cpu', 'cpu0', 100, 0x000000, 0.1, 0x000000, 0.5, 830, 200, 75, 8, -40, 40)
            ring(cr, 'time', '%S', 60, 0x000000, 0.1, 0x000000, 0.5, 830, 200, 62, 5, 0, 360)
    	ring(cr, 'memperc', '', 100, 0x000000, 0.1, 0x000000, 0.5, 830, 200, 75, 8, 190, 300)
    	ring(cr, 'swapperc', '', 100, 0x000000, 0.1, 0x000000, 0.5, 830, 200, 75, 8, 60, 170)
    	ring(cr, 'battery_percent', 'BAT0', 100, 0x000000, 0.1, 0x000000, 0.3, 830, 200, 100, 20, 120, 240)
    	ring(cr, 'fs_used_perc', '/', 100, 0x000000, 0.1, 0x000000, 0.2, 830, 200, 150, 40, -100, 100)
    	ring(cr, 'mpd_percent', '', 100, 0x000000, 0.1, 0x000000, 0.4, 830, 200, 100, 15, -40, 40)
    	ring(cr, 'entropy_perc', '', 100, 0x000000, 0.1, 0x000000, 0.3, 830, 200, 123, 5, -20, 20)
    	cairo_destroy(cr)
    end
    Like the script suggested, put the functions that defines the ring between the command cr = cairo_create(cs) and cairo_destroy(cr). The functions in this script is for my computer, so modify them to suit you.

  7. #20807
    Join Date
    Oct 2012
    Beans
    18

    Re: Post your .conkyrc files w/ screenshots

    thank you for the advice! haha. yeah i think i've bitten off a little more than i can chew. i'm loving this stuff but i need to get a whooooooole lot more proficient at it. i think i'll take that lua you posted and see what i can do with it step by step. thank mate.

  8. #20808
    Join Date
    Aug 2010
    Location
    Detachment 7
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    How cool is this? Just found out one of my conkys, (cough-cough) was being 'featured' on the Conky Pitstop site. Way awesome! This is what happens when you learn how to "Ctrl-C and Ctrl-V"! (maybe a little Ctrl-X as well!) Thanks for the nod Sector11.

    Actual 'Featured' link. (this link wont last forever obviously! No one gets featured forever!)hehe

    Speaking of Sector11, here's one he found/borrowed from over at the Voyager Linux site. I just made a couple little changes with the colors and size and such! (That is, the "Rings/Clock/info Rings" on the right side of the screen-shot I've attached at the bottom). Sector11, you've been tremendously patient, and more importantly, FRIENDLY! I really appreciate all your help and kind words! Isn't it amazing the whole world isn't using Linux? (Thanks also to 'mrpeachy' for help resolving an error with the script.)

    The weather script is courtesy of 'arclance'! Click on his name to get a direct link to his scripts and instructions. Asking me questions about 'how-to' with his scripts would be like asking a chimp to fly you to your next vacation destination! I'll probably crash and burn your stuff! If I can figure it out, in other words, it should be simple for you.

    The 'album/currently playing/lyrics', on the left is courtesy of VastOne's advice to use gmusicbrowser. IMO this should be the default music player for Ubuntu! His 'how-to' link above (click his name) is fantastically easy to read and follow!

    The rss-ticker at the top is just that, the Tickr-Feedreader configured easily enough with some of my favorite news sites.

    The .tar.gz file for the clock conky can be grabbed here. You'll have to make obvious changes, probably, for your particular set-up. My screen resolution is 1920x1080. If yours is less than that it'll obviously look gigantic. Do what I did, experiment till you find the size that suits you. Make sure in the lua and conkyrc files you change things to match your own /home/"User-Name" path. (without the quotes of course!)

    I've read literally hundreds if not thousands of posts to figure all this out, and still had to have help with aspects of it from the very friendly folks on various Linux (i.e. #!CrunchBang Linux Forums) related forums. Google is your friend! "Search and ye shall find" or something like that.

    So there, between the Conky Pitstop and the info in this post, you've got 3 fabulous conky's to play with! Enjoy...

    Thanks,
    Jed

    PS, Way more than 3 if you count all the ones at CPS and the other sites mentioned in this post! I've also posted this 'post' on my blog-site! Everyone should know about this stuff, and how nice Linux can be, not just to use, but to look at as well...
    Attached Images Attached Images
    Last edited by Jedcurtis; October 18th, 2012 at 11:22 PM.
    | [I]Running 'VSIDO' | My blog |

  9. #20809
    Join Date
    Jul 2012
    Beans
    395
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Post your .conkyrc files w/ screenshots

    Thanks for net code Sector11

  10. #20810
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    @ Jedcurtis

    Thank you. It's been a pleasure helping you. Love the blue theme of arclance's weather. I gotta look at that some day and see if I can make it 'smaller'. I just have too much on my plate at the moment with other thinks ... life being a biggie at the moment.

Page 2081 of 2299 FirstFirst ... 1081158119812031207120792080208120822083209121312181 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •