Page 1709 of 2328 FirstFirst ... 7091209160916591699170717081709171017111719175918092209 ... LastLast
Results 17,081 to 17,090 of 23277

Thread: Post your .conkyrc files w/ screenshots

  1. #17081
    Join Date
    Nov 2009
    Location
    Assen, Netherlands
    Beans
    14
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Post your .conkyrc files w/ screenshots

    I have a pretty standard Ubuntu with 4 workspaces.
    Conky is running and visible on all 4 of them, is it possible to let Conky be visible on just one? And if yes, how do I do that?

  2. #17082
    Join Date
    Feb 2009
    Beans
    428

    Re: Post your .conkyrc files w/ screenshots

    ignore this
    Last edited by Arminius; April 17th, 2011 at 09:35 AM. Reason: double posted and I don't know how to delete this post?

  3. #17083
    Join Date
    Feb 2009
    Beans
    428

    Re: Post your .conkyrc files w/ screenshots

    42dorian
    Not in Conky, you can't. Though, I imagine that's a challenge for the lua guys to toy with for a while. (Probably not in the sense of it being difficult, but certainly in the sense of putting forth a test of their abilities. A Dare or Competition with their own inner coder, if you will.)
    if they have nothing better to do it would be great, I was wanting to keep the horizontal one long term, or even longer say over an hour, and a vertical one that's much shorter, like 5 mins

  4. #17084
    Join Date
    Feb 2011
    Beans
    31
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by alpetjr View Post
    I have been trying for days now to try to get a clock in my conky. I have read and done what I have read in the forum but nothing seems to work. Can someone give me a hand with this. Thanks
    # !/bin/sh
    # clock.sh
    Code:
    # Written by Crinos512
    # Original concept by t-mo_
    #
    # Usage: ${execpi 20 ~/scripts/clock.sh hour}
    #         - or -
    #        ${execpi 20 ~/scripts/clock.sh minute}
    
    #Hour
    case "$1" in
    'hour')
      HOUR=`date +%H`
      MINUTE=`date +%M`
      case $HOUR in
        00 | 12)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "A" ;;
            1[3-9] | 2[0-2]) echo "B" ;;
            2[3-9] | 3[0-5]) echo "C" ;;
            3[6-9] | 4[0-8]) echo "D" ;;
            49 | 5[0-9]) echo "E" ;;
            *) echo "ERROR in Hour mod 00"   ;;
          esac
          ;;
        01 | 13)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "F" ;;
            1[3-9] | 2[0-2]) echo "G" ;;
            2[3-9] | 3[0-5]) echo "H" ;;
            3[6-9] | 4[0-8]) echo "I" ;;
            49 | 5[0-9]) echo "J" ;;
            *) echo "ERROR in Hour mod 01"   ;;
          esac
          ;;
        02 | 14)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "K" ;;
            1[3-9] | 2[0-2]) echo "L" ;;
            2[3-9] | 3[0-5]) echo "M" ;;
            3[6-9] | 4[0-8]) echo "N" ;;
            49 | 5[0-9]) echo "O" ;;
            *) echo "ERROR in Hour mod 02"   ;;
          esac
          ;;
        03 | 15)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "P" ;;
            1[3-9] | 2[0-2]) echo "Q" ;;
            2[3-9] | 3[0-5]) echo "R" ;;
            3[6-9] | 4[0-8]) echo "S" ;;
            49 | 5[0-9]) echo "T" ;;
            *) echo "ERROR in Hour mod 03"   ;;
          esac
          ;;
        04 | 16)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "U" ;;
            1[3-9] | 2[0-2]) echo "V" ;;
            2[3-9] | 3[0-5]) echo "W" ;;
            3[6-9] | 4[0-8]) echo "X" ;;
            49 | 5[0-9]) echo "Y" ;;
            *) echo "ERROR in Hour mod 04"   ;;
          esac
          ;;
        05 | 17)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "Z" ;;
            1[3-9] | 2[0-2]) echo "a" ;;
            2[3-9] | 3[0-5]) echo "b" ;;
            3[6-9] | 4[0-8]) echo "c" ;;
            49 | 5[0-9]) echo "d" ;;
            *) echo "ERROR in Hour mod 05"   ;;
          esac
          ;;
        06 | 18)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "e" ;;
            1[3-9] | 2[0-2]) echo "f" ;;
            2[3-9] | 3[0-5]) echo "g" ;;
            3[6-9] | 4[0-8]) echo "h" ;;
            49 | 5[0-9]) echo "i" ;;
            *) echo "ERROR in Hour mod 06"   ;;
          esac
          ;;
        07 | 19)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "j" ;;
            1[3-9] | 2[0-2]) echo "k" ;;
            2[3-9] | 3[0-5]) echo "l" ;;
            3[6-9] | 4[0-8]) echo "m" ;;
            49 | 5[0-9]) echo "n" ;;
            *) echo "ERROR in Hour mod 07"   ;;
          esac
          ;;
        08 | 20)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "o" ;;
            1[3-9] | 2[0-2]) echo "p" ;;
            2[3-9] | 3[0-5]) echo "q" ;;
            3[6-9] | 4[0-8]) echo "r" ;;
            49 | 5[0-9]) echo "s" ;;
            *) echo "ERROR in Hour mod 08"   ;;
          esac
          ;;
        09 | 21)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "t" ;;
            1[3-9] | 2[0-2]) echo "u" ;;
            2[3-9] | 3[0-5]) echo "v" ;;
            3[6-9] | 4[0-8]) echo "w" ;;
            49 | 5[0-9]) echo "x" ;;
            *) echo "ERROR in Hour mod 09"   ;;
          esac
          ;;
        10 | 22)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "y" ;;
            1[3-9] | 2[0-2]) echo "z" ;;
            2[3-9] | 3[0-5]) echo "1" ;;
            3[6-9] | 4[0-8]) echo "2" ;;
            49 | 5[0-9]) echo "3" ;;
            *) echo "ERROR in Hour mod 10"   ;;
          esac
          ;;
        11 | 23)
          case $MINUTE in
            0[0-9] | 1[0-2]) echo "4" ;;
            1[3-9] | 2[0-2]) echo "5" ;;
            2[3-9] | 3[0-5]) echo "6" ;;
            3[6-9] | 4[0-8]) echo "7" ;;
            49 | 5[0-9]) echo "8" ;;
            *) echo "ERROR in Hour mod 11"   ;;
          esac
          ;;
         *) echo "ERROR finding Hour"   ;;
      esac
      ;;
    
    'minute')
      MINUTE=`date +%M`
      case $MINUTE in
        00) echo "A" ;;
        01) echo "B" ;;
        02) echo "C" ;;
        03) echo "D" ;;
        04) echo "E" ;;
        05) echo "F" ;;
        06) echo "G" ;;
        07) echo "H" ;;
        08) echo "I" ;;
        09) echo "J" ;;
        10) echo "K" ;;
        11) echo "L" ;;
        12) echo "M" ;;
        13) echo "N" ;;
        14) echo "O" ;;
        15) echo "P" ;;
        16) echo "Q" ;;
        17) echo "R" ;;
        18) echo "S" ;;
        19) echo "T" ;;
        20) echo "U" ;;
        21) echo "V" ;;
        22) echo "W" ;;
        23) echo "X" ;;
        24) echo "Y" ;;
        25) echo "Z" ;;
        26) echo "a" ;;
        27) echo "b" ;;
        28) echo "c" ;;
        29) echo "d" ;;
        30) echo "e" ;;
        31) echo "f" ;;
        32) echo "g" ;;
        33) echo "h" ;;
        34) echo "i" ;;
        35) echo "j" ;;
        36) echo "k" ;;
        37) echo "l" ;;
        38) echo "m" ;;
        39) echo "n" ;;
        40) echo "o" ;;
        41) echo "p" ;;
        42) echo "q" ;;
        43) echo "r" ;;
        44) echo "s" ;;
        45) echo "t" ;;
        46) echo "u" ;;
        47) echo "v" ;;
        48) echo "w" ;;
        49) echo "x" ;;
        50) echo "y" ;;
        51) echo "z" ;;
        52) echo "1" ;;
        53) echo "2" ;;
        54) echo "3" ;;
        55) echo "4" ;;
        56) echo "5" ;;
        57) echo "6" ;;
        58) echo "7" ;;
        59) echo "8" ;;
        *) echo "ERROR finding Minute" ;;
      esac
      ;;
    esac
    exit 0
    .zoraclock
    Code:
    update_interval 1
    own_window yes
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    own_window_colour lightgrey
    double_buffer yes
    use_spacer right
    use_xft yes
    xftfont zoraclockD:size=90
    xftalpha .6
    draw_shades no
    draw_outline no 
    draw_borders no
    draw_graph_borders no
    short_units yes
    stippled_borders 3
    border_margin 9
    border_width 10
    default_color white
    #color1 e5e5e5
    #color2 F1AA0E
    #color3 white
    #color4 white
    #color5 white
    #color6 white
    #color7 white
    #color8 white
    #color9 white
    #alignment tl
    alignment tr
    #alignment bl
    #alignment br
    #alignment tm
    #alignment bm
    
    gap_x 100
    gap_y 35
    
    minimum_size 180
    
    cpu_avg_samples 2
    max_specials 512
    text_buffer_size 512
    override_utf8_locale yes
    
    TEXT
    ${color white}${goto 23}${font zoraclockD:size=110}I
    ${voffset -183}${color black}${goto 41}${font}K
    ${voffset -146}${color ff7510}${goto 42}${font}L${goto 42}${color ffc020}${font}N
    ${voffset -144}${color da0000}${goto 42}${font}M
    ${voffset -228}${goto 136}${color 393939}${font 911 Porscha:size=13}1${goto 135}${color white}${font 911 Porscha:size=12}1
    ${voffset 39}${goto 33}${color 393939}${font 911 Porscha:size=13}9${goto 33}${color white}${font 911 Porscha:size=12}9
    ${voffset 39}${goto 128}${color 393939}${font 911 Porscha:size=13}5${goto 128}${color white}${font 911 Porscha:size=12}5
    ${color grey}${voffset -108}${goto 49}${font zoraclockH:size=80}${execpi 20 ~/scripts/clock.sh hour}${color 111111}${goto 50}${font zoraclockH:size=80}${execpi 20 ~/scripts/clock.sh hour}
    ${color grey}${voffset -115}${goto 29}${font zoraclockM:size=110}${execpi 20 ~/scripts/clock.sh minute}${color 111111}${goto 30}${font zoraclockM:size=110}${execpi 20 ~/scripts/clock.sh minute}${font arial:size=6}
    conkyrc
    Code:
    # --- Parameters conky --- #
    own_window         yes
    own_window_class     Conky
    own_window_transparent     yes
    own_window_type     override
    own_window_hints     undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer         yes
    # Minimal Width
    maximum_width         300
    # Minimal Size
    minimum_size         300 700
    # Location of conky --- #
    alignment         bottom_right
    #alignment               middle_middle
    gap_x 10
    gap_y -05
    
    # --- Graphic  --- #
    draw_borders         no
    background         no
    stippled_borders     1
    border_inner_margin     1
    border_width         5
    default_color         white
    draw_graph_borders     yes
    
    # --- Text --- #
    use_spacer         right
    use_xft         yes
    xftalpha         0.5
    draw_shades         yes
    update_interval     1.5
    draw_outline         no
    draw_borders         no
    font             Sans:size=8:weight=bold
    uppercase         no
    override_utf8_locale     yes
    no_buffers         yes
    cpu_avg_samples     2
    short_units         yes
    pad_percents         2
    text_buffer_size     2048
    
    
    #--- LUA ----
    lua_load ~/scripts/123.lua
    lua_draw_hook_pre widgets
    
    TEXT
    ${font Sans:size=9:weight=bold}${color gold}SYSTEM ${hr 2}$color${font Sans:size=8:weight=bold}
    ${color white}${time %A},${time %e} ${time %B} ${time %G}${alignr}
    ${color grey}Machine$color ${color white}$nodename ${alignr}
    ${color grey}Uptime $color$uptime${alignr}${color grey}Processes:$color $running_processes/$processes
    ${color grey}Kernel$color  ${color white}$kernel ${alignr}
    
    # CPU
    ${font Sans:size=8:weight=bold}${color gold}CPU ${hr 2}$color
    
    ${color white}${font}CPU: ${color red}${cpu cpu0}% $font${color}${alignr}FREQ: ${color red}${freq_g 1}Ghz$alignr ${color white}
    
    
    
    CORE0:
    ${color grey}${cpugraph cpu1 20,300 00ff0c 00ff0c }
    CORE1:
    ${color grey}${cpugraph cpu2 20,300 00ff0c 00ff0c } 
    
    #RAM
    ${font Sans:size=8:weight=bold}${color gold}MEMORY${hr 2}$color${font Sans:size=8:weight=bold}
    
    ${color white}RAM: ${color red}$memperc%${alignr}${color white}USED: ${color red}$mem/$memmax
    
    ${color white}SWAP:$color $swapperc%${alignr}${color white}USED: ${color red}$swap/$swapmax
    
    #HDD
    
    ${voffset -5}${font Sans:size=8:weight=bold}${color gold}HDD ${hr 2}$color${font Sans:size=8:weight=bold}
    
    ${color white}ROOT${color red} ${fs_free_perc /}%$alignr${color}FREE: ${fs_free /}/ ${fs_size /}
    
    ${color white}HOME${color red}  ${fs_free_perc /home}%$alignr${color}FREE: ${fs_free /home}/ ${fs_size /home}
    
    ${color white}VAR${color red}  ${fs_free_perc /var}%$alignr${color}FREE: ${fs_free /var}/ ${fs_size /var}
    
    
    #NETWORK
    ${font Sans:size=9:weight=bold}${color gold}NETWORK ${hr 2}$color${font Sans:size=8:weight=bold}
    
    ${color ff3500}Local:$color${goto 50}${addr eth0}    ${color ff3500}${goto 180}Public:$color${goto 225}${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}
    
    #${color white$color ${downspeed eth0}${alignr}${color white}.$color${alignr} ${upspeed eth0}
    #${downspeedgraph eth0 30,115 000000 00ff00} ${alignr}${upspeedgraph eth0 30,115 000000 ff0000}$color
    #Trafic
    
    ${font Sans:size=8:weight=bold}
    ${voffset -26 alignl}${color ff3500}Total Down: ${color white}${totaldown eth0}${color ff3500}${alignr}Total Up:${alignr} ${color white}${totalup eth0}
    
    
    #${color white$color ${downspeed vlan0}${alignr}${color white}.$color${alignr} ${upspeed vlan0}
    #${downspeedgraph vlan0 30,115 000000 00ff00} ${alignr}${upspeedgraph vlan0 30,115 000000 ff0000}$color
    # Trafic
    ${font Sans:size=8:weight=bold}
    ${voffset -26}${alignr}${color 66ff00}Total Down: ${color white}${totaldown vlan0}
    ${voffset 16}${alignr}${color 66ff00}Total Up:${alignr} ${color white}${totalup vlan0}
    startup
    Code:
    #!/bin/bash
    sleep 20 && DISPLAY=:0.0 conky;
    This is as far as I can get it if I start the clock in the terminal. I can't get it to auto start.
    Code:
    --[[ EQUALIZER WIDGET
        v1.0 by wlourf (10 Feb. 2010)
        This widget draw a simple bar like (old) equalizers on hi-fi systems.
        http://u-scripts.blogspot.com/
        
        The arguments are :
        - "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 bar. If the Conky variable outputs a percentage, use 100.
        - "nb_blocks" is the umber of block to draw
        - "cap" id the cap of a block, possibles values are CAIRO_LINE_CAP_ROUND , CAIRO_LINE_CAP_SQUARE or CAIRO_LINE_CAP_BUTT
          see http://www.cairographics.org/samples/set_line_cap/
        - "xb" and "yb" are the coordinates of the bottom left point of the bar
        - "w" and "h" are the width and the height of a block (without caps)
        - "space" is the space betwwen two blocks, can be null or negative
        - "bgc" and "bga" are background colors and alpha when the block is not LIGHT OFF
        - "fgc" and "fga" are foreground colors and alpha when the block is not LIGHT ON
        - "alc" and "ala" are foreground colors and alpha when the block is not LIGHT ON and ALARM ON
        - "alarm" is the value where blocks LIGHT ON are in a different color (values from 0 to 100)
        - "led_effect" true or false : to show a block with a led effect
        - "led_alpha" alpha of the center of the led (values from 0 to 1)
        - "smooth" true or false : colors in the bar has a smooth effect
        - "mid_color",mid_alpha" : colors of the center of the bar (mid_color can to be set to nil)
        - "rotation" : angle of rotation of the bar (values are 0 to 360 degrees). 0 = vertical bar, 90 = horizontal bar
        
    ]]
    require 'cairo'
    
    function equalizer(cr, xb, yb, name, arg, max, nb_blocks, cap, w, h, space, bgc, bga, fgc, fga,alc,ala,alarm,led_effect,led_alpha,smooth,mid_color,mid_alpha,rotation)
    
    -- recoding function of color
    
         local function rgb_to_r_g_b(colour, alpha)
            return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
        end
    -- data necessary for the type of input divisions Equaliser
    
        local cap_round = CAIRO_LINE_CAP_ROUND        -- in the form of a circle
        local cap_square = CAIRO_LINE_CAP_SQUARE    -- in the form of a rectangle
        local cap_butt = CAIRO_LINE_CAP_BUTT        -- in the form of rectangular (other)
    
        local function setup_equalizer()
    
    -- making data from OS
            
            local str = conky_parse(string.format('${%s %s}', name, arg))
            
            local value = tonumber(str)
            if value == nil then value = 0 end
    
            local pct = 100*value/max
            local pcb = 100/nb_blocks
    -- set the size and type of scale
            cairo_set_line_width (cr, h)
            cairo_set_line_cap  (cr, cap)
    -- Unscrew Equaliser    
            local angle= rotation*math.pi/180
            for pt = 1,nb_blocks do  
                local light_on=false
                --set colors
                local col,alpha = bgc,bga
                if pct>=(100/nb_blocks/2) then --start after an half bloc
                    if pct>=(pcb*(pt-1)) then 
                        light_on=true
                        col,alpha = fgc,fga
                        if pct>=alarm and (pcb*pt)>alarm then col,alpha = alc,ala end
                    end
                end
    
                --vertical points
                local x1=xb
                local y1=yb-pt*(h+space)
                local radius0 = yb-y1
        
                local x2=xb+radius0*math.sin(angle)
                local y2=yb-radius0*math.cos(angle)
                
                --line on angle
                local a1=(y2-yb)/(x2-xb)
                local b1=y2-a1*x2
    
                --line perpendicular to angle
                local a2=-1/a1
                local b2=y2-a2*x2
                
                --dots on perpendicular
                local xx0,xx1,yy0,yy1=0,0,0,0
                if rotation == 90  or rotation == 270 then
                    xx0,xx1=x2,x2
                    yy0=yb
                    yy1=yb+w
                else
                    xx0,xx1=x2,x2+w*math.cos(angle)
                    yy0=xx0*a2+b2
                    yy1=xx1*a2+b2
                end
    
                --perpendicular segment
                cairo_move_to (cr, xx0 ,yy0)
                cairo_line_to (cr, xx1 ,yy1)
            
                --colors
                local xc,yc=(xx0+xx1)/2,(yy0+yy1)/2
                if light_on and led_effect then
                    local pat = cairo_pattern_create_radial (xc, yc, 0, xc,yc,w/1.5)
                    cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col,led_alpha))
                    cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col,alpha))
                    cairo_set_source (cr, pat)
                    cairo_pattern_destroy(pat)
                else
                    cairo_set_source_rgba(cr, rgb_to_r_g_b(col,alpha))
                end 
    
                if light_on and smooth then
                    local radius = (nb_blocks+1)*(h+space)
                    if pt==1 then 
                        xc0,yc0=xc,yc --remember the center of first block
                    end
                    cairo_move_to(cr,xc0,yc0)
                    local pat = cairo_pattern_create_radial (xc0, yc0, 0, xc0,yc0,radius)
                    cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(fgc,fga))
                    cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(alc,ala))
                    if mid_color ~=nil then
                        cairo_pattern_add_color_stop_rgba (pat, 0.5,rgb_to_r_g_b(mid_color,mid_alpha))
                    end
                    cairo_set_source (cr, pat)
                    cairo_pattern_destroy(pat)
                end 
            
                cairo_stroke (cr);
    
            end
        end    
        --prevent segmentatioon error
        local updates=tonumber(conky_parse('${updates}'))
    
            setup_equalizer()
    end
    --[[ END WIDGET ]]
    -- -------------------------------------------------------------------------------------
    --[[ TEXT WIDGET ]]
    
    function text_widget(cr, x, y, prefix, name, arg, suffix, fsize, fgc, fga, rotation)
    
    -- recoding function of color
    
         local function rgb_to_r_g_b(colour, alpha)
            return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
        end
    
    
    
        function addzero100(num)
    
            if tonumber(num) < 10 then
            return "00" .. num
            elseif tonumber(num) <100 then
            return "0" .. num
            else
            return num
            end
        end
    
    -- making data from OS
    
        local str = conky_parse(string.format('${%s %s}', name, arg))
        local value = tonumber(str)
        if value == nil then value = 0 end
    
    -- indicate font size
        cairo_set_font_size (cr, fsize)
    -- indicate the point of departure    
        cairo_move_to(cr, x, y)
    -- indicate the font color
        cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, fga))
    -- rotate text
        cairo_rotate (cr, rotation*math.pi/180)
    -- display text
        cairo_show_text(cr, prefix .. (addzero100(value)) .. suffix)    
    end
    --[[ END TEXT WIDGET ]]
    
    
    -- -------------------------------------------------------------------------------------
        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)
    -- -------------------------------------------------------------------------------------
    --[[
    equalizer(cr, xb, yb, name, arg, max, nb_blocks, cap, w, h, space, bgc, bga, fgc, fga,alc,ala,alarm,led_effect,led_alpha,smooth,mid_color,mid_alpha,rotation)
      ]]
    cr = cairo_create(cs)
    --text_widget(cr, 25, 120, "CPU2 ", 'cpu', 'cpu2', " %", 10, 0xffffff, 1, 50)
    -- cpu 
    equalizer(cr, 7, 138, 'cpu', 'cpu0', 100, 100, CAIRO_LINE_CAP_SQUARE, 20, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0x66ff00, 1, 90)
    cairo_destroy(cr)
    -- memory
    cr = cairo_create(cs)
    equalizer(cr, 7, 315, 'memperc', '', 100, 100, CAIRO_LINE_CAP_SQUARE, 5, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0xff0000, 1, 90)
    cairo_destroy(cr)
    --swap
    cr = cairo_create(cs)
    equalizer(cr, 7, 341, 'swapperc', '', 100, 100, CAIRO_LINE_CAP_SQUARE, 5, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0xff0000, 1, 90)
    cairo_destroy(cr)
    -- hdd Root
    cr = cairo_create(cs)
    equalizer(cr, 7, 400, 'fs_used_perc', '/', 100, 100, CAIRO_LINE_CAP_SQUARE, 5, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0x66ff00, 1, 90)
    cairo_destroy(cr)
    --hdd Home
    cr = cairo_create(cs)
    equalizer(cr, 7, 425, 'fs_used_perc', '/home', 100, 100, CAIRO_LINE_CAP_SQUARE, 5, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0x66ff00, 1, 90)
    cairo_destroy(cr)
    --hdd Var
    cr = cairo_create(cs)
    equalizer(cr, 7, 450, 'fs_used_perc', '/var', 100, 100, CAIRO_LINE_CAP_SQUARE, 5, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0x66ff00, 1, 90)
    cairo_destroy(cr)
    --lan downspeed
    cr = cairo_create(cs)
    equalizer(cr, 7, 569, 'downspeedf', 'eth0', 1350, 100, CAIRO_LINE_CAP_SQUARE, 10, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0x66ff00, 1, 90)
    text_widget(cr, 8, 565, "Download  ", 'downspeedf', 'eth0', " Kb/s", 11, 0xffffff, 1, 0)
    cairo_destroy(cr)
    -- lan upspeed
    cr = cairo_create(cs)
    equalizer(cr, 7, 598, 'upspeedf', 'eth0', 170, 100, CAIRO_LINE_CAP_SQUARE, 10, 2, 1, 0x606070, 1, 0x00ff0c, 1, 0xff0000, 1, 80, true, 1, true, 0xff0000, 1, 90)
    text_widget(cr,8 , 594, "Upload ", 'upspeedf', 'eth0', " Kb/s", 11, 0xffffff, 1, 0)
    end

  5. #17085
    Join Date
    Apr 2007
    Beans
    195

    Re: Post your .conkyrc files w/ screenshots

    Oh wow... I... have one I can't fix myself... @mrpeachy, the calendar indicator won't move to the third Sunday. It's stuck on the 10th, and it's now the 17th.

    And... I actually don't have a theory as to why this time... I stared at the code, everything looks like it should work. I genuinely am afraid to try anything, because it really does seem to be perfect, and I don't know where this problem is coming from.

    Code:
    --lua calendar script by mrpeachy version 3, 03/04/2011
    --fixed issue where months beginning on saturday would not have last dates printed
    --added previous and next month dates within calendar
    --condensed code, hopefully will run lighter also
    --fixed ability to rotate and keep box in right place
    require 'cairo'
    --------------------------------------------------------------------------------
    function conky_draw_fig(cs, cr)
    if conky_window == nil then return end
    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=tonumber(conky_parse('${updates}'))
    --####################################################################################################
    if updates>5 then -- starts the display
    --####################################################################################################
    --title text color
    tred,tgreen,tblue,talpha=1,0,0,1
    --title text font
    tfont="TransponderAOE"
    --title text size
    tfontsize=20
    --title font bold? Set to 1 for bold font
    tfbold=1
    --###################################################
    --main body text color
    bred,bgreen,bblue,balpha=0,0,0.753,1
    --main body text font
    mfont="TransponderAOE"
    --main body text size
    mfontsize=20
    --main body font bold? Set to 1 for bold font
    mfbold=1
    --###################################################
    --highlight text color
    hred,hgreen,hblue,halpha=1,1,0,1
    --highlight font
    hfont="TransponderAOE"
    --highlight size
    hfontsize=20
    --Highlight font bold? Set to 1 for bold font
    hfbold=1
    --###################################################
    --surrounding numbers 1=on, 0=off
    surround=1
    --surrounding dates text color
    sred,sgreen,sblue,salpha=1,0.723,0,1
    --surrounding font
    sfont="TransponderAOE"
    --surounding size
    sfontsize=20
    --bold?
    sfbold=0
    --###################################################
    --indicator box enter 1 for box or 0 for no box
    box=1
    --use the following 2 numbers to adjust box position
    xadjust=2.5
    yadjust=5
    --set the box dimensions
    width=28
    height=22
    --box color
    bxred,bxgreen,bxblue,bxalpha=1,0,0,1
    --###################################################
    --calendar this month ###############################
    --###################################################
    --position
    across=140
    down=180
    --rotate - this will require repositioning above
    rotate=0
    --###################################################
    --horizontal gap between dates
    gaph=32
    --###################################################
    --gap between day titles and first line
    gapt=25
    --###################################################
    --gap between calendar line
    gapl=25
    --###################################################
    --spacer -- this can help with alignment enter 0, 1 space or 2 spaces between the ""
    spacer=" "
    --###################################################
    --calendar calcs
    year=os.date("%G")
    today=tonumber(os.date("%d"))
    t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
    t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
    feb=(os.difftime(t1,t2))/(24*60*60)
    local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
    local day=tonumber(os.date("%w"))+1
    local day_num = today
    local remainder=day_num % 7
    start_day=day-(day_num % 7)
    if start_day<0 then start_day=7+start_day end     
    month=os.date("%m")
    mdays=monthdays[tonumber(month)]
    mdaystm=mdays
    x=mdays+start_day
    dnum={}
    dnumh={}
    if mdays+start_day<36 then 
    dlen=35
    plen=29 
    else 
    dlen=42 
    plen=36
    end
    for i=1,dlen do
    if i<=start_day then dnum[i]="  " 
    else dn=i-start_day
    if dn=="nil" then dn=0 end
    if dn<=9 then dn=(spacer .. dn) end
    if i>x then dn="" end
    dnum[i]=dn
    dnumh[i]=dn
    if dn==(spacer .. today) or dn==today then
    dnum[i]=""
    end 
    if dn==(spacer .. today) or dn==today then
    dnumh[i]=dn
    place=i 
    else dnumh[i]="  " 
    end 
    end
    end--for
    --###################################################
    cairo_rotate (cr,(math.pi/180)*(rotate))
    --print calendar titles
    --###################################################
    if tfbold==1 then
    cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    else
    cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    end
    cairo_set_font_size (cr, tfontsize);
    cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    --------------------------------
    --use these settings to mess around with positioning
    turn=0
    ta=0
    move=0
    rot=0
    --------------------------------
    for i=1,7 do
    cairo_move_to (cr, across+(gaph*(i-1)), down+(i*move))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, dys[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    if mfbold==1 then
    cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    else
    cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    end
    cairo_set_font_size (cr, mfontsize);
    cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
    for i=1,plen,7 do
    fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    end
    if hfbold==1 then
    cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    else
    cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    end
    cairo_set_font_size (cr, hfontsize);
    cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
    for i=1,plen,7 do
    fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    end
    --###############################################################################
    if surround==1 then
    thisstart=tonumber(start_day)+1
    thisend=tonumber(start_day)+mdays
    previous=tonumber(start_day)
    nextmon=dlen-thisend
    pmon=tonumber(month)-1
    if pmon==0 then pmon=12 end
    pmon=monthdays[pmon]
    snum={}
    for i=1,dlen do
    snum[i]=""
    end
    for i=tonumber(thisend)+1,tonumber(thisend)+nextmon do
    snum[i]=i-tonumber(thisend)
    end
    for i=1,previous do
    snum[i]=pmon-(previous-(i))
    end
    if sfbold==1 then
    cairo_select_font_face (cr, sfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    else
    cairo_select_font_face (cr, sfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    end
    cairo_set_font_size (cr, sfontsize);
    cairo_set_source_rgba (cr,sred,sgreen,sblue,salpha)
    for i=1,plen,7 do
    fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, snum[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    end
    end
    --box aound
    if box==1 then
    cairo_set_source_rgba (cr,bxred,bxgreen,bxblue,bxalpha)
    cairo_set_line_width (cr,1)
    if place>0 and place<8 then
    cy=down+gapt
    elseif
    place>7 and place<15 then
    cy=down+gapt+gapl
    elseif
    place>13 and place<23 then
    cy=down+gapt+gapl+gapl
    elseif
    place>21 and place<29 then
    cy=down+gapt+gapl+gapl+gapl
    elseif
    place>28 and place<36 then
    cy=down+gapt+gapl+gapl+gapl+gapl
    end
    placey=place %7
    if placey==1 then
    cx=across
    elseif
    placey==2 then
    cx=across+(gaph*1)
    elseif
    placey==3 then
    cx=across+(gaph*2)
    elseif
    placey==4 then
    cx=across+(gaph*3)
    elseif
    placey==5 then
    cx=across+(gaph*4)
    elseif
    placey==6 then
    cx=across+(gaph*5)
    elseif
    placey==0 then
    cx=across+(gaph*6)
    end
    cairo_rectangle (cr,cx-xadjust,cy+yadjust,width,-height)
    cairo_stroke (cr)
    end
    --###################################################
    cairo_rotate (cr,(math.pi/180)*(rotate*-1))
    --end of calendar
    --###################################################
    --#################################################################################
    end--end if 5
    end--end main function
    Do YOU see where it can go in? The only thing I can think of is explicitly setting "place" before the if structure... but that doesn't make much sense...
    Attached Images Attached Images

  6. #17086
    Join Date
    Aug 2009
    Location
    East of Atlantic
    Beans
    81
    Distro
    Ubuntu

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Arminius View Post
    if they have nothing better to do it would be great, I was wanting to keep the horizontal one long term, or even longer say over an hour, and a vertical one that's much shorter, like 5 mins
    nothing better to do, I don't know but I wrote this little script some month ago:
    Code:
    # -- Conky settings -- #
    background no
    update_interval 0.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_type desktop
    own_window_transparent no
    own_window_argb_visual no
    #own_window_hints undecorate,sticky,skip_taskbar,skip_pager,above
    #own_window_title bargraph2
    
    border_inner_margin 0
    border_outer_margin 0
    
    minimum_size 600 600
    alignment tl
    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 Santana:size=24
    xftalpha 0.8
    
    uppercase no
    
    default_color 33FF33
    
    pad_percents 2
    
    
    # -- Lua Load -- #
    # SET THE PATH TO THE SCRIPT HERE
    #LEAVE AT LEAST ONE LINE, BLANK OR NOT AFTER TEXT
    lua_load ~/conky/graph.lua
    lua_draw_hook_pre main_graph
    TEXT
    
    ${downspeedgraph eth0 26,257 555752 FF0000}
    Code:
    --[[ GRAPH widget v1.1 by wlourf (07.01.2011)
        this widget draws some graphs with some effects 
        http://u-scripts.blogspot.com/2010/10/graph-widget.html
        
    To call the script in a conky, use, before TEXT
        lua_load /path/to/the/script/graph.lua
        lua_draw_hook_pre main_graph
    and add one line (blank or not) after TEXT
    
    
    Parameters are :
    3 parameters are mandatory
    name        - the name of the conky variable to display,
                  for example for {$cpu cpu0}, just write name="cpu"
    arg            - the argument of the above variable,
                  for example for {$cpu cpu1}, just write arg="cpu1"
                    arg can be a numerical value if name=""
    max            - the maximum value the above variable can reach,
                  for example for {$cpu cpu1}, just write max=100 or less or more
        
    Optional parameters:
    x,y         - coordinates of the bottom-left corner of the graph,
                  relative to the top-left corner of the conky window 
                  default =  bottom-left corner of the conky window
    width       - width of the graph, default = 100 pixels
    height      - height of the graph, default = 20 pixels
    nb_values   - number of values to display in the graph, default=width 
                  i.e. 1 pixel for 1 value
    autoscale   - if set to true, calculate the max valeu of the y axis and
                  doesn't use the max parameter above, default=false
    skew_x      - skew graph around x axis, défaut = 0
    skew_y      - skew graph around y axis, défaut = 0
    angle        - angle of rotation of the graph in degress, default = 0
                  i.e. a horizontal graph)
    inverse     - if set to true, graph are draw from right to left, default=false
    background  - if set to false, background is not drawn, default=true
    foreground  - if set to false, foreground is not drawn, default=true
                  foreground = plain graph
    bg_bd_size  - size of the border of the background, default=0=no border
    fg_bd_size  - size of the border of the foreground, default=0=no border
    
    
    Colours tables below are defined into braces :
    {position in the gradient (0 to 1), colour in hexadecimal, alpha (0 to 1)}
    example for a single colour table : 
    {{0,0xFFAA00,1}} position parameter doesn't matter
    example for a two-colours table : 
    {{0,0xFFAA00,1},{1,0x00AA00,1}} or {{0.5,0xFFAA00,1},{1,0x00AA00,1}}
    example for a three-colours table : 
    {{0,0xFFAA00,1},{0.5,0xFF0000,1},{1,0x00AA00,1}}
    
    bg_colour    - colour table for background,
                  default = {{0,0x000000,.5},{1,0xFFFFFF,.5}}
    fg_colour    - colour table for foreground,
                  default = {{0,0x00FFFF,1},{1,0x0000FF,1}}
    bg_bd_colour- colour table for background border,
                  default = {{1,0xFFFFFF,1}}              
    fg_bd_colour- colour table for foreground border,
                  default = {{1,0xFFFF00,1}}              
    
    bg_orientation, bg_bd_orientation, fg_orientation, fg_bd_orientation,
                - "orientation" defines the starting point of the gradient,
                  default="nn"
                  there are 8 available starting points : 
                  "nw","nn","ne","ee","se","ss","sw","ww"
                  (n for north, w for west ...)
                  theses 8 points are the 4 corners + the 4 middles of graph
                  so a gradient "nn" will go from "nn" to "ss"
                  a gradient "nw" will go from "nw" to "se"
    
    draw_me     - if set to false, graph is not drawn (default = true)
                  it can be used with a conky string, if the string returns 1, the graph is drawn :
                  example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
                  
    v1.0 (31/10/2010) original release
    v1.1 (07/01/2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"
                      text is parsed inside the function, not in the array of settings
    
    --      This program is free software; you can redistribute it and/or modify
    --      it under the terms of the GNU General Public License as published by
    --      the Free Software Foundation version 3 (GPLv3)
    --     
    --      This program is distributed in the hope that it will be useful,
    --      but WITHOUT ANY WARRANTY; without even the implied warranty of
    --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    --      GNU General Public License for more details.
    --     
    --      You should have received a copy of the GNU General Public License
    --      along with this program; if not, write to the Free Software
    --      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    --      MA 02110-1301, USA.        
    
    ]]
    
    require 'cairo'
    
    function set_settings()
        graph_settings={
    
            {--first horizontal graph
            name="downspeedf",
            arg="eth0",
            max=1000,
            autoscale=true,
            x=10,
            y=100,
            width=257,
            height=26,
            nb_values=500,
            background =false,
            fg_colour={ {0,0x555752,1}, {1,0xFF0000,1}},
            fg_orientation="ww"
            },
    
            {--second horizontal graph
            name="downspeedf",
            arg="eth0",
            max=1000,
            autoscale=true,
            x=10,
            y=130,
            width=257,
            height=26,
            nb_values=500,
            background =false,
            fg_colour={ {0,0x555752,1}, {1,0xFF0000,1}},
            fg_orientation="ss"
            },
    
            {--first vertical graph
            name="downspeedf",
            arg="eth0",
            max=1000,
            autoscale=true,
            x=300,
            y=130,
            width=257,
            height=26,
            nb_values=500,
            background =false,
            fg_colour={ {0,0x555752,1}, {1,0xFF0000,1}},
            fg_orientation="ww",
            angle=90,
            },
    
            {--second vertical graph
            name="downspeedf",
            arg="eth0",
            max=1000,
            autoscale=true,
            x=360,
            y=380,
            width=257,
            height=26,
            nb_values=500,
            background =false,
            fg_colour={ {0,0x555752,1}, {1,0xFF0000,1}},
            fg_orientation="ww",
            angle=-90,
            },
                                                                                                              
           }
    end
    
    
    function check_settings(t)
        --tables are check only when conky start
        if t.name==nil and t.arg==nil then 
            print ("No input values ... use parameters 'name'" .. 
                " with 'arg' or only parameter 'arg' ") 
            return 1
        end
    
        if t.max==nil then
            print ("No maximum value defined, use 'max'")
            print ("for name=" .. t.name .. " with arg=" .. t.arg)
            return 1
        end
        if t.name==nil then t.name="" end
        if t.arg==nil then t.arg="" end
        return 0
    end
    
    function conky_main_graph()
    
        if conky_window == nil then return end
            
        local w=conky_window.width
        local h=conky_window.height
        local cs=cairo_xlib_surface_create(conky_window.display, 
                conky_window.drawable, conky_window.visual, w, h)
        cr=cairo_create(cs)
    
        updates=tonumber(conky_parse('${updates}'))
        --start drawing after "updates_gap" updates
        --prevent segmentation error for cpu
        updates_gap=5
        if updates==1 then    
            set_settings()
            
            flagOK=0
            for i in pairs(graph_settings) do
                if graph_settings[i].width==nil then graph_settings[i].width=100 end
                if graph_settings[i].nb_values==nil then  
                    graph_settings[i].nb_values= graph_settings[i].width
                end
                --create an empty table to store values
                graph_settings[i]["values"]={}
                --beginning point
                graph_settings[i].beg = graph_settings[i].nb_values
                --graph_settings[i].beg = 0
                for j =1, graph_settings[i].nb_values do
                    graph_settings[i].values[j]=0
                end
                graph_settings[i].flag_init=true
                flagOK=flagOK + check_settings(graph_settings[i])
    
            end
        end
    
        if flagOK>0 then 
            --abort script if error in one of the tables
            print ("ERROR : Check the graph_setting table")
            return
        end
    
        --drawing process
        if updates > updates_gap then
            for i in pairs(graph_settings) do
                if graph_settings[i].draw_me==true then graph_settings[i].draw_me = nil end
                if (graph_settings[i].draw_me==nil or conky_parse(tostring(graph_settings[i].draw_me)) == "1") then 
                    local nb_values=graph_settings[i].nb_values
                    graph_settings[i].automax=0
                    for j =1, nb_values do
                        if graph_settings[i].values[j+1]==nil then 
                            graph_settings[i].values[j+1]=0 
                        end
                    
                        graph_settings[i].values[j]=graph_settings[i].values[j+1]
                        if j==nb_values then
                            --store value
                            if graph_settings[i].name=="" then
                                value=graph_settings[i].arg
                            else
                                value=tonumber(conky_parse('${' .. 
                                    graph_settings[i].name .. " " ..
                                    graph_settings[i].arg ..'}'))
                            end
                            graph_settings[i].values[nb_values]=value
                        end
                        graph_settings[i].automax=math.max(graph_settings[i].automax,
                                                           graph_settings[i].values[j])
                        --should stop weird glitches at beginning when no values reported yet for upspeed or diskio
                        if graph_settings[i].automax == 0 then graph_settings[i].automax = 1 end 
                    end
                       draw_graph(graph_settings[i])
                end
            end
        end
    
        cairo_destroy(cr)
        cairo_surface_destroy(cs)
        updates=nil
        updates_gap=nil
    end
    
    
    function draw_graph(t)
        --drawing function
    
        local function rgb_to_r_g_b(colour)
            return ((colour[2] / 0x10000) % 0x100) / 255., ((colour[2] / 0x100) % 0x100) / 255., (colour[2] % 0x100) / 255., colour[3]
        end
     
        local function linear_orientation(o,w,h)
            --set gradient for bg and bg border
            local p
            if o=="nn" then
                p={w/2,h,w/2,0}
            elseif o=="ne" then
                p={w,h,0,0}
            elseif o=="ww" then
                p={0,h/2,w,h/2}
            elseif o=="se" then
                p={w,0,0,h}
            elseif o=="ss" then
                p={w/2,0,w/2,h}
            elseif o=="ee" then
                p={w,h/2,0,h/2}        
            elseif o=="sw" then
                p={0,0,w,h}
            elseif o=="nw" then
                p={0,h,w,0}
            end
            return p
        end
    
        local function linear_orientation_inv(o,w,h)
            --set gradient for fg and fg border
            local p
            if o=="ss" then
                p={w/2,h,w/2,0}
            elseif o=="sw" then
                p={w,h,0,0}
            elseif o=="ee" then
                p={0,h/2,w,h/2}
            elseif o=="nw" then
                p={w,0,0,h}
            elseif o=="nn" then
                p={w/2,0,w/2,h}
            elseif o=="ww" then
                p={w,h/2,0,h/2}        
            elseif o=="ne" then
                p={0,0,w,h}
            elseif o=="se" then
                p={0,h,w,0}
            end
            return p
        end
    
    
        --set default values
        
        --cancel drawing if not needed
        if t.draw_me~=nil and conky_parse(tostring(t.draw_me)) ~= "1" then 
            return
        end
        
    
        
        if t.height==nil    then t.height=20 end
        --checked in previous part : width and nb_values
            
        if t.background==nil    then t.background=true end
        if t.bg_bd_size==nil    then t.bg_bd_size=0 end
        if t.x==nil             then t.x=t.bg_bd_size end
        if t.y==nil             then t.y=conky_window.height -t.bg_bd_size end
        if t.bg_colour==nil     then t.bg_colour={{0,0x000000,.5},{1,0xFFFFFF,.5}} end
        if t.bg_bd_colour==nil     then t.bg_bd_colour={{1,0xFFFFFF,1}} end
        
        if t.foreground==nil    then t.foreground=true end
        if t.fg_colour==nil     then t.fg_colour={{0,0x00FFFF,1},{1,0x0000FF,1}} end
        
        if t.fg_bd_size==nil    then t.fg_bd_size=0 end    
        if t.fg_bd_colour==nil  then t.fg_bd_colour={{1,0xFFFF00,1}} end
        
        if t.autoscale==nil     then t.autoscale=false end
        if t.inverse==nil       then t.inverse=false end
        if t.angle==nil         then t.angle=0 end
        
        if t.bg_bd_orientation==nil then t.bg_bd_orientation="nn" end
        if t.bg_orientation==nil then t.bg_orientation="nn" end
        if t.fg_bd_orientation==nil then t.fg_bd_orientation="nn" end
        if t.fg_orientation==nil then t.fg_orientation="nn" end
    
        --check colours tables
        for i=1, #t.fg_colour do    
            if #t.fg_colour[i]~=3 then 
                print ("error in fg_colour table")
                t.fg_colour[i]={1,0x0000FF,1} 
            end
        end
        
        for i=1, #t.fg_bd_colour do    
            if #t.fg_bd_colour[i]~=3 then 
                print ("error in fg_bd_colour table")
                t.fg_bd_colour[i]={1,0x00FF00,1} 
            end
        end
        
        for i=1, #t.bg_colour do    
            if #t.bg_colour[i]~=3 then 
                print ("error in background color table")
                t.bg_colour[i]={1,0xFFFFFF,0.5} 
            end
        end    
    
        for i=1, #t.bg_bd_colour do    
            if #t.bg_bd_colour[i]~=3 then 
                print ("error in background border color table")
                t.bg_bd_colour[i]={1,0xFFFFFF,1} 
            end
        end    
    
        --calculate skew parameters if needed
        if t.flag_init then
            if t.skew_x == nil then 
                t.skew_x=0 
            else
                t.skew_x = math.pi*t.skew_x/180    
            end
            if t.skew_y == nil then 
                t.skew_y=0
            else
                t.skew_y = math.pi*t.skew_y/180    
            end
            t.flag_init=false
        end
    
        cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
        cairo_set_line_join(cr,CAIRO_LINE_JOIN_ROUND)
    
        local matrix0 = cairo_matrix_t:create()
        tolua.takeownership(matrix0)
        cairo_save(cr)
        cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
        cairo_transform(cr,matrix0)
        
           local ratio=t.width/t.nb_values
    
        cairo_translate(cr,t.x,t.y)
        cairo_rotate(cr,t.angle*math.pi/180)
        cairo_scale(cr,1,-1)
    
        --background
        if t.background then
            local pts=linear_orientation(t.bg_orientation,t.width,t.height)
            local pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
            for i=1, #t.bg_colour do
                --print ("i",i,t.colour[i][1], rgb_to_r_g_b(t.colour[i]))
                cairo_pattern_add_color_stop_rgba (pat, t.bg_colour[i][1], rgb_to_r_g_b(t.bg_colour[i]))
            end
            cairo_set_source (cr, pat)
            cairo_rectangle(cr,0,0,t.width,t.height)    
            cairo_fill(cr)    
            cairo_pattern_destroy(pat)
        end
        
        --autoscale
        cairo_save(cr)
        if t.autoscale then
            t.max= t.automax*1.1
        end
        
        local scale_x = t.width/(t.nb_values-1)
        local scale_y = t.height/t.max
        
        --define first point of the graph
        if updates-updates_gap <t.nb_values then 
            t.beg = t.beg - 1
            --next line prevent segmentation error when conky window is redraw 
            --quicly when another window "fly" over it
            if t.beg<0 then t.beg=0 end
        else
            t.beg=0
        end
        if t.inverse then cairo_scale(cr,-1,1)
        cairo_translate(cr,-t.width,0) end
    
        --graph foreground
        if t.foreground then
            local pts_fg=linear_orientation_inv(t.fg_orientation,t.width,t.height)
            local pat = cairo_pattern_create_linear (pts_fg[1],pts_fg[2],pts_fg[3],pts_fg[4])
            for i=1,#t.fg_colour,1 do
                cairo_pattern_add_color_stop_rgba (pat, 1-t.fg_colour[i][1], rgb_to_r_g_b(t.fg_colour[i]))
            end
            cairo_set_source (cr, pat)
    
            cairo_move_to(cr,t.beg*scale_x,0)
            cairo_line_to(cr,t.beg*scale_x,t.values[t.beg+1]*scale_y)
            for i=t.beg, t.nb_values-1 do
                cairo_line_to(cr,i*scale_x,t.values[i+1]*scale_y)        
            end
            cairo_line_to(cr,(t.nb_values-1)*scale_x,0)
            cairo_close_path(cr)
            cairo_fill(cr)
            cairo_pattern_destroy(pat)
        end
    
        --graph_border
        if t.fg_bd_size>0 then
            local pts=linear_orientation_inv(t.fg_bd_orientation,t.width,t.height)
            local pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
            for i=1,#t.fg_bd_colour,1 do
                cairo_pattern_add_color_stop_rgba (pat, 1-t.fg_bd_colour[i][1], rgb_to_r_g_b(t.fg_bd_colour[i]))
            end
            cairo_set_source (cr, pat)
            cairo_move_to(cr,t.beg*scale_x,t.values[t.beg+1]*scale_y)
            for i=t.beg, t.nb_values-1 do
                cairo_line_to(cr,i*scale_x,t.values[i+1]*scale_y)        
            end
            cairo_set_line_width(cr,t.fg_bd_size)
            cairo_stroke(cr)
            cairo_pattern_destroy(pat)
        end
        cairo_restore(cr)
    
        --background border
        if t.bg_bd_size>0 then
            local pts=linear_orientation(t.bg_bd_orientation,t.width,t.height)
            local pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
            for i=1, #t.bg_bd_colour do
                --print ("i",i,t.colour[i][1], rgb_to_r_g_b(t.colour[i]))
                cairo_pattern_add_color_stop_rgba (pat, t.bg_bd_colour[i][1], rgb_to_r_g_b(t.bg_bd_colour[i]))
            end
            cairo_set_source (cr, pat)
            cairo_rectangle(cr,0,0,t.width,t.height)    
            cairo_set_line_width(cr,t.bg_bd_size)
            cairo_stroke(cr)
            cairo_pattern_destroy(pat)    
        end    
    
        cairo_restore(cr)
    
    end


    First graph on the top-left corner is a conky graph, others are Lua graphs.

    Set the path to the Lua script in the conky (in the above TEXT section) and change the variables in the Lua script. This one is not very easy to set up but if you follow the instructions on my blog, I think you can manage it (well, I hope ) !

    Last version of the script with README is on my deviantArt page.

    HTH and feel free to ask if you have any problem

    EDIT : changing a parameter in the Lua script needs a restart of the conky, it's why I set the update interval to 0.1 second for the tests ! In a normal use, 1 second interval is OK.
    Last edited by wlourf; April 17th, 2011 at 08:56 PM.

  7. #17087
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    @ 42dorian

    i see the problem
    line 239
    Code:
    elseif
    place>13 and place<23 then
    cy=down+gapt+gapl+gapl
    should be
    Code:
    place>14 and place<22 then

  8. #17088
    Join Date
    Apr 2007
    Beans
    195

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    @ 42dorian

    i see the problem
    line 239
    Code:
    elseif
    place>13 and place<23 then
    cy=down+gapt+gapl+gapl
    should be
    Code:
    place>14 and place<22 then
    Oh for the love of...

    Of course, Math. My Nemesis Returns Thank You, Good Sir. It works again. Much MUCH appreciated.

  9. #17089
    Join Date
    Apr 2011
    Location
    USA
    Beans
    1

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by elendilnl View Post
    I have a pretty standard Ubuntu with 4 workspaces.
    Conky is running and visible on all 4 of them, is it possible to let Conky be visible on just one? And if yes, how do I do that?
    Yes, do not use "sticky" in own_window_hints. And I think you do/can not use own_window_type desktop.

    using:

    Code:
    own_window_type normal
    with:

    Code:
    own_window_hints undecorated,below,skip_taskbar,skip_pager
    works with openbox on debian testing; conky will only show on desktop 1 by default. I think some people found a way to specify which desktop conky would display on.
    Last edited by landwell; April 18th, 2011 at 04:20 AM.

  10. #17090
    Join Date
    Oct 2007
    Beans
    3

    Re: Post your .conkyrc files w/ screenshots

    I just tried using VinDSL data dump for April 7. And I'm getting some weird results:
    http://i53.tinypic.com/amccb8.png

Page 1709 of 2328 FirstFirst ... 7091209160916591699170717081709171017111719175918092209 ... 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
  •