Page 2152 of 2348 FirstFirst ... 1152165220522102214221502151215221532154216222022252 ... LastLast
Results 21,511 to 21,520 of 23480

Thread: Post your .conkyrc files w/ screenshots

  1. #21511
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Sector11 View Post
    Another version.

    If you are developing a conky and
    1. have not started it yet, this will start it.
    2. if it is running, it will kill it and restart it 2 seconds later

    Code:
    #!/bin/bash
    ## Original idea by: GrouchyGaijin
    ## This idea by: Stinkeye - Jan 2013
    ## With another tweak by: arclance
    ## Final tweak by: Sector11
    ## click to start, click to stop & re-start
    
    if pgrep -f "conky -c $1"
    	then
    	pkill -xf "conky -c $1"
    	(sleep 2s && conky -c "$1") &
    	exit
    else
    	conky -c "$1"
    	exit
    fi
    Nice stuff guys!
    Hi Sector11,
    just a bit confused as to what the $1 variable is
    and how to use the script.
    Do I just add the path to a conkyrc as a variable to the script?

    It may appear I know what I'm doing but I'm essentially a copy and paste man.
    CapMan
    Last edited by stinkeye; January 21st, 2013 at 03:20 PM.

  2. #21512
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by stinkeye View Post
    Hi Sector11,
    just a bit confused as to what the $1 variable is
    and how to use the script.
    Do I just add the path to a conkyrc as a variable to the script?

    It may appear I know what I'm doing but I'm essentially a copy and paste man.
    CapMan
    $1 for a bash script is a command line variable.

    stinki
    Code:
    #!/bin/bash
    echo $1 $2
    Code:
     sector11 @ sector11
     21 Jan 13 | 11:52:44 ~
             $ stinki something
    something
     sector11 @ sector11
     21 Jan 13 | 11:52:46 ~
             $ stinki something else
    something else
     sector11 @ sector11
     21 Jan 13 | 11:52:50 ~
             $ stinki Hi stinkeye
    Hi stinkeye
     sector11 @ sector11
     21 Jan 13 | 11:54:16 ~
             $
    To continue:
    Yea, me too, I gotta use that line, CapMan sounds like a superhero!
    Maybe change it to C&PDude so as not to interfere with any © you may have.

    The top of 90% of my conkys have something like this:
    Code:
    # killall conky && conky -c /media/5/Conky/S11_VSIDO_v9.conkyrc &
    I copy that line - less the hash - to kill all conkys and restart the one I'm working on. BUT it does what you said a while back:

    Quote Originally Posted by stinkeye
    All or nuttin'. Go hard or go home.
    So now at the top of my conkys I'll do:
    Code:
    # stinkeye2 /media/5/Conky/S11_VSIDO_v9.conkyrc
    then I'll pull a CapMan in the terminal
    Code:
     sector11 @ sector11
     21 Jan 13 | 11:25:16 ~
             $ stinkeye2 /media/5/Conky/S11_VSIDO_v9.conkyrc
    Like I said, if the conky is not running that script will start it, it is is running, it will kill it, wait 2 seconds and restart it.

    Perfect for editing!

    Now to do a search and replace on "all files" in my conky directories:
    Search: "# killall conky && conky -c"
    Replace: "# stinkeye2"

    ǝʎǝʞuıʇs sʞuɐɥʇ

  3. #21513
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Sector11 View Post
    $1 for a bash script is a command line variable.
    Aha, got it...i think.

    So I can use the same script to toggle all my conkys by appending the run
    command with the path to a conkyrc, which becomes the $1 variable.
    That's brilliant.

    I can just add exec lines in my quicklist launcher for different conkys.
    Thanks Secsi ©

  4. #21514
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by stinkeye View Post
    Aha, got it...i think.

    So I can use the same script to toggle all my conkys by appending the run
    command with the path to a conkyrc, which becomes the $1 variable.
    That's brilliant.

    I can just add exec lines in my quicklist launcher for different conkys.
    Thanks Secsi ©
    I don't use or understand how Unity works but if the launcher will pause for a command line prompt yes that will work. Otherwise you'll need a separate script for each conky. That would suck - for me, but if you onlly have a few not so bad.

    I had to Google "bash commandline variables" to find that $1 ... very basic bash stuff that any bash savvy person knows but like you, for me it was brilliant.

    shhhhhhhh I'm like you: "I may look like I know what I'm doing but it's a very cleverly covered disguise, You might call me the G_C-n-PMan"

  5. #21515
    Join Date
    Jun 2011
    Location
    Las Vegas
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Post you're .conkyrc files w/ screenshots

    I was a lurker on http://ubuntuforums.org/ for years, it started all here for me. I learned about Conky here as well for the first ha! oh the memories. Here's my nice clean Conky..

    Code:
    background no
    use_xft yes
    font Dejavu Sans:size=7
    xftalpha 0
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_transparent no
    own_window_type desktop
    own_window_argb_visual yes
    own_window_argb_value 120
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    minimum_size 150 150
    maximum_width 150
    draw_shades no
    draw_outline yes
    draw_borders no
    draw_graph_borders no
    default_color 999999
    default_shade_color black
    default_outline_color black
    alignment top_right
    gap_x 4
    gap_y 154
    no_buffers yes
    cpu_avg_samples 2
    text_buffer_size 1024
    override_utf8_locale no
    uppercase no
    
    
    ##############################################
    #  Output
    ##############################################
    TEXT
    S Y S T E M    I N F O
    ----------------------------------------------------------
    uptime$alignr$uptime
    kernel$alignr${kernel}
    core temp ${alignr}${hwmon tempf 1}F
    load$alignr ${loadavg 1}  ${loadavg 2}  ${loadavg 3}
    
    
    C P U$alignr ${cpu cpu0}%
    ${cpugraph cpu0}
    process$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}
    
    
    R A M$alignr${mem mem}/4GiB - $memperc%
    ${memgraph}
    process $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}
    
    
    S S D${alignr}$diskio I/O
    ${diskiograph /dev/sda3}
    
    
    N E T W O R K${alignr}${downspeed wlan0} I/O
    ${downspeedgraph wlan0}
    in/out ${alignr}${totaldown wlan0}/${totalup wlan0}
    lan ip ${alignr}${addr wlan0}
    net ip ${alignr}${execi 3600 wget -O - http://ip.tupeux.com | tail}
    Attached Images Attached Images

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

    Re: Post your .conkyrc files w/ screenshots

    @ Sector11
    Try this one.
    Seems the $1 variable gets lost when run in terminal.
    Works for me. Doesn't work with backgound yes in config.
    Code:
    #!/bin/bash
    
    ## click to start, click to stop
    
    config="$1"
    
    if pgrep -f "conky -c $config"; then
    	pkill -xf "conky -c $config" &
    	(sleep 2s && gnome-terminal -e "conky -c "$config"")
    else
    	gnome-terminal -e "conky -c "$config""
    	
    fi
    Last edited by stinkeye; January 22nd, 2013 at 12:11 AM.

  7. #21517
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    bad quoting inside another quote - two same quotes won't concatenate.
    Try this instead:
    Code:
    #!/bin/bash
    
    ## click to start, click to stop
    
    if pgrep -f "conky -c $1"; then
    	pkill -xf "conky -c $1" &
    	(sleep 2s && gnome-terminal -e "conky -c '$1'")
    else
    	gnome-terminal -e "conky -c '$1'"
    	
    fi
    as for "background yes"... Conky with that option is tearing apart from terminal that runs it, then gonme-terminal is going to immediate close and, surprisingly, Conky along.
    Dunno why Conky won't start like that - it should, logically.
    Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
    Linux user No.: 483055 | My Conky Pitstop corner | One4All project

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

    Re: Post your .conkyrc files w/ screenshots

    Yep, that works.
    Thanks dk75.

  9. #21519
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by dk75 View Post
    bad quoting inside another quote - two same quotes won't concatenate.
    Try this instead:
    Code:
    #!/bin/bash
    
    ## click to start, click to stop
    
    if pgrep -f "conky -c $1"; then
    	pkill -xf "conky -c $1" &
    	(sleep 2s && gnome-terminal -e "conky -c '$1'")
    else
    	gnome-terminal -e "conky -c '$1'"
    	
    fi
    as for "background yes"... Conky with that option is tearing apart from terminal that runs it, then gonme-terminal is going to immediate close and, surprisingly, Conky along.
    Dunno why Conky won't start like that - it should, logically.
    Is all this to run a conky "in" a terminal - or to start a conky in a terminal that displays on the desktop?

  10. #21520
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    @ dk75

    I have been told this draw-bg.lua leaks memory.
    Do you know if it does or not?

    I see this at the end and I have to wonder:
    Code:
    cairo_destroy(cr)
    cairo_surface_destroy(cs)

    draw-bg.lua
    Code:
    --[[Background originally by londonali1010 (2009)
        ability to set any size for background mrpeachy 2011
        ability to set variables for bg in conkyrc dk75
    
      the change is that if you set width and/or height to 0
      then it assumes the width and/or height of the conky window
    
    so:
    
    Above and After TEXT  (requires a composite manager or it blinks!)
    
     lua_load ~/wea_conky/draw_bg.lua
     TEXT
     ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
    
    OR Both above TEXT (no composite manager required - no blinking!)
    
     lua_load ~/wea_conky/draw_bg.lua
     lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
     TEXT
    
    Note
    ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
      See below:        1  2 3 4 5 6        7
    
    ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
    
    covers the whole window and will change if you change the minimum_size setting
    
    1 = 20             corner_radius
    2 = 0             x_position
    3 = 0             y_position
    3 = 0             width
    5 = 0             height
    6 = 0x000000      color
    7 = 0.4           alpha
    
    ######### calendar function ##################################################
    
    then to use it, you activate the calendar function BELOW TEXT like this
    
    ${lua luacal {settings}}
    
    #${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
    #    x=x position top left
    #    y=y position top left
    #    tf=title font, eg "mono" must be in quotes
    #    tfs=title font size
    #    tc=title color
    #    ta=title alpha
    #    bf=body font, eg "mono" must be in quotes
    #    bfs=body font size
    #    bc=body color
    #    ba=body alpha
    #    hf=highlight font, eg "mono" must be in quotes
    #    hfs=highlight font size
    #    hc=highlight color
    #    ha=highlight alpha
    #    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts
    
    #    gt=gap from title to body
    #    gh=gap horizontal between columns
    #    gv=gap vertical between rows
    #    sd=start day, 0=Sun, 1=Mon
    
    #    hstyle = heading style, 0=just days, 1=date insert
    #    tdf=title date font, eg "mono" must be in quotes
    #    tdfs=title date font size
    #    tdc=title date color
    #    tda=title date alpha
    
    # test line
    -- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}
    
    
    ]]
    
    require 'cairo'
    local    cs, cr = nil
    function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    function conky_draw_bg(r,x,y,w,h,color,alpha)
    if conky_window == nil then return end
    if cs == nil then cairo_surface_destroy(cs) end
    if cr == nil then cairo_destroy(cr) end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local cr = cairo_create(cs)
    w=w
    h=h
    if w=="0" then w=tonumber(conky_window.width) end
    if h=="0" then h=tonumber(conky_window.height) end
    cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
    --top left mid circle
    local xtl=x+r
    local ytl=y+r
    --top right mid circle
    local xtr=(x+r)+((w)-(2*r))
    local ytr=y+r
    --bottom right mid circle
    local xbr=(x+r)+((w)-(2*r))
    local ybr=(y+r)+((h)-(2*r))
    --bottom right mid circle
    local xbl=(x+r)
    local ybl=(y+r)+((h)-(2*r))
    -----------------------------
    cairo_move_to (cr,xtl,ytl-r)
    cairo_line_to (cr,xtr,ytr-r)
    cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
    cairo_line_to (cr,xbr+r,ybr)
    cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
    cairo_line_to (cr,xbl,ybl+r)
    cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
    cairo_line_to (cr,xtl-r,ytl)
    cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
    cairo_close_path(cr)
    cairo_fill (cr)
    ------------------------------------------------------------
    cairo_surface_destroy(cs)
    cairo_destroy(cr)
    return ""
    end
    -- ###### calendar function ##################################################
    function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local cr = cairo_create(cs)
    --############################################################################
    if caltab.x==nil then
    caltab=loadstring("return" .. caltab)()
    end
    local cal_x=caltab.x
    local cal_y=caltab.y
    local tfont=caltab.tf		or "mono"
    local tfontsize=caltab.tfs	or 12
    local tc=caltab.tc			or 0xffffff
    local ta=caltab.ta			or 1
    local bfont=caltab.bf		or "mono"
    local bfontsize=caltab.bfs	or 12
    local bc=caltab.bc			or 0xffffff
    local ba=caltab.ba			or 1
    local hfont=caltab.hf		or "mono"
    local hfontsize=caltab.hfs	or 12
    local hc=caltab.hc			or 0xff0000
    local ha=caltab.ha			or 1
    local spacer=caltab.sp		or " "
    local gaph=caltab.gh		or 20
    local gapt=caltab.gt		or 15
    local gapl=caltab.gv		or 15
    local sday=caltab.sd		or 0
    local hstyle=caltab.hstyle	or 0
    --convert colors
    --local font=string.gsub(font,"_"," ")
    local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
    --main body text color
    local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
    --highlight text color
    local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
    --############################################################################
    --calendar calcs
    local year=os.date("%G")
    local today=tonumber(os.date("%d"))
    local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
    local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
    local feb=(os.difftime(t1,t2))/(24*60*60)
    local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
    local day=tonumber(os.date("%w"))+1-sday
    local day_num = today
    local remainder=day_num % 7
    local start_day=day-(day_num % 7)
    if start_day<0 then start_day=7+start_day end
    local month=os.date("%m")
    local mdays=monthdays[tonumber(month)]
    local x=mdays+start_day
    local dnum={}
    local dnumh={}
    if mdays+start_day<36 then
    dlen=35
    plen=29
    else
    dlen=42
    plen=36
    end
    for i=1,dlen do
        if i<=start_day then
        dnum[i]="  "
        else
        dn=i-start_day
            if dn=="nil" then dn=0 end
            if dn<=9 then dn=(spacer .. dn) end
            if i>x then dn="" end
            dnum[i]=dn
            dnumh[i]=dn
            if dn==(spacer .. today) or dn==today then
            dnum[i]=""
            end
            if dn==(spacer .. today) or dn==today then
            dnumh[i]=dn
            place=i
            else dnumh[i]="  "
            end
        end
    end--for
    cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tfontsize);
    cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
    local extents=cairo_text_extents_t:create()
    tolua.takeownership(extents)
    if hstyle==0 then
        if tonumber(sday)==0 then
        dys={"SU","MO","TU","WE","TH","FR","SA"}
        else
        dys={"MO","TU","WE","TH","FR","SA","SU"}
        end
        --draw calendar titles
    elseif hstyle==1 then
        if tonumber(sday)==0 then
        dys={"SU","MO"," ","  ","  ","FR","SA"}
        cairo_text_extents(cr,"MO",extents)
        local s=extents.x_advance+gaph
        local f=gaph*5
        local tdfont=caltab.tdf        or "mono"
        local tdfontsize=caltab.tdfs    or 12
        local tdc=caltab.tdc        or 0xffffff
        local tda=caltab.tda        or 1
        cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
        cairo_set_font_size (cr, tdfontsize);
        local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
        cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
        local insert=os.date("%b %y")
        cairo_text_extents(cr,insert,extents)
        local w=extents.x_advance
        cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
        cairo_show_text (cr,insert)
        cairo_stroke (cr)
        else
        dys={"MO","TU"," ","  ","  ","SA","SU"}
        cairo_text_extents(cr,"TU",extents)
        local s=extents.x_advance+gaph
        local f=gaph*5
        local tdfont=caltab.tdf        or "mono"
        local tdfontsize=caltab.tdfs    or 12
        local tdc=caltab.tdc        or 0xffffff
        local tda=caltab.tda        or 1
        cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
        cairo_set_font_size (cr, tdfontsize);
        local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
        cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
        local insert=os.date("%b %y")
        cairo_text_extents(cr,insert,extents)
        local w=extents.x_advance
        cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
        cairo_show_text (cr,insert)
        cairo_stroke (cr)
        end
    end
    --draw calendar titles
    for i=1,7 do
    cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tfontsize);
    cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
    cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
    cairo_show_text (cr, dys[i])
    cairo_stroke (cr)
    end
    --draw calendar body
    cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, bfontsize);
    cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
    for i=1,plen,7 do
    local fn=i
        for i=fn,fn+6 do
        cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
        cairo_show_text (cr, dnum[i])
        cairo_stroke (cr)
        end
    end
    --highlight
    cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, hfontsize);
    cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
    for i=1,plen,7 do
    local fn=i
        for i=fn,fn+6 do
        cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
        cairo_show_text (cr, dnumh[i])
        cairo_stroke (cr)
        end
    end
    --############################################################################
    caltab=nil
    dlen=nil
    plen=nil
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
    return ""
    end
    -- end main function
    --############################################################################

Page 2152 of 2348 FirstFirst ... 1152165220522102214221502151215221532154216222022252 ... 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
  •