Page 1778 of 2325 FirstFirst ... 7781278167817281768177617771778177917801788182818782278 ... LastLast
Results 17,771 to 17,780 of 23245

Thread: Post your .conkyrc files w/ screenshots

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

    Re: Post your .conkyrc files w/ screenshots

    @Abdus

    glad to hear its working!

  2. #17772
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Abdus View Post



    3. I would like the top line to touch the very right edge of conky window, same as on the left side with ${offset -4} (and thus optically touch the screen edge). How could this be done?

    strange that there is a gap on the right, i have it too
    i cant see any way of making the conkyrc behave... my solution would be to alter the lua bg drawing script so that it draws the background a little thinner than the conky window width (ie cheat )

  3. #17773
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    here is a modified version of the background/image script

    Code:
    --[[    Background by londonali1010 (2009)
        VinDSL Background Hack (2010-2011)
        Added ability to display images DK75 and mrpeachy 2011
        ability to set any size for background
    
    This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish.
    ]]
    --settings---------
    --local r=15 -- radius of corners, set 0 for right angle
    --local x=0 --x position of top left corner
    --local y=0 -- y position of top right corner
    --local h=300 -- height of background
    --local w=407.5 --width of background
    --local color="0x000000" -- color
    --local alpha=0.5 --alpha
    -------------------
    require 'cairo'
    require 'imlib2'
    local    cs, cr = nil
    
    local 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,h,w,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)
    cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
    --top left mid circle
    xtl=x+r
    ytl=y+r
    --top right mid circle
    xtr=(x+r)+((w)-(2*r))
    ytr=y+r
    --bottom right mid circle
    xbr=(x+r)+((w)-(2*r))
    ybr=(y+r)+((h)-(2*r))
    --bottom right mid circle
    xbl=(x+r)
    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
    
    function conky_image_load(image, iacross, idown, width, height)
        --------------------------------------------------------------
        if image == nil then print("Error: no image selected"); return "" end
        --height and width of displayed image (number scales original image 1=full size, 2 = half size)
        width = tonumber(width); if width == nil then width = 1 end
        height = tonumber(height); if height == nil then height = 1 end
        --position
        iacross = tonumber(iacross); if iacross == nil then iacross = 0 end
        idown = tonumber(idown); if idown == nil then idown = 0 end
        -----------------------------------------------------
        show = imlib_load_image(image)
        if show == nil then print("Error: can't load image"); return "" end
        imlib_context_set_image(show)
        w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
        if w_img == nil or h_img == nil then return "" end
        if width == 1 then width = w_img
        elseif width == 2 then width = w_img / 2 end
        if height == 1 then height = h_img
        elseif height == 2 then height = h_img / 2 end
        buffer = imlib_create_image(width, height)
        imlib_context_set_image(buffer)
        imlib_blend_image_onto_image(show, 0, 0, 0, w_img, h_img, 0, 0, width, height)
        imlib_context_set_image(show)
        imlib_free_image()
        imlib_context_set_image(buffer)
        imlib_render_image_on_drawable(iacross, idown)
        imlib_free_image()
        --------------------------------------------------------------
        return ""
        end
    you set the variables in the conkyrc like so

    Code:
    TEXT
    ${lua conky_draw_bg 10 20 20 100 100 0x000000 0.5}
    #${lua conky_draw_bg corner_radius top_left_corner_x top_left_corner_y height width color alpha}
    this background isnt tied to the conky window height and width, you set the height width and x,y coordinates

    also this way you can have multiple backgrounds in your conky rc like so


    Code:
    lua_load /home/mcdowall/lua/pictest.lua
    ##lua_draw_hook_pre draw_bg
    
    TEXT
    TEST TEST TEST TEST
    ${hr}
    ${lua conky_draw_bg 10 5 0 100 400 0x000000 0.5}
    #${lua conky_draw_bg corner_radius top_left_corner_x top_left_corner_y height width color alpha}
    ${lua conky_draw_bg 10 20 150 100 100 0x000000 0.5}
    ${lua conky_draw_bg 10 20 280 100 100 0x000000 0.5}

  4. #17774
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Oh... didn't we created monster?

    What's left is to determine whatever lua_draw_hook_pre/post is executed earlier than lua function from TEXT and to decide where create and destroy CAIRO surface and drawable.
    After that, people could just load lua script and do not mess with it but to configure its behavior from Conky TEXT like normal Conky variables.

    Have no time for play today anymore...
    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

  5. #17775
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by dk75 View Post
    Oh... didn't we created monster?

    What's left is to determine whatever lua_draw_hook_pre/post is executed earlier than lua function from TEXT and to decide where create and destroy CAIRO surface and drawable.
    After that, people could just load lua script and do not mess with it but to configure its behavior from Conky TEXT like normal Conky variables.

    Have no time for play today anymore...
    yes... this is a very interesting development

  6. #17776
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    I think we should go with it to other forum and come back with product ready
    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

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

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by dk75 View Post
    I think we should go with it to other forum and come back with product ready
    which other forum?

  8. #17778
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    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

  9. #17779
    Join Date
    Jul 2009
    Beans
    54

    Re: Post your .conkyrc files w/ screenshots

    You will have more audience/contributors/whiners/criticism here. Stay.

  10. #17780
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots



    here is one use of the concept... ring meters set from the conkyrc

    this is the lua script
    Code:
    require 'cairo'
    
    function conky_draw_ring(conky_object1, conky_object2, conky_objectmax, center_x, center_y, radius, ring_width, background_color, background_alpha, indicator_color, indicator_alpha, start_angle, end_angle, direction)
    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
    --#########################################################################################################
    --#########################################################################################################
    local function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    if conky_object2==nil then conky_object2="" end
    value=tonumber(conky_parse("${" .. conky_object1 .. " " .. conky_object2 .. "}"))
    if value==nil then value=0 end
    --draw background
    cairo_set_source_rgba (cr,rgb_to_r_g_b(background_color,background_alpha))
    cairo_set_line_width (cr,ring_width)
    if direction=="clockwise" then
    if tonumber(end_angle)<tonumber(start_angle) then end_angle=tonumber(end_angle)+360 end
    cairo_arc (cr, center_x, center_y, radius, (math.pi/180)*(start_angle-90), (math.pi/180)*(end_angle-90))
    cairo_stroke (cr)
    elseif direction=="anticlockwise" then
    if tonumber(end_angle)>tonumber(start_angle) then end_angle=tonumber(end_angle)-360 end
    cairo_arc_negative (cr, center_x, center_y, radius, (math.pi/180)*(start_angle-90), (math.pi/180)*(end_angle-90))
    cairo_stroke (cr)
    end
    --draw indicator
    cairo_set_source_rgba (cr,rgb_to_r_g_b(indicator_color,indicator_alpha))
    if direction=="clockwise" then
    if tonumber(end_angle)<tonumber(start_angle) then end_angle=tonumber(end_angle)+360 end
    adddegs=((end_angle-start_angle)/conky_objectmax)*value
    cairo_arc (cr, center_x, center_y, radius, (math.pi/180)*(start_angle-90), ((math.pi/180)*(start_angle-90+adddegs)))
    cairo_stroke (cr)
    elseif direction=="anticlockwise" then
    if tonumber(end_angle)>tonumber(start_angle) then end_angle=tonumber(end_angle)-360 end
    adddegs=((start_angle-end_angle)/conky_objectmax)*value
    cairo_arc_negative (cr, center_x, center_y, radius, (math.pi/180)*(start_angle-90), ((math.pi/180)*(start_angle-90-adddegs)))
    cairo_stroke (cr)
    end
    --#########################################################################################################
    return ""
    --#########################################################################################################
    end-- if updates>5
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
    end-- end main function
    this is the important bit of the conkyrc

    Code:
    lua_load /home/mcdowall/lua/rings.lua
    
    TEXT
    ${lua conky_draw_ring cpu cpu0 100 200 200 50 20 0x000000 1 0xFFFFFF 1 300 200 anticlockwise}
    #${lua conky_draw_ring conky_object1, conky_object2(nil if not needed) conky_objectmax center_x center_y radius ring_width background_color background_alpha indicator_color indicator_alpha start_angle end_angle direction}
    above text only the lua script gets loaded
    then below text the lua function is called and fed the settings

    im sure i could shave some lines off the lua, just wanted to try it

Page 1778 of 2325 FirstFirst ... 7781278167817281768177617771778177917801788182818782278 ... 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
  •