Page 1902 of 2302 FirstFirst ... 902140218021852189219001901190219031904191219522002 ... LastLast
Results 19,011 to 19,020 of 23020

Thread: Post your .conkyrc files w/ screenshots

  1. #19011
    Join Date
    Jul 2010
    Location
    Ubuntu Land
    Beans
    52
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Post your .conkyrc files w/ screenshots

    I have been busy lately and have not done much with my conky.I made a couple changes to the network portion so I thought I would do a data dump since it has been a while.


    conky
    Code:
    ##############################
    #     Conky by FOUTES.       #
    #     Fonts required-        #
    #      ConkySymbols          #
    #         Poky               #
    #     PizzaDude Bullets      #
    #       KR_A_Round           #
    ##############################
    
    # Create own window instead of using desktop (required in nautilus)
    background no
    own_window yes
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    
    # Use double buffering (reduces flicker, may not work for everyone)
    double_buffer yes
    
    # fiddle with window
    use_spacer left
    use_xft yes
    
    # Update interval in seconds
    update_interval 1.5
    
    # Minimum size of text area
    minimum_size  170 730
    
    # Draw shades?
    draw_shades no
    
    # Default colors and also border colors, grey90 == #ffffff
    default_color white
    default_outline_color white
    
    # Text alignment, other possable values are commented
    #alignment top_left
    alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    
    # Gap between borders of screen and text
    gap_x 6
    gap_y 31
    
    # font
    use_xft yes
    xftfont Sazanami Gothic:size=8
    override_utf8_locale yes
    
    # Load Lua for shading and bargraphs
    lua_load /home/linus/.scripts/combined.lua
    lua_draw_hook_pre draw_lua
    
    # stuff after 'TEXT' will be formatted on screen
    short_units yes
    pad_percents 2
    
    TEXT
    ##############################
    # Kernel/Updates/Mail/Uptime #
    ##############################
    ${voffset 5}${font ConkySymbols:size=16}O${font}${goto 34}${voffset -7}$kernel 
    ${voffset 7}${font Poky:size=16}w${font}${goto 35}${voffset -7}${execi 3600 aptitude search "~U" | wc -l | tail} Packages
    ${voffset 5}${goto 6}${font ConkySymbols:size=17}c${font}${goto 35}${voffset -8}${execpi 1800 python /home/linus/.scripts/gmail.py}
    ${voffset 6}${goto 6}${font PizzaDude Bullets:size=17}L${font}${goto 36}${voffset -2}$uptime_short
    ###########
    # Battery #
    ###########
    ${voffset 7}${goto 2}${font Poky:size=22}R${font}${goto 40}${voffset -17}${battery_short} ${battery_time BAT0}
    #########
    #  Cpu  #
    #########
    ${voffset 32}${goto 4}${font ConkySymbols:size=22}f${font}${goto 42}${voffset -29}${cpu cpu1}%${goto 75}Freq:${freq_g cpu1}${voffset -7}${goto 137}${font ConkySymbols:size=14}H${font}${goto 152}${voffset -2}${execpi 5 sensors | grep 'temp1' | cut --characters 15-16}C${voffset 22}${goto 42}${cpu cpu2}%${goto 75}Freq:${freq_g cpu2}${goto 152}${voffset 1}${execpi 5 sensors | grep 'temp1' | cut --characters 15-16}C
    ${voffset 30}${goto 7}${font PizzaDude Bullets:size=12}C${font}${goto 27}${voffset -2}${top name 1}${goto 116}${voffset -18}CPU${goto 110}${voffset 17}${top cpu 1}${goto 150}${voffset -17}MEM${goto 146}${voffset 17}${top mem 1}
    ${voffset 6}${goto 7}${font PizzaDude Bullets:size=12}C${font}${goto 27}${voffset -2}${top name 2}${goto 110}${top cpu 2}${goto 146}${top mem 2}
    ${voffset 5}${goto 7}${font PizzaDude Bullets:size=12}C${font}${goto 27}${voffset -2}${top name 3}${goto 110}${top cpu 3}${goto 146}${top mem 3}
    ############
    #  Memory  #
    ############
    ${voffset 18}${goto 4}${font ConkySymbols:size=22}J${font}${goto 40}${voffset -14}$memperc%${goto 80}$mem/$memmax
    ##############
    # Hard Drive #
    ##############
    ${voffset 30}${goto 5}${font ConkySymbols:size=20}k${font}${voffset -2}${goto 40}Write=${goto 79}${diskio_write /dev/sda}${voffset -12}${goto 40}Read=${goto 79}${diskio_read /dev/sda}${voffset 2}${goto 120}${font ConkySymbols:size=14}H${font}${voffset -2}${hddtemp /dev/sda}°C 
    ${voffset 15}${goto 9}${font PizzaDude Bullets:size=12}u${font}${goto 27}${voffset -1}Boot:${voffset -10}${goto 64}${fs_used /boot}/${fs_size /boot}/${fs_type /boot}
    ${voffset 20}${goto 9}${font PizzaDude Bullets:size=12}u${font}${goto 27}${voffset -1}Root:${voffset -10}${goto 67}${fs_used /}/${fs_size /}/${fs_type /}
    ${voffset 20}${goto 9}${font PizzaDude Bullets:size=12}u${font}${goto 27}${voffset -1}Home:${voffset -10}${goto 67}${fs_used /home}/${fs_size /home}/${fs_type /home}
    ${voffset 20}${goto 9}${font PizzaDude Bullets:size=12}u${font}${goto 27}${voffset -1}Swap:${voffset -10}${goto 69}${swap} / ${swapmax}
    ############
    # Wireless #
    ############
    ${if_existing /sys/class/net/wlan0/operstate up}
    ${voffset 17}${font ConkySymbols:size=20}g${font}${voffset -14}${goto 52}${wireless_essid wlan0}
    ${voffset 20}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Bitrate:${goto 68}${wireless_bitrate wlan0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Local  IP:${goto 78}${addr wlan0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Public IP:${goto 78}${execi 1800 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}U${font}${goto 29}${voffset -1}Speed Down:${downspeed wlan0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}O${font}${goto 29}${voffset -1}Speed Up:${upspeed wlan0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Down:${totaldown wlan0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Up:${totalup wlan0}${else}${if_existing /sys/class/net/easytether0/operstate}${endif}
    ${if_existing /sys/class/net/eth0/operstate up}
    ${voffset 10}${font Poky:size=20}Y${font}${voffset -4}${goto 65}ETHERNET
    ${voffset 18}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Local  IP:${goto 78}${addr eth0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Public IP:${goto 78}${execi 1800 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}U${font}${goto 29}${voffset -1}Speed Down:${downspeed eth0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}O${font}${goto 29}${voffset -1}Speed Up:${upspeed eth0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Down:${totaldown eth0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Up:${totalup eth0}${else}${if_existing /sys/class/net/eth0/operstate}${endif}
    ${if_existing /sys/class/net/easytether0/operstate up}
    ${voffset 10}${font Poky:size=20}Y${font}${voffset -4}${goto 65}EASYTETHER
    ${voffset 18}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Local  IP:${goto 78}${addr easytether0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}b${font}${goto 29}${voffset -1}Public IP:${goto 78}${execi 1800 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}U${font}${goto 29}${voffset -1}Speed Down:${downspeed easytether0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}O${font}${goto 29}${voffset -1}Speed Up:${upspeed easytether0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Down:${totaldown easytether0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Up:${totalup easytether0}
    ${voffset 8}${goto 9}${font PizzaDude Bullets:size=12}m${font}${goto 29}${voffset -1}Total Mth:${execi 10 vnstat -m -i easytether0 | grep "`date +"%b '%y"`" | awk '{print $9 $10}'}${endif}
    lua

    Code:
    --[[ this script combines the background drawing lua (originally by londonali1010, modified by VinDSL)
    with a script that emulates only the gradient bars portion of the script by wlourf,wireless potion modified by dk75
    call in conkyrc above TEXT like so
    lua_load /path to file/filename.lua
    lua_draw_hook_pre draw_lua
    ]]
    require 'cairo'
    function conky_draw_lua()
    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)
    local updates=tonumber(conky_parse('${updates}'))
    if updates>5 then
    --#########################################################################################################
    --#########################################################################################################
    --background setup -- make sure this comes first-----------
    settings={--CONKY BACKGROUND
    corner_r=20,--corner radius
    bg_color={0x222222,0.8},--color and alpha inside {}
    bg_height=-2,--negative number reduces height of bg
    w=conky_window.width,
    h=conky_window.height,
    };background(settings)
    --end background setup-------------------------------------
    
    bar_adjust=-20
    
    --bar setup------------------------------------------------
    settings={--BATTERY GRAPH BATTERY
    number=tonumber(conky_parse("${battery_percent}")),--conky object to read
    number_max=100,--max value of conky object
    bar_startx=41,--x coordinate
    bar_starty=152+bar_adjust,--y coordinate
    divisions=45,--number of blocks
    div_width=2,--horizontal size
    div_height=6,--vertical size
    div_gap=1,--space between bits
    bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
    st_color={0xFF0000,1},--start color for gradient, green
    end_color={0x00FF00,1},--end color for gradient
    mid_color={0xFFFF00,1},--middle color for gradient, yellow
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--CPU GRAPH CPU1
    number=tonumber(conky_parse("${cpu cpu1}")),
    number_max=100,
    bar_startx=42,
    bar_starty=188+bar_adjust,
    divisions=45,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--CPU GRAPH CPU2
    number=tonumber(conky_parse("${cpu cpu2}")),
    number_max=100,
    bar_startx=42,
    bar_starty=210+bar_adjust,
    divisions=45,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--MEMPERC GRAPH
    number=tonumber(conky_parse("${memperc}")),
    number_max=100,
    bar_startx=40,
    bar_starty=330+bar_adjust,
    divisions=45,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--BOOT FILESYSTEM USED GRAPH
    number=tonumber(conky_parse("${fs_used_perc /boot}")),
    number_max=100,
    bar_startx=57,
    bar_starty=408+bar_adjust,
    divisions=40,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--ROOT FILESYSTEM USED GRAPH
    number=tonumber(conky_parse("${fs_used_perc /}")),
    number_max=100,
    bar_startx=58,
    bar_starty=433+bar_adjust,
    divisions=40,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--HOME FILESYSTEM USED GRAPH
    number=tonumber(conky_parse("${fs_used_perc /home}")),
    number_max=100,
    bar_startx=63,
    bar_starty=458+bar_adjust,
    divisions=38,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--SWAP FILESYSTEM USED GRAPH
    number=tonumber(conky_parse("${swapperc}")),
    number_max=100,
    bar_startx=63,
    bar_starty=484+bar_adjust,
    divisions=38,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    end_color={0xFF0000,1},
    };bars(settings)
    --copy and paste above for new bar-------------------------
    --bar setup------------------------------------------------
    settings={--WIRELESS NETWORK GRAPH
    number=tonumber(conky_parse("${wireless_link_qual wlan0}")),
    number_max=100,
    bar_startx=42,
    bar_starty=529+bar_adjust,
    divisions=45,
    div_width=2,
    div_height=6,
    div_gap=1,
    bg_color={0xFFFFFF,0.25},
    st_color={0xFF0000,1},
    end_color={0x00FF00,1},
    mid_color={0xFFFF00,1},
    };if netDEV('wlan0') then bars(settings) end
    --copy and paste above for new bar-------------------------
    --#########################################################################################################
    --#########################################################################################################
    end-- if updates>5
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
    end-- end main function
    function rgb_to_r_g_b(col_a)
    return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
    end
    function bars(t)
    local bar_startx=t.bar_startx
    local bar_starty=t.bar_starty
    local divisions=t.divisions
    local div_width=t.div_width
    local div_height=t.div_height
    local div_gap=t.div_gap
    local br,bg,bb,ba=rgb_to_r_g_b(t.bg_color)
    local sr,sg,sb,sa=rgb_to_r_g_b(t.st_color)
    local mr,mg,mb,ma=rgb_to_r_g_b(t.mid_color)
    local er,eg,eb,ea=rgb_to_r_g_b(t.end_color)
    if t.number==nil then number=0 else number=t.number end
    local number_max=t.number_max
    local number_divs=(number/number_max)*divisions
    cairo_set_line_width (cr,div_width)
    for i=1,divisions do
    if i<(divisions/2) and i<=number_divs then
    colr=((mr-sr)*(i/(divisions/2)))+sr
    colg=((mg-sg)*(i/(divisions/2)))+sg
    colb=((mb-sb)*(i/(divisions/2)))+sb
    cola=((ma-sa)*(i/(divisions/2)))+sa
    elseif i>=(divisions/2) and i<=number_divs then
    colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
    colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
    colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
    cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
    else
    colr=br
    colg=bg
    colb=bb
    cola=ba
    end
    cairo_set_source_rgba (cr,colr,colg,colb,cola)
    cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
    cairo_rel_line_to (cr,0,div_height)
    cairo_stroke (cr)
    end
    end--function bars
    function background(t)
    local corner_r=t.corner_r
    local br,bg,bb,ba=rgb_to_r_g_b(t.bg_color)
    local v=t.bg_height
    local h=t.h
    local w=t.w
    cairo_move_to(cr,corner_r,0)
    cairo_line_to(cr,w-corner_r,0)
    cairo_curve_to(cr,w,0,w,0,w,corner_r)
    cairo_line_to(cr,w,h+v-corner_r)
    cairo_curve_to(cr,w,h+v,w,h+v,w-corner_r,h+v)
    cairo_line_to(cr,corner_r,h+v)
    cairo_curve_to(cr,0,h+v,0,h+v,0,h+v-corner_r)
    cairo_line_to(cr,0,corner_r)
    cairo_curve_to(cr,0,0,0,0,corner_r,0)
    cairo_close_path(cr)
    cairo_set_source_rgba(cr,br,bg,bb,ba)
    cairo_fill(cr)
    end--function background
    
    function netDEV(_dev)
    local _netSTATE
    local _net = io.open('/sys/class/net/'.._dev..'/operstate')
    if _net then
    _netSTATE = _net:read()
    _net:close()
    else return nil
    end
    if _netSTATE == "down" then return nil else return 0 end
    end--function for net device checking
    Attached Images Attached Images
    Eee Pc 1215N notebook-12in Screen-Ubnutu 12.10
    Dual core 1.8 Atom
    2 gig DDR3
    Nvidia Ion(Yes it works,even have HDMI out working)

  2. #19012
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    2,916
    Distro
    Ubuntu Development Release

    Re: Post your .conkyrc files w/ screenshots

    Happy New Year, Conkystadors!


    (Click image to expand)



    Let's hope the Mayan's Calendar Code was wrong...
    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  3. #19013
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    I have been trying out this lua script to draw bars with gradients.

    Code:
    --[[
    BARGRAPH WIDGET
    v2.1 by wlourf (07 Jan. 2011)
    this widget draws a bargraph with different effects 
    http://u-scripts.blogspot.com/2010/07/bargraph-widget.html
        
    To call the script in a conky, use, before TEXT
        lua_load /path/to/the/script/bargraph.lua
        lua_draw_hook_pre main_rings
    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 cpu0}, just write arg="cpu0"
           arg can be a numerical value if name=""
    max  - the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
        
    Optional parameters:
    x,y      - coordinates of the starting point of the bar, default = middle of the conky window
    cap      - end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
            http://www.cairographics.org/samples/set_line_cap/
    angle      - angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
            set to 90 for an horizontal bar
    skew_x      - skew bar around x axis, default = 0
    skew_y      - skew bar around y axis, default = 0
    blocks    - number of blocks to display for a bar (values >0) , default= 10
    height      - height of a block, default=10 pixels
    width      - width of a block, default=20 pixels
    space      - space between 2 blocks, default=2 pixels
    angle_bar - this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
    radius      - for cicular bars, internal radius, default=0
            with radius, parameter width has no more effect.
    
    Colours below are defined into braces {colour in hexadecimal, alpha}
    fg_colour    - colour of a block ON, default= {0x00FF00,1}
    bg_colour    - colour of a block OFF, default = {0x00FF00,0.5}
    alarm         - threshold, values after this threshold will use alarm_colour colour , default=max
    alarm_colour - colour of a block greater than alarm, default=fg_colour
    smooth         - (true or false), create a gradient from fg_colour to bg_colour, default=false 
    mid_colour   - colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
               for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
               3 colours to gradient created by fg_colour and alarm_colour, default=no mid_colour
    led_effect   - add LED effects to each block, default=no led_effect
               if smooth=true, led_effect is not used
               possibles values : "r","a","e" for radial, parallel, perdendicular to the bar (just try!)
               led_effect has to be used with theses colours :
    fg_led         - middle colour of a block ON, default = fg_colour
    bg_led         - middle colour of a block OFF, default = bg_colour
    alarm_led    - middle colour of a block > ALARM,  default = alarm_colour
    
    reflection parameters, not available for circular bars
    reflection_alpha  - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                other values = starting opacity
    reflection_scale  - scale of the reflection (default = 1 = height of text)
    reflection_length - length of reflection, define where the opacity will be set to zero
                values from 0 to 1, default =1
    reflection      - position of reflection, relative to a vertical bar, default="b"
                possibles values are : "b","t","l","r" for bottom, top, left, right
    draw_me           - if set to false, text is not drawn (default = true or 1)
                it can be used with a conky string, if the string returns 1, the text is drawn :
                example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
    
    v1.0 (10 Feb. 2010) original release
    v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value    
    v1.2 (28 Feb. 2010) just renamed the widget to bargraph
    v1.3 (03 Mar. 2010) added parameters radius & angle_bar to draw the bar in a circular way
    v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
    v2.1 (07 Jan. 2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"
    
    --      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'
    
    ----------------START OF PARAMETERS ----------
    function conky_main_bars()
        local bars_settings={
            {    --[ Graph for CPU1 ]--
                name="cpu",
                arg="cpu0",
                max=100,
                alarm=80,
                alarm_colour={0xFF0000,0.72},
                bg_colour={0x2F4F4F,0.0},
                fg_colour={0x00FF00,0.55},
                mid_colour={{0.45,0xFFFF00,0.70}},
                x=30,y=30,
                blocks=56,
                space=1,
                height=2,width=5,
                angle=90,
                smooth=true
                }
             }    
    -----------END OF PARAMETERS--------------
    
    
        
        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)    
        --prevent segmentation error when reading cpu state
        if tonumber(conky_parse('${updates}'))>3 then
            for i in pairs(bars_settings) do
                
                draw_multi_bar_graph(bars_settings[i])
                
            end
        end
        cairo_destroy(cr)
        cairo_surface_destroy(cs)
        cr=nil
    
    end
    
    
    
    function draw_multi_bar_graph(t)
        cairo_save(cr)
        --check values
        if t.draw_me == true then t.draw_me = nil end
        if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end    
        if t.name==nil and t.argDarkOrange`/usr/bin/banshee --query-title --no-present | cut -f1- -d ${if_empty ${wireless_essid wlan0}}${else}1$endif==nil then 
            print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
            return
        end
        if t.max==nil then
            print ("No maximum value defined, use 'max'")
            return
        end
        if t.name==nil then t.name="" end
        if t.arg==nil then t.arg="" end
    
        --set default values    
        if t.x == nil        then t.x = conky_window.width/2 end
        if t.y == nil        then t.y = conky_window.height/2 end
        if t.blocks == nil    then t.blocks=10 end
        if t.height == nil    then t.height=10 end
        if t.angle == nil     then t.angle=0 end
        t.angle = t.angle*math.pi/180
        --line cap style
        if t.cap==nil        then t.cap = "b" end
        local cap="b"
        for i,v in ipairs({"s","r","b"}) do 
            if v==t.cap then cap=v end
        end
        local delta=0
        if t.cap=="r" or t.cap=="s" then delta = t.height end
        if cap=="s" then     cap = CAIRO_LINE_CAP_SQUARE
        elseif cap=="r" then
            cap = CAIRO_LINE_CAP_ROUND
        elseif cap=="b" then
            cap = CAIRO_LINE_CAP_BUTT
        end
        --end line cap style
        --if t.led_effect == nil    then t.led_effect="r" end
        if t.width == nil    then t.width=20 end
        if t.space == nil    then t.space=2 end
        if t.radius == nil    then t.radius=0 end
        if t.angle_bar == nil    then t.angle_bar=0 end
        t.angle_bar = t.angle_bar*math.pi/360 --halt angle
        
        --colours
        if t.bg_colour == nil     then t.bg_colour = {0x00FF00,0.5} end
        if #t.bg_colour~=2         then t.bg_colour = {0x00FF00,0.5} end
        if t.fg_colour == nil     then t.fg_colour = {0x00FF00,1} end
        if #t.fg_colour~=2         then t.fg_colour = {0x00FF00,1} end
        if t.alarm_colour == nil     then t.alarm_colour = t.fg_colour end
        if #t.alarm_colour~=2         then t.alarm_colour = t.fg_colour end
    
        if t.mid_colour ~= nil then    
            for i=1, #t.mid_colour do    
                if #t.mid_colour[i]~=3 then 
                    print ("error in mid_color table")
                    t.mid_colour[i]={1,0xFFFFFF,1} 
                end
            end
        end
        
        if t.bg_led ~= nil and #t.bg_led~=2    then t.bg_led = t.bg_colour end
        if t.fg_led ~= nil and #t.fg_led~=2    then t.fg_led = t.fg_colour end
        if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
        
        if t.led_effect~=nil then
            if t.bg_led == nil then t.bg_led = t.bg_colour end
            if t.fg_led == nil     then t.fg_led = t.fg_colour end
            if t.alarm_led == nil  then t.alarm_led = t.fg_led end
        end
        
    
        if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
        if t.smooth == nil then t.smooth = false end
    
        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
        
        if t.reflection_alpha==nil then t.reflection_alpha=0 end
        if t.reflection_length==nil then t.reflection_length=1 end
        if t.reflection_scale==nil then t.reflection_scale=1 end
        
        --end of default values
        
    
         local function rgb_to_r_g_b(col_a)
            return ((col_a[1] / 0x10000) % 0x100) / 255., ((_surface_destroy(cs)
        cairo_destroy(cr)
        end
    but all I get is this error.
    Code:
    Conky: llua_do_call: function conky_main_bars execution failed: attempt to call a nil value
    The relevant part of my .conkyrc
    Code:
    ########
    alignment top_right
    double_buffer
    background no
    border_width 1
    cpu_avg_samples 2
    default_color CC9900
    default_outline_color 800000 
    default_shade_color 006400
    #own_window_colour 006400
    color0 EE7600 
    color1 EE7600
    # red 8B0000
    draw_borders no
    draw_graph_borders yes
    draw_outline no
    draw_shades no
    use_xft yes
    xftfont Monospace:size=10
    gap_x 4
    gap_y 3
    minimum_size 618 1080
    maximum_width 618
    maximum_size 618 1080
    net_avg_samples 2
    no_buffers yes
    out_to_console no
    out_to_stderr no
    extra_newline no
    own_window yes
    own_window_transparent yes
    #own_window_argb_visual true
    #own_window_argb_value 50
    own_window_class Conky
    own_window_type desktop
    #stippled_borders 0
    update_interval 1.0
    uppercase no
    use_spacer none
    show_graph_scale yes
    show_graph_range no
    #temperature_unit fahrenheit
    text_buffer_size 2560
    #pad_percents 3
    #show_graph_scale
    default_bar_size 432 6
    imlib_cache_size 0
    
    lua_load /path_to/bargraph_small_edit.lua
    lua_draw_hook_post conky_main_bars
    
    TEXT
    ${image /path_to/Conky_Background.png -p -1,0 -s 629x1080}${alignc}${color}${nodename} ${color0}- ${color}${sysname} ${kernel} on ${color}${machine} ${color0}| ${color}Workspace ${desktop}
    #${alignc}${color}Screenshot Mode ${color0}- ${color}${sysname} ${kernel} on ${machine} ${color0}| ${color}Workspace ${desktop}
    $alignc${color}${time %r} ${color1}| ${color}${time %F} ${color1}| ${color0}Uptime:$color $uptime ${color1}| ${color0}Processes:$color $processes ${color1}| ${color0}Running:$color $running_processes 
    ${voffset -6}${color1}$hr
    ${voffset -3}${color}Overall CPU Usage: ${color0}${cpubar cpu0 6,425} $color${cpu cpu0}%
    ${voffset -3}${color1}${cpugraph cpu1 75,300 FFCC00 CC0000} $alignr${cpugraph cpu2 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU1:$color ${cpu cpu1}% ${color1}| $color${execi 1 sensors | grep "Core 0:" | cut -c15-21} ${color1}| $color${freq 1} MHz ${goto 323}${color0}CPU2:$color ${cpu cpu2}% ${color1}| $color${execi 1 sensors | grep "Core 0:" | cut -c15-21} ${color1}| $color${freq 2} MHz
    ${voffset -3}${color1}${cpugraph cpu3 75,300 FFCC00 CC0000} $alignr${cpugraph cpu4 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU3:$color ${cpu cpu3}% ${color1}| $color${execi 1 sensors | grep "Core 1:" | cut -c15-21} ${color1}| $color${freq 3} MHz ${goto 323}${color0}CPU4:$color ${cpu cpu4}% ${color1}| $color${execi 1 sensors | grep "Core 1:" | cut -c15-21} ${color1}| $color${freq 4} MHz
    ${voffset -3}${color1}${cpugraph cpu5 75,300 FFCC00 CC0000} $alignr${cpugraph cpu6 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU5:$color ${cpu cpu5}% ${color1}| $color${execi 1 sensors | grep "Core 2:" | cut -c15-21} ${color1}| $color${freq 5} MHz ${goto 323}${color0}CPU6:$color ${cpu cpu6}% ${color1}| $color${execi 1 sensors | grep "Core 2:" | cut -c15-21} ${color1}| $color${freq 6} MHz
    ${voffset -3}${color1}${cpugraph cpu7 75,300 FFCC00 CC0000} $alignr${cpugraph cpu8 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU7:$color ${cpu cpu7}% ${color1}| $color${execi 1 sensors | grep "Core 3:" | cut -c15-21} ${color1}| $color${freq 7} MHz ${goto 323}${color0}CPU8:$color ${cpu cpu8}% ${color1}| $color${execi 1 sensors | grep "Core 3:" | cut -c15-21} ${color1}| $color${freq 8} MHz
    ${voffset -7}${color1}$hr
    Does anyone know why it is not working?
    Last edited by arclance; January 2nd, 2012 at 02:20 AM.

  4. #19014
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Post your .conkyrc files w/ screenshots

    This line in your conky config has to show the actual path to
    where you saved the lua script.
    Code:
    lua_load /path_to/bargraph_small_edit.lua

  5. #19015
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by stinkeye View Post
    This line in your conky config has to show the actual path to
    where you saved the lua script.
    Code:
    lua_load /path_to/bargraph_small_edit.lua
    It does I removed the actual path before posting it.
    Thats what the path_to is for, to suggest that I have removed the path but do actually have it there.
    Do you have any other suggestions as to what the problem is?

    The error happens on the
    Code:
    lua_draw_hook_post conky_main_bars
    it goes away if I change it to
    Code:
    #lua_draw_hook_post conky_main_bars
    but then I am not running the lua script.

    If I had the path wrong I would get that error when I load the script not when I execute it.
    Last edited by arclance; January 2nd, 2012 at 03:01 AM.

  6. #19016
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Post your .conkyrc files w/ screenshots

    I don't know lua but I have that script and it loads without error using your
    conky but my lua script.
    I did comment out the extra cpu lines though in your conky config, as I only have 2.
    My lua script has a section for each cpu...
    eg
    Code:
    ----------------START OF PARAMETERS ----------
    function conky_main_bars()
    	local bars_settings={
    		{	--[ Graph for CPU1 ]--
    			name="cpu",
    			arg="cpu1",
    			max=100,
    			alarm=50,
    			alarm_colour={0xFF0000,0.72},
    			bg_colour={0xFFFFFF,0.25},
    			fg_colour={0x00FF00,0.55},
    			mid_colour={{0.45,0xFFFF00,0.70}},
    			x=70,y=13,
    			blocks=25,
    			space=1,
    			height=2,width=5,
    			angle=90,
    			smooth=true
    			},
    		{	--[ Graph for CPU2 ]--
    			name="cpu",
    			arg="cpu2",
    			max=100,
    			alarm=50,
    			alarm_colour={0xFF0000,0.72},
    			bg_colour={0xFFFFFF,0.25},
    			fg_colour={0x00FF00,0.55},
    			mid_colour={{0.45,0xFFFF00,0.70}},
    			x=70,y=32,
    			blocks=25,
    			space=1,
    			height=2,width=5,
    			angle=90,
    			smooth=true
    			},
    You probably need to add the extra cpu cores to your lua script.
    That's about all I can tell you.
    Last edited by stinkeye; January 2nd, 2012 at 04:19 AM.

  7. #19017
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by stinkeye View Post
    I don't know lua but I have that script and it loads without error using your
    conky but my lua script.
    I did comment out the extra cpu lines though in your conky config, as I only have 2.
    My lua script has a section for each cpu...
    eg
    Code:
    ----------------START OF PARAMETERS ----------
    function conky_main_bars()
        local bars_settings={
            {    --[ Graph for CPU1 ]--
                name="cpu",
                arg="cpu1",
                max=100,
                alarm=50,
                alarm_colour={0xFF0000,0.72},
                bg_colour={0xFFFFFF,0.25},
                fg_colour={0x00FF00,0.55},
                mid_colour={{0.45,0xFFFF00,0.70}},
                x=70,y=13,
                blocks=25,
                space=1,
                height=2,width=5,
                angle=90,
                smooth=true
                },
            {    --[ Graph for CPU2 ]--
                name="cpu",
                arg="cpu2",
                max=100,
                alarm=50,
                alarm_colour={0xFF0000,0.72},
                bg_colour={0xFFFFFF,0.25},
                fg_colour={0x00FF00,0.55},
                mid_colour={{0.45,0xFFFF00,0.70}},
                x=70,y=32,
                blocks=25,
                space=1,
                height=2,width=5,
                angle=90,
                smooth=true
                },
    That's about all I can tell you.
    I removed the extra bars to make sure they were not causing the problems, I will add 2 more once I have it working.
    I only posted the part of my .conkyrc up to parts about the cpu before.
    The whole thing looks like this.
    Code:
    ########
    alignment top_right
    double_buffer
    background no
    border_width 1
    cpu_avg_samples 2
    default_color CC9900
    default_outline_color 800000 
    default_shade_color 006400
    #own_window_colour 006400
    color0 EE7600 
    color1 EE7600
    # red 8B0000
    draw_borders no
    draw_graph_borders yes
    draw_outline no
    draw_shades no
    use_xft yes
    xftfont Monospace:size=10
    gap_x 4
    gap_y 3
    minimum_size 618 1080
    maximum_width 618
    net_avg_samples 2
    no_buffers yes
    out_to_console no
    out_to_stderr no
    extra_newline no
    own_window yes
    own_window_transparent yes
    #own_window_argb_visual true
    #own_window_argb_value 50
    own_window_class Conky
    own_window_type desktop
    #stippled_borders 0
    update_interval 1.0
    uppercase no
    use_spacer none
    show_graph_scale yes
    show_graph_range no
    #temperature_unit fahrenheit
    text_buffer_size 2560
    #pad_percents 3
    #show_graph_scale
    default_bar_size 432 6
    imlib_cache_size 0
    
    lua_load /path_to/Conky/bargraph_small_edit.lua
    #lua_draw_hook_post main_bars
    
    TEXT
    ${image /path_to/Conky_Background.png -p -1,0 -s 629x1080}${alignc}${color}${nodename} ${color0}- ${color}${sysname} ${kernel} on ${color}${machine} ${color0}| ${color}Workspace ${desktop}
    #${alignc}${color}Screenshot Mode ${color0}- ${color}${sysname} ${kernel} on ${machine} ${color0}| ${color}Workspace ${desktop}
    $alignc${color}${time %r} ${color1}| ${color}${time %F} ${color1}| ${color0}Uptime:$color $uptime ${color1}| ${color0}Processes:$color $processes ${color1}| ${color0}Running:$color $running_processes 
    ${voffset -6}${color1}$hr
    ${voffset -3}${color}Overall CPU Usage: ${color0}${cpubar cpu0 6,425} $color${cpu cpu0}%
    ${voffset -3}${color1}${cpugraph cpu1 75,300 FFCC00 CC0000} $alignr${cpugraph cpu2 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU1:$color ${cpu cpu1}% ${color1}| $color${execi 1 sensors | grep "Core 0:" | cut -c15-21} ${color1}| $color${freq 1} MHz ${goto 323}${color0}CPU2:$color ${cpu cpu2}% ${color1}| $color${execi 1 sensors | grep "Core 0:" | cut -c15-21} ${color1}| $color${freq 2} MHz
    ${voffset -3}${color1}${cpugraph cpu3 75,300 FFCC00 CC0000} $alignr${cpugraph cpu4 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU3:$color ${cpu cpu3}% ${color1}| $color${execi 1 sensors | grep "Core 1:" | cut -c15-21} ${color1}| $color${freq 3} MHz ${goto 323}${color0}CPU4:$color ${cpu cpu4}% ${color1}| $color${execi 1 sensors | grep "Core 1:" | cut -c15-21} ${color1}| $color${freq 4} MHz
    ${voffset -3}${color1}${cpugraph cpu5 75,300 FFCC00 CC0000} $alignr${cpugraph cpu6 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU5:$color ${cpu cpu5}% ${color1}| $color${execi 1 sensors | grep "Core 2:" | cut -c15-21} ${color1}| $color${freq 5} MHz ${goto 323}${color0}CPU6:$color ${cpu cpu6}% ${color1}| $color${execi 1 sensors | grep "Core 2:" | cut -c15-21} ${color1}| $color${freq 6} MHz
    ${voffset -3}${color1}${cpugraph cpu7 75,300 FFCC00 CC0000} $alignr${cpugraph cpu8 75,300 FFCC00 CC0000}
    ${voffset -8}${color0}CPU7:$color ${cpu cpu7}% ${color1}| $color${execi 1 sensors | grep "Core 3:" | cut -c15-21} ${color1}| $color${freq 7} MHz ${goto 323}${color0}CPU8:$color ${cpu cpu8}% ${color1}| $color${execi 1 sensors | grep "Core 3:" | cut -c15-21} ${color1}| $color${freq 8} MHz
    ${voffset -7}${color1}$hr
    ${voffset -4}${color0}CPU Fan:${color}${goto 70}${execi 1 sensors | grep "CPU:" | cut -c14-21}${color1}${goto 137}|${goto 147}${color0}CPU Ext.Temp:${color}${goto 252}${execi 1 sensors | grep "PECI Agent 0:" | cut -c16-22}${color1}${goto 302}|${goto 312}${color0}CPU Voltage:${color}${goto 410}${execi 1 sensors | grep "Vcore" | cut -c15-21}${color1}${goto 469}|${goto 479}${color0}Case Temp:${color}${goto 560}${execi 1 sensors | grep "SYSTIN:" | cut -c16-22}${color1}
    ${voffset -6}${color1}$hr
    ${voffset -4}${color0}Case Fan 1:${color}${goto 87}${execi 1 sensors | grep "Chassis1:" | cut -c14-21}${color1}${goto 154}|${goto 164}${color0}Case Fan 2:${color}${goto 246}${execi 1 sensors | grep "Chassis2:" | cut -c14-21}${color1}${goto 313}|${goto 323}${color0}GPU Temp:${color}${goto 397}${nvidia temp}°C${color1}${goto 430}|${goto 440}${color0}GFreq:${color}${goto 490}${nvidia gpufreq} MHz${color1}/${color}${nvidia memfreq} MHz${color1}
    ${voffset -7}${color1}$hr
    ${voffset -4}${color0}Name               PID   CPU%   MEM%${goto 308}${color1}|${alignr 5}${color0}Name               PID   CPU%   MEM%
    ${color}${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}${goto 308}${color1}|${alignr 5}${color}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
    ${color}${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}${goto 308}${color1}|${alignr 5}${color}${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
    ${color}${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}${goto 308}${color1}|${alignr 5}${color}${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
    ${color}${top_mem name 4} ${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}${goto 308}${color1}|${alignr 5}${color}${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
    ${color}${top_mem name 5} ${top_mem pid 5} ${top_mem cpu 5} ${top_mem mem 5}${goto 308}${color1}|${alignr 5}${color}${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
    ${voffset -4}${color1}$hr
    ${color0}RAM Usage:$color  $mem${color1}/$color$memmax ${color1}- $color$memperc% 
    ${color0}Swap Usage:$color $swap${color1}/$color$swapmax ${color1}- $color$swapperc% ${voffset -20}${alignr}${color1}${memgraph 30,300 FFCC00 CC0000}
    ${voffset -8}${execpi 1 cat /path_to/hddata_conky.txt}
    ${voffset -6}${color1}$hr
    ${voffset -4}${color0}wlan0 $color${addrs wlan0}${color1}|$color${execi 3600 wget -O - http://ip.tupeux.com | tail}${color1}|$color${wireless_bitrate wlan0}${goto 323}${color0}eth0 ${color}${addr eth0}${color1}|${color}1000 Mb/s
    #${voffset -4}${color0}wlan0 ${color}Screenshot${color1}|${color}Mode${color1}|${color}${wireless_bitrate wlan0}${goto 323}${color0}eth0 ${color}Screenshot Mode${color1}|${color}1000 Mb/s
    ${voffset -3}${color1}${upspeedgraph wlan0 40,300 FFCC00 CC0000} $alignr${upspeedgraph eth0 40,300 FFCC00 CC0000}
    ${voffset -7}${color0}Up:${color}   ${upspeed wlan0}${color0}|${color}${totalup wlan0}${goto 323}${color0}Up:$color   ${upspeed eth0}${color0}|${color}${totalup eth0}
    ${voffset -3}${color1}${downspeedgraph wlan0 40,300 FFCC00 CC0000} $alignr${downspeedgraph eth0 40,300 FFCC00 CC0000}
    ${voffset -7}${color0}Down:$color ${downspeed wlan0}${color0}|${color}${totaldown wlan0}${goto 323}${color0}Down:$color ${downspeed eth0}${color0}|${color}${totaldown eth0}
    ${voffset -6}${color1}$hr
    ${execpi 3 cat /path_to/conkylog.txt}
    ${voffset -3}${color1}$hr
    ${voffset -1}${execpi 225 cat /path_to/updateCheck_log.txt}${voffset 1}
    ${voffset -6}${color1}$hr
    ${if_running deadbeef-main}${execp ~/conkyDeadbeef.py --template=~/conkyDeadbeef.template3}
    ${texeci 4 ~/db-cover.sh}${image /tmp/deadbeef-coverart.png -p 518,972 -s 105x105}${else}     
         
         
         
        
    ${texeci 1800 ~/db-cover.sh}${image /tmp/deadbeef-coverart.png -p 518,972 -s 105x105} 
    ${endif}
    I tried running it with only the part I posted before and I get a different error.
    Code:
    Conky: llua_load: /path_to/bargraph_small_edit.lua:139: 'then' expected near '`'
    This is line 139
    Code:
    if t.name==nil and t.argDarkOrange`/usr/bin/banshee --query-title --no-present | cut -f1- -d ${if_empty ${wireless_essid wlan0}}${else}1$endif==nil then
    I don't know any Lua so this does not help me much.

    Edit:
    Quote Originally Posted by stinkeye View Post
    You probably need to add the extra cpu cores to your lua script.
    Only if I want one for each cpu which I don't.
    I only want one for overall cpu usage, cpu0, not cpu1 through cpu8.
    I am using graphs not bars for the individual cores.
    The script does not require you to use all your cores just the ones you specify, that much I understand.
    I don't know any Lua so I can't determine what part is causing the script to not work for me myself.
    Last edited by arclance; January 2nd, 2012 at 05:11 AM.

  8. #19018
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Post your .conkyrc files w/ screenshots

    line 139 looks like a paste error where conky code has been inserted.
    Code:
    if t.name==nil and t.argDarkOrange`/usr/bin/banshee --query-title --no-present | cut -f1- -d ${if_empty ${wireless_essid wlan0}}${else}1$endif==nil then
    The line in my script reads...
    Code:
    if t.name==nil and t.arg==nil then
    There is still an error somewhere else though.

    Try this with your parameters and my lua script below parameters.
    Code:
    --[[
    BARGRAPH WIDGET
    v2.1 by wlourf (07 Jan. 2011)
    this widget draws a bargraph with different effects 
    http://u-scripts.blogspot.com/2010/07/bargraph-widget.html
        
    To call the script in a conky, use, before TEXT
        lua_load /path/to/the/script/bargraph.lua
        lua_draw_hook_pre main_rings
    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 cpu0}, just write arg="cpu0"
           arg can be a numerical value if name=""
    max  - the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
        
    Optional parameters:
    x,y      - coordinates of the starting point of the bar, default = middle of the conky window
    cap      - end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
            http://www.cairographics.org/samples/set_line_cap/
    angle      - angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
            set to 90 for an horizontal bar
    skew_x      - skew bar around x axis, default = 0
    skew_y      - skew bar around y axis, default = 0
    blocks    - number of blocks to display for a bar (values >0) , default= 10
    height      - height of a block, default=10 pixels
    width      - width of a block, default=20 pixels
    space      - space between 2 blocks, default=2 pixels
    angle_bar - this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
    radius      - for cicular bars, internal radius, default=0
            with radius, parameter width has no more effect.
    
    Colours below are defined into braces {colour in hexadecimal, alpha}
    fg_colour    - colour of a block ON, default= {0x00FF00,1}
    bg_colour    - colour of a block OFF, default = {0x00FF00,0.5}
    alarm         - threshold, values after this threshold will use alarm_colour colour , default=max
    alarm_colour - colour of a block greater than alarm, default=fg_colour
    smooth         - (true or false), create a gradient from fg_colour to bg_colour, default=false 
    mid_colour   - colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
               for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
               3 colours to gradient created by fg_colour and alarm_colour, default=no mid_colour
    led_effect   - add LED effects to each block, default=no led_effect
               if smooth=true, led_effect is not used
               possibles values : "r","a","e" for radial, parallel, perdendicular to the bar (just try!)
               led_effect has to be used with theses colours :
    fg_led         - middle colour of a block ON, default = fg_colour
    bg_led         - middle colour of a block OFF, default = bg_colour
    alarm_led    - middle colour of a block > ALARM,  default = alarm_colour
    
    reflection parameters, not available for circular bars
    reflection_alpha  - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                other values = starting opacity
    reflection_scale  - scale of the reflection (default = 1 = height of text)
    reflection_length - length of reflection, define where the opacity will be set to zero
                values from 0 to 1, default =1
    reflection      - position of reflection, relative to a vertical bar, default="b"
                possibles values are : "b","t","l","r" for bottom, top, left, right
    draw_me           - if set to false, text is not drawn (default = true or 1)
                it can be used with a conky string, if the string returns 1, the text is drawn :
                example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
    
    v1.0 (10 Feb. 2010) original release
    v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value    
    v1.2 (28 Feb. 2010) just renamed the widget to bargraph
    v1.3 (03 Mar. 2010) added parameters radius & angle_bar to draw the bar in a circular way
    v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
    v2.1 (07 Jan. 2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"
    
    --      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'
    
    ----------------START OF PARAMETERS ----------
    function conky_main_bars()
        local bars_settings={
            {    --[ Graph for CPU1 ]--
                name="cpu",
                arg="cpu0",
                max=100,
                alarm=80,
                alarm_colour={0xFF0000,0.72},
                bg_colour={0x2F4F4F,0.0},
                fg_colour={0x00FF00,0.55},
                mid_colour={{0.45,0xFFFF00,0.70}},
                x=30,y=30,
                blocks=56,
                space=1,
                height=2,width=5,
                angle=90,
                smooth=true
                }
             }    
    -----------END OF PARAMETERS--------------
    
    
        
    	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)    
    	--prevent segmentation error when reading cpu state
        if tonumber(conky_parse('${updates}'))>3 then
            for i in pairs(bars_settings) do
            	
            	draw_multi_bar_graph(bars_settings[i])
            	
            end
        end
    	cairo_destroy(cr)
    	cairo_surface_destroy(cs)
    	cr=nil
    
    end
    
    
    
    function draw_multi_bar_graph(t)
    	cairo_save(cr)
    	--check values
    	if t.draw_me == true then t.draw_me = nil end
    	if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end	
    	if t.name==nil and t.arg==nil then 
    		print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
    		return
    	end
    	if t.max==nil then
    		print ("No maximum value defined, use 'max'")
    		return
    	end
    	if t.name==nil then t.name="" end
    	if t.arg==nil then t.arg="" end
    
    	--set default values	
    	if t.x == nil		then t.x = conky_window.width/2 end
    	if t.y == nil		then t.y = conky_window.height/2 end
    	if t.blocks == nil	then t.blocks=10 end
    	if t.height == nil	then t.height=10 end
    	if t.angle == nil 	then t.angle=0 end
    	t.angle = t.angle*math.pi/180
    	--line cap style
    	if t.cap==nil		then t.cap = "b" end
    	local cap="b"
    	for i,v in ipairs({"s","r","b"}) do 
    		if v==t.cap then cap=v end
    	end
    	local delta=0
    	if t.cap=="r" or t.cap=="s" then delta = t.height end
    	if cap=="s" then 	cap = CAIRO_LINE_CAP_SQUARE
    	elseif cap=="r" then
    		cap = CAIRO_LINE_CAP_ROUND
    	elseif cap=="b" then
    		cap = CAIRO_LINE_CAP_BUTT
    	end
    	--end line cap style
    	--if t.led_effect == nil	then t.led_effect="r" end
    	if t.width == nil	then t.width=20 end
    	if t.space == nil	then t.space=2 end
    	if t.radius == nil	then t.radius=0 end
    	if t.angle_bar == nil	then t.angle_bar=0 end
    	t.angle_bar = t.angle_bar*math.pi/360 --halt angle
    	
    	--colours
    	if t.bg_colour == nil 	then t.bg_colour = {0x00FF00,0.5} end
    	if #t.bg_colour~=2 		then t.bg_colour = {0x00FF00,0.5} end
    	if t.fg_colour == nil 	then t.fg_colour = {0x00FF00,1} end
    	if #t.fg_colour~=2 		then t.fg_colour = {0x00FF00,1} end
    	if t.alarm_colour == nil 	then t.alarm_colour = t.fg_colour end
    	if #t.alarm_colour~=2 		then t.alarm_colour = t.fg_colour end
    
    	if t.mid_colour ~= nil then	
    		for i=1, #t.mid_colour do    
    		    if #t.mid_colour[i]~=3 then 
    		    	print ("error in mid_color table")
    		    	t.mid_colour[i]={1,0xFFFFFF,1} 
    		    end
    		end
        end
        
    	if t.bg_led ~= nil and #t.bg_led~=2	then t.bg_led = t.bg_colour end
    	if t.fg_led ~= nil and #t.fg_led~=2	then t.fg_led = t.fg_colour end
    	if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
    	
    	if t.led_effect~=nil then
    		if t.bg_led == nil then t.bg_led = t.bg_colour end
    		if t.fg_led == nil 	then t.fg_led = t.fg_colour end
    		if t.alarm_led == nil  then t.alarm_led = t.fg_led end
    	end
    	
    
    	if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
    	if t.smooth == nil then t.smooth = false end
    
    	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
    	
    	if t.reflection_alpha==nil then t.reflection_alpha=0 end
    	if t.reflection_length==nil then t.reflection_length=1 end
    	if t.reflection_scale==nil then t.reflection_scale=1 end
    	
    	--end of default values
    	
    
     	local function rgb_to_r_g_b(col_a)
    		return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
    	end
    	
    	
    	--functions used to create patterns
    
    	local function create_smooth_linear_gradient(x0,y0,x1,y1)
    		local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
    		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
    		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
    		if t.mid_colour ~=nil then
    			for i=1, #t.mid_colour do
    				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
    			end
    		end
    		return pat
    	end
    
    	local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
    		local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
    		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
    		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
    		if t.mid_colour ~=nil then
    			for i=1, #t.mid_colour do
    				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
    			end
    		end
    		return pat
    	end
    	
    	local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
    		local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
    		cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
    		cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
    		cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
    		return pat
    	end
    
    	local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
    		local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
    		if mode==3 then
    			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))				
    			cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
    			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
    		else
    			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
    			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
    		end
    		return pat
    	end
    
    
    
    
    
    
    	local function draw_single_bar()
    		--this fucntion is used for bars with a single block (blocks=1) but 
    		--the drawing is cut in 3 blocks : value/alarm/background
    		--not zvzimzblr for circular bar
    		local function create_pattern(col_alp,col_led,bg)
    			local pat
    			
    			if not t.smooth then
    				if t.led_effect=="e" then
    					pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
    				elseif t.led_effect=="a" then
    					pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
    				elseif  t.led_effect=="r" then
    					pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
    				else
    					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
    				end
    			else
    				if bg then
    					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
    				else
    					pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
    				end
    			end
    			return pat
    		end
    		
    		local y1=-t.height*pct/100
    		local y2,y3
    		if pct>(100*t.alarm/t.max) then 
    			y1 = -t.height*t.alarm/100
    			y2 = -t.height*pct/100
    			if t.smooth then y1=y2 end
    		end
    		
    		if t.angle_bar==0 then
    		
    			--block for fg value
    			local pat = create_pattern(t.fg_colour,t.fg_led,false)
    			cairo_set_source(cr,pat)
    			cairo_rectangle(cr,0,0,t.width,y1)
    			cairo_fill(cr)
    			cairo_pattern_destroy(pat)
    		
    			-- block for alarm value			
    			if not t.smooth and y2 ~=nil then 
    				pat = create_pattern(t.alarm_colour,t.alarm_led,false)
    				cairo_set_source(cr,pat)
    				cairo_rectangle(cr,0,y1,t.width,y2-y1)
    				cairo_fill(cr)
    				y3=y2
    				cairo_pattern_destroy(pat)
    			else
    				y2,y3=y1,y1
    			end
    			-- block for bg value
    			cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
    			pat = create_pattern(t.bg_colour,t.bg_led,true)
    			cairo_set_source(cr,pat)
    			cairo_pattern_destroy(pat)
    			cairo_fill(cr)
    		end		
    	end  --end single bar
    	
    
    
    
    
    
    	local function draw_multi_bar()
    		--function used for bars with 2 or more blocks
    		for pt = 1,t.blocks do 
    			--set block y
    			local y1 = -(pt-1)*(t.height+t.space)
    			local light_on=false
    			
    			--set colors
    			local col_alp = t.bg_colour
    			local col_led = t.bg_led
    			if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
    				if pct>=(pcb*(pt-1))  then 
    					light_on = true
    					col_alp = t.fg_colour
    					col_led = t.fg_led
    					if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then 
    						col_alp = t.alarm_colour 
    						col_led = t.alarm_led 
    					end
    				end
    			end
    
    			--set colors
    			--have to try to create gradients outside the loop ?
    			local pat 
    			
    			if not t.smooth then
    				if t.angle_bar==0 then
    					if t.led_effect=="e" then
    						pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
    					elseif t.led_effect=="a" then
    						pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)					
    					elseif  t.led_effect=="r" then
    						pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)	
    					else
    						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
    					end
    				else
    					 if t.led_effect=="a"  then
    						 pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
    														 0, 0, t.radius+(t.height+t.space)*(pt),						 
    											 col_alp,col_led,3)	
    					else
    						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))					
    					end
    					
    				end
    			else
    				
    				if light_on then
    					if t.angle_bar==0 then
    						pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
    					else
    						pat = create_smooth_radial_gradient(0, 0, (t.height+t.space),  0,0,(t.blocks+1)*(t.height+t.space),2)
    					end
    				else		
    					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
    				end
    			end
    			cairo_set_source (cr, pat)
    			cairo_pattern_destroy(pat)
    
    			--draw a block
    			if t.angle_bar==0 then
    				cairo_move_to(cr,0,y1)
    				cairo_line_to(cr,t.width,y1)
    			else		
    				cairo_arc( cr,0,0,
    					t.radius+(t.height+t.space)*(pt)-t.height/2,
    					 -t.angle_bar -math.pi/2 ,
    					 t.angle_bar -math.pi/2)
    			end
    			cairo_stroke(cr)
    		end	
    	end
    	
    	
    	
    	
    	local function setup_bar_graph()
    		--function used to retrieve the value to display and to set the cairo structure
    		if t.blocks ~=1 then t.y=t.y-t.height/2 end
    		
    		local value = 0
    		if t.name ~="" then
    			value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
    			--$to_bytes doesn't work when value has a decimal point,
    			--https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
    			--http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
    			--conky bug?
    			--value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
    			--if string.match(value,"%w") then
    			--	value = conky_parse(string.format('${to_bytes %s}',value))
    			--end
    		else
    			value = tonumber(t.arg)
    		end
    
    		if value==nil then value =0 end
    		
    		pct = 100*value/t.max
    		pcb = 100/t.blocks
    		
    		cairo_set_line_width (cr, t.height)
    		cairo_set_line_cap  (cr, cap)
    		cairo_translate(cr,t.x,t.y)
    		cairo_rotate(cr,t.angle)
    
    		local matrix0 = cairo_matrix_t:create()
    		tolua.takeownership(matrix0)
    		cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
    		cairo_transform(cr,matrix0)
    
    	
    		
    		--call the drawing function for blocks
    		if t.blocks==1 and t.angle_bar==0 then
    			draw_single_bar()
    			if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
    		else
    			draw_multi_bar()
    		end
    
    		--dot for reminder
    		--[[
    		if t.blocks ~=1 then
    			cairo_set_source_rgba(cr,1,0,0,1)
    			cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
    			cairo_fill(cr)
    		else
    			cairo_set_source_rgba(cr,1,0,0,1)
    			cairo_arc(cr,0,0,3,0,2*math.pi)
    			cairo_fill(cr)
    		end]]
    		
    		--call the drawing function for reflection and prepare the mask used		
    		if t.reflection_alpha>0 and t.angle_bar==0 then
    			local pat2
    			local matrix1 = cairo_matrix_t:create()
    			tolua.takeownership(matrix1)
    			if t.angle_bar==0 then
    				pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
    				if t.reflection=="t" then
    					cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
    					pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
    				elseif t.reflection=="r" then
    					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
    					pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
    				elseif t.reflection=="l" then
    					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
    					pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
    				else --bottom
    					cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
    					pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
    				end
    			end
    			cairo_transform(cr,matrix1)
    
    			if t.blocks==1 and t.angle_bar==0 then
    				draw_single_bar()
    				cairo_translate(cr,0,-t.height/2) 
    			else
    				draw_multi_bar()
    			end
    			
    			
    			cairo_set_line_width(cr,0.01)
    			cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
    			cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
    			if t.angle_bar==0 then
    				cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
    			end
    			cairo_clip_preserve(cr)
    			cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
    			cairo_stroke(cr)
    			cairo_mask(cr,pat2)
    			cairo_pattern_destroy(pat2)
    			cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
    			
    		end --reflection
    		pct,pcb=nil
    	end --setup_bar_graph()
    	
    	--start here !
    	setup_bar_graph()
    	cairo_restore(cr)
    end
    Last edited by stinkeye; January 2nd, 2012 at 08:21 AM.

  9. #19019
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by stinkeye View Post
    line 139 looks like a paste error where conky code has been inserted.
    Code:
    if t.name==nil and t.argDarkOrange`/usr/bin/banshee --query-title --no-present | cut -f1- -d ${if_empty ${wireless_essid wlan0}}${else}1$endif==nil then
    The line in my script reads...
    Code:
    if t.name==nil and t.arg==nil then
    There is still an error somewhere else though.

    Try this with your parameters and my lua script below parameters.
    Code:
    --[[
    BARGRAPH WIDGET
    v2.1 by wlourf (07 Jan. 2011)
    this widget draws a bargraph with different effects 
    http://u-scripts.blogspot.com/2010/07/bargraph-widget.html
        
    To call the script in a conky, use, before TEXT
        lua_load /path/to/the/script/bargraph.lua
        lua_draw_hook_pre main_rings
    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 cpu0}, just write arg="cpu0"
           arg can be a numerical value if name=""
    max  - the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
        
    Optional parameters:
    x,y      - coordinates of the starting point of the bar, default = middle of the conky window
    cap      - end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
            http://www.cairographics.org/samples/set_line_cap/
    angle      - angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
            set to 90 for an horizontal bar
    skew_x      - skew bar around x axis, default = 0
    skew_y      - skew bar around y axis, default = 0
    blocks    - number of blocks to display for a bar (values >0) , default= 10
    height      - height of a block, default=10 pixels
    width      - width of a block, default=20 pixels
    space      - space between 2 blocks, default=2 pixels
    angle_bar - this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
    radius      - for cicular bars, internal radius, default=0
            with radius, parameter width has no more effect.
    
    Colours below are defined into braces {colour in hexadecimal, alpha}
    fg_colour    - colour of a block ON, default= {0x00FF00,1}
    bg_colour    - colour of a block OFF, default = {0x00FF00,0.5}
    alarm         - threshold, values after this threshold will use alarm_colour colour , default=max
    alarm_colour - colour of a block greater than alarm, default=fg_colour
    smooth         - (true or false), create a gradient from fg_colour to bg_colour, default=false 
    mid_colour   - colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
               for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
               3 colours to gradient created by fg_colour and alarm_colour, default=no mid_colour
    led_effect   - add LED effects to each block, default=no led_effect
               if smooth=true, led_effect is not used
               possibles values : "r","a","e" for radial, parallel, perdendicular to the bar (just try!)
               led_effect has to be used with theses colours :
    fg_led         - middle colour of a block ON, default = fg_colour
    bg_led         - middle colour of a block OFF, default = bg_colour
    alarm_led    - middle colour of a block > ALARM,  default = alarm_colour
    
    reflection parameters, not available for circular bars
    reflection_alpha  - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                other values = starting opacity
    reflection_scale  - scale of the reflection (default = 1 = height of text)
    reflection_length - length of reflection, define where the opacity will be set to zero
                values from 0 to 1, default =1
    reflection      - position of reflection, relative to a vertical bar, default="b"
                possibles values are : "b","t","l","r" for bottom, top, left, right
    draw_me           - if set to false, text is not drawn (default = true or 1)
                it can be used with a conky string, if the string returns 1, the text is drawn :
                example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
    
    v1.0 (10 Feb. 2010) original release
    v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value    
    v1.2 (28 Feb. 2010) just renamed the widget to bargraph
    v1.3 (03 Mar. 2010) added parameters radius & angle_bar to draw the bar in a circular way
    v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
    v2.1 (07 Jan. 2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"
    
    --      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'
    
    ----------------START OF PARAMETERS ----------
    function conky_main_bars()
        local bars_settings={
            {    --[ Graph for CPU1 ]--
                name="cpu",
                arg="cpu0",
                max=100,
                alarm=80,
                alarm_colour={0xFF0000,0.72},
                bg_colour={0x2F4F4F,0.0},
                fg_colour={0x00FF00,0.55},
                mid_colour={{0.45,0xFFFF00,0.70}},
                x=30,y=30,
                blocks=56,
                space=1,
                height=2,width=5,
                angle=90,
                smooth=true
                }
             }    
    -----------END OF PARAMETERS--------------
    
    
        
        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)    
        --prevent segmentation error when reading cpu state
        if tonumber(conky_parse('${updates}'))>3 then
            for i in pairs(bars_settings) do
                
                draw_multi_bar_graph(bars_settings[i])
                
            end
        end
        cairo_destroy(cr)
        cairo_surface_destroy(cs)
        cr=nil
    
    end
    
    
    
    function draw_multi_bar_graph(t)
        cairo_save(cr)
        --check values
        if t.draw_me == true then t.draw_me = nil end
        if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end    
        if t.name==nil and t.arg==nil then 
            print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
            return
        end
        if t.max==nil then
            print ("No maximum value defined, use 'max'")
            return
        end
        if t.name==nil then t.name="" end
        if t.arg==nil then t.arg="" end
    
        --set default values    
        if t.x == nil        then t.x = conky_window.width/2 end
        if t.y == nil        then t.y = conky_window.height/2 end
        if t.blocks == nil    then t.blocks=10 end
        if t.height == nil    then t.height=10 end
        if t.angle == nil     then t.angle=0 end
        t.angle = t.angle*math.pi/180
        --line cap style
        if t.cap==nil        then t.cap = "b" end
        local cap="b"
        for i,v in ipairs({"s","r","b"}) do 
            if v==t.cap then cap=v end
        end
        local delta=0
        if t.cap=="r" or t.cap=="s" then delta = t.height end
        if cap=="s" then     cap = CAIRO_LINE_CAP_SQUARE
        elseif cap=="r" then
            cap = CAIRO_LINE_CAP_ROUND
        elseif cap=="b" then
            cap = CAIRO_LINE_CAP_BUTT
        end
        --end line cap style
        --if t.led_effect == nil    then t.led_effect="r" end
        if t.width == nil    then t.width=20 end
        if t.space == nil    then t.space=2 end
        if t.radius == nil    then t.radius=0 end
        if t.angle_bar == nil    then t.angle_bar=0 end
        t.angle_bar = t.angle_bar*math.pi/360 --halt angle
        
        --colours
        if t.bg_colour == nil     then t.bg_colour = {0x00FF00,0.5} end
        if #t.bg_colour~=2         then t.bg_colour = {0x00FF00,0.5} end
        if t.fg_colour == nil     then t.fg_colour = {0x00FF00,1} end
        if #t.fg_colour~=2         then t.fg_colour = {0x00FF00,1} end
        if t.alarm_colour == nil     then t.alarm_colour = t.fg_colour end
        if #t.alarm_colour~=2         then t.alarm_colour = t.fg_colour end
    
        if t.mid_colour ~= nil then    
            for i=1, #t.mid_colour do    
                if #t.mid_colour[i]~=3 then 
                    print ("error in mid_color table")
                    t.mid_colour[i]={1,0xFFFFFF,1} 
                end
            end
        end
        
        if t.bg_led ~= nil and #t.bg_led~=2    then t.bg_led = t.bg_colour end
        if t.fg_led ~= nil and #t.fg_led~=2    then t.fg_led = t.fg_colour end
        if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
        
        if t.led_effect~=nil then
            if t.bg_led == nil then t.bg_led = t.bg_colour end
            if t.fg_led == nil     then t.fg_led = t.fg_colour end
            if t.alarm_led == nil  then t.alarm_led = t.fg_led end
        end
        
    
        if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
        if t.smooth == nil then t.smooth = false end
    
        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
        
        if t.reflection_alpha==nil then t.reflection_alpha=0 end
        if t.reflection_length==nil then t.reflection_length=1 end
        if t.reflection_scale==nil then t.reflection_scale=1 end
        
        --end of default values
        
    
         local function rgb_to_r_g_b(col_a)
            return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
        end
        
        
        --functions used to create patterns
    
        local function create_smooth_linear_gradient(x0,y0,x1,y1)
            local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
            cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
            cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
            if t.mid_colour ~=nil then
                for i=1, #t.mid_colour do
                    cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
                end
            end
            return pat
        end
    
        local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
            local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
            cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
            cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
            if t.mid_colour ~=nil then
                for i=1, #t.mid_colour do
                    cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
                end
            end
            return pat
        end
        
        local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
            local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
            cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
            cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
            cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
            return pat
        end
    
        local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
            local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
            if mode==3 then
                cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))                
                cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
                cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))                
            else
                cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
                cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))                
            end
            return pat
        end
    
    
    
    
    
    
        local function draw_single_bar()
            --this fucntion is used for bars with a single block (blocks=1) but 
            --the drawing is cut in 3 blocks : value/alarm/background
            --not zvzimzblr for circular bar
            local function create_pattern(col_alp,col_led,bg)
                local pat
                
                if not t.smooth then
                    if t.led_effect=="e" then
                        pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
                    elseif t.led_effect=="a" then
                        pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
                    elseif  t.led_effect=="r" then
                        pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
                    else
                        pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
                    end
                else
                    if bg then
                        pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
                    else
                        pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
                    end
                end
                return pat
            end
            
            local y1=-t.height*pct/100
            local y2,y3
            if pct>(100*t.alarm/t.max) then 
                y1 = -t.height*t.alarm/100
                y2 = -t.height*pct/100
                if t.smooth then y1=y2 end
            end
            
            if t.angle_bar==0 then
            
                --block for fg value
                local pat = create_pattern(t.fg_colour,t.fg_led,false)
                cairo_set_source(cr,pat)
                cairo_rectangle(cr,0,0,t.width,y1)
                cairo_fill(cr)
                cairo_pattern_destroy(pat)
            
                -- block for alarm value            
                if not t.smooth and y2 ~=nil then 
                    pat = create_pattern(t.alarm_colour,t.alarm_led,false)
                    cairo_set_source(cr,pat)
                    cairo_rectangle(cr,0,y1,t.width,y2-y1)
                    cairo_fill(cr)
                    y3=y2
                    cairo_pattern_destroy(pat)
                else
                    y2,y3=y1,y1
                end
                -- block for bg value
                cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
                pat = create_pattern(t.bg_colour,t.bg_led,true)
                cairo_set_source(cr,pat)
                cairo_pattern_destroy(pat)
                cairo_fill(cr)
            end        
        end  --end single bar
        
    
    
    
    
    
        local function draw_multi_bar()
            --function used for bars with 2 or more blocks
            for pt = 1,t.blocks do 
                --set block y
                local y1 = -(pt-1)*(t.height+t.space)
                local light_on=false
                
                --set colors
                local col_alp = t.bg_colour
                local col_led = t.bg_led
                if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
                    if pct>=(pcb*(pt-1))  then 
                        light_on = true
                        col_alp = t.fg_colour
                        col_led = t.fg_led
                        if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then 
                            col_alp = t.alarm_colour 
                            col_led = t.alarm_led 
                        end
                    end
                end
    
                --set colors
                --have to try to create gradients outside the loop ?
                local pat 
                
                if not t.smooth then
                    if t.angle_bar==0 then
                        if t.led_effect=="e" then
                            pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
                        elseif t.led_effect=="a" then
                            pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)                    
                        elseif  t.led_effect=="r" then
                            pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)    
                        else
                            pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
                        end
                    else
                         if t.led_effect=="a"  then
                             pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
                                                             0, 0, t.radius+(t.height+t.space)*(pt),                         
                                                 col_alp,col_led,3)    
                        else
                            pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))                    
                        end
                        
                    end
                else
                    
                    if light_on then
                        if t.angle_bar==0 then
                            pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
                        else
                            pat = create_smooth_radial_gradient(0, 0, (t.height+t.space),  0,0,(t.blocks+1)*(t.height+t.space),2)
                        end
                    else        
                        pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
                    end
                end
                cairo_set_source (cr, pat)
                cairo_pattern_destroy(pat)
    
                --draw a block
                if t.angle_bar==0 then
                    cairo_move_to(cr,0,y1)
                    cairo_line_to(cr,t.width,y1)
                else        
                    cairo_arc( cr,0,0,
                        t.radius+(t.height+t.space)*(pt)-t.height/2,
                         -t.angle_bar -math.pi/2 ,
                         t.angle_bar -math.pi/2)
                end
                cairo_stroke(cr)
            end    
        end
        
        
        
        
        local function setup_bar_graph()
            --function used to retrieve the value to display and to set the cairo structure
            if t.blocks ~=1 then t.y=t.y-t.height/2 end
            
            local value = 0
            if t.name ~="" then
                value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
                --$to_bytes doesn't work when value has a decimal point,
                --https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
                --http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
                --conky bug?
                --value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
                --if string.match(value,"%w") then
                --    value = conky_parse(string.format('${to_bytes %s}',value))
                --end
            else
                value = tonumber(t.arg)
            end
    
            if value==nil then value =0 end
            
            pct = 100*value/t.max
            pcb = 100/t.blocks
            
            cairo_set_line_width (cr, t.height)
            cairo_set_line_cap  (cr, cap)
            cairo_translate(cr,t.x,t.y)
            cairo_rotate(cr,t.angle)
    
            local matrix0 = cairo_matrix_t:create()
            tolua.takeownership(matrix0)
            cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
            cairo_transform(cr,matrix0)
    
        
            
            --call the drawing function for blocks
            if t.blocks==1 and t.angle_bar==0 then
                draw_single_bar()
                if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
            else
                draw_multi_bar()
            end
    
            --dot for reminder
            --[[
            if t.blocks ~=1 then
                cairo_set_source_rgba(cr,1,0,0,1)
                cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
                cairo_fill(cr)
            else
                cairo_set_source_rgba(cr,1,0,0,1)
                cairo_arc(cr,0,0,3,0,2*math.pi)
                cairo_fill(cr)
            end]]
            
            --call the drawing function for reflection and prepare the mask used        
            if t.reflection_alpha>0 and t.angle_bar==0 then
                local pat2
                local matrix1 = cairo_matrix_t:create()
                tolua.takeownership(matrix1)
                if t.angle_bar==0 then
                    pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
                    if t.reflection=="t" then
                        cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
                        pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
                    elseif t.reflection=="r" then
                        cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
                        pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
                    elseif t.reflection=="l" then
                        cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
                        pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
                    else --bottom
                        cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
                        pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
                    end
                end
                cairo_transform(cr,matrix1)
    
                if t.blocks==1 and t.angle_bar==0 then
                    draw_single_bar()
                    cairo_translate(cr,0,-t.height/2) 
                else
                    draw_multi_bar()
                end
                
                
                cairo_set_line_width(cr,0.01)
                cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
                cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
                if t.angle_bar==0 then
                    cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
                end
                cairo_clip_preserve(cr)
                cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
                cairo_stroke(cr)
                cairo_mask(cr,pat2)
                cairo_pattern_destroy(pat2)
                cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
                
            end --reflection
            pct,pcb=nil
        end --setup_bar_graph()
        
        --start here !
        setup_bar_graph()
        cairo_restore(cr)
    end
    Thanks, that worked.
    The extra text was in the code where I got it from.
    http://ubuntuforums.org/showpost.php...92&postcount=4
    Now I just need to adjust it a little.

  10. #19020
    Join Date
    Jan 2009
    Beans
    11

    Re: Post your .conkyrc files w/ screenshots

    Total ubuntu and conky noob here, so go easy on me.

    Couple of questions, my conky has a bar for my wifi signal strength, but for some reason the bar reads higher than the actual signal level. As you can see in the screenshot, the signal strength is 40% but the bar is showing over half way.

    Secondly, can someone link me to a basic how to on adding weather to my conky, or explain it here? I simply want it to display current temp, and the current weather, e.g rain, sun etc. I've had a look through this thread, and seen a few others on adding weather, but they all seem a lot more complicated than what I want. Also, I'm a total noob and found a lot of it quite confusing

    conkyrc
    Code:
    background no
    font Sans:size=8
    #xftfont Sans:size=10
    use_xft yes
    xftalpha 0.9
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_type normal
    own_window_transparent yes
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    minimum_size 220 5
    maximum_width 220
    draw_shades yes
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    default_color DimGray
    default_shade_color black
    default_outline_color green
    alignment top_right
    gap_x 8
    gap_y 30
    no_buffers yes
    uppercase no
    cpu_avg_samples 3
    override_utf8_locale no
    uppercase yes # set to yes if you want all text to be in uppercase
    
    TEXT
    ${color 09abe9}SYSTEM ${hr 1}${color}
    Uptime: $alignr$uptime
    Processes: ${alignr}$processes ($running_processes running)
    
    CPU1 ${alignr}${cpu cpu1}%
    ${cpubar 4 cpu1}
    CPU2 ${alignr}${cpu cpu2}%
    ${cpubar 4 cpu2}
    CPU3 ${alignr}${cpu cpu3}%
    ${cpubar 4 cpu3}
    CPU4 ${alignr}${cpu cpu4}%
    ${cpubar 4 cpu4}
    
    Ram ${alignr}$mem / $memmax ($memperc%)
    ${membar 4}
    swap ${alignr}$swap / $swapmax ($swapperc%)
    ${swapbar 4}
    
    Highest CPU $alignr CPU% MEM%
    ${top name 1}$alignr${top cpu 1}${top mem 1}
    ${top name 2}$alignr${top cpu 2}${top mem 2}
    ${top name 3}$alignr${top cpu 3}${top mem 3}
    
    Highest MEM $alignr CPU% MEM%
    ${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
    ${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
    ${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}
    
    ${color 09abe9}Filesystem ${hr 1}${color}
    
    Root: ${alignr}${fs_free /} / ${fs_size /}
    ${fs_bar 4 /}
    Home: ${alignr}${fs_free /home} / ${fs_size /home}
    ${fs_bar 4 /home}
    Slave: ${alignr}${fs_free /media/HDD0} / ${fs_size /media/HDD0}
    ${fs_bar 4 /media/HDD0}
    
    ${color 09abe9}NETWORK ${hr 1}${color}
    WiFi: ${wireless_link_qual wlan0}% 
    ${alignr}${wireless_link_bar 4,220 wlan0}
    IP address: ${alignr}${addr wlan0}
    Down ${downspeed wlan0} k/s ${alignr}Up ${upspeed wlan0} k/s
    ${downspeedgraph wlan0 25,107} ${alignr}${upspeedgraph wlan0 25,107}
    Total ${totaldown wlan0} ${alignr}Total ${totalup wlan0}
    
    ${color 09abe9}WEATHER ${hr 1}${color}
    Attached Images Attached Images

Page 1902 of 2302 FirstFirst ... 902140218021852189219001901190219031904191219522002 ... 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
  •