Page 1099 of 2316 FirstFirst ... 99599999104910891097109810991100110111091149119915992099 ... LastLast
Results 10,981 to 10,990 of 23156

Thread: Post your .conkyrc files w/ screenshots

  1. #10981
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Bruce M. View Post
    dizzy still with the changes --- so one last change:

    Code:
    #!/bin/bash
    cal
    Now that's optimized!!!!!!!!!!!
    It may not work, but it is optimized!

    Have a non-dizzy day
    Bruce
    It would work, just no custom coloring or anything.

    Quote Originally Posted by searchOne View Post
    My God, how many languages do you want there's cramming?

    Makes it a competition who writes the shortest script?
    Yeah it kinda turned into a bit of a competition. This style of competition leaves us ALL winners though since we all get to use the results!

  2. #10982
    Join Date
    Jul 2009
    Location
    Germany > Hessen > DA
    Beans
    26

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Bruce M. View Post

    I win! -->> short!

    You didn't say it had to work.

    CHIMO!
    Bruce
    This is great! The best script I've seen in a while ... so it clearly.

    CHIMO!
    Stefan
    64Bit - HP Compaq Presario CQ60-105EG, 4GB RAM, 160GB, NVIDIA GeForce 8200M, AMD Athlon X2 Dual-Core / Mandriva 2009.1, Mandriva 2010, #! Crunchbang 9.04.01 Conky-Hardcore - searchOne

  3. #10983
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mobilediesel View Post
    It would work, just no custom coloring or anything.
    I'm sorry, I didn't see a rules list that said anything specific, just "short"

    Quote Originally Posted by mobilediesel View Post
    Yeah it kinda turned into a bit of a competition. This style of competition leaves us ALL winners though since we all get to use the results!
    And since everyone is having sooooooooo much fun with this I actually have another request. My first one started all this I think.

    Image below is the "latest of the latest" code that again shows Feb 2010 and the three days at the end for March 2010.

    However, notice how the day names are the same colour as Feb!

    The Challange:
    How about getting those suckers the same colour as the day numbers for March - even if they are a Saturday or Sunday.

    The winner will get ... ummmmmmmm

    The gratitude of us all.

    Have a nice day.
    Bruce
    Attached Images Attached Images
    Last edited by Bruce M.; December 14th, 2009 at 07:24 PM.

  4. #10984
    Join Date
    Jul 2008
    Beans
    70

    Re: Post your .conkyrc files w/ screenshots

    On the subject of music players, I posted a request for help a few days ago regarding Amarok-Conky but it got buried in an avalanche it seems lol so I´ll chance my arm again. I´m using Amarok 1.4 in Jaunty and conky-all, but if I remove the processes section of my conky, conky says Amarok is turned off, although it is actually playing. Also, the other night just for chuckles, I tried rhythmbox script I had, and It´s giving me the same problem - conky states Rhythmbox is closed. Here is my conky (and Lua script, but I really don´t think that´s the problem). REALLY hoping someone can help

    Code:
    background yes
    own_window yes
    own_window_type override
    own_window_transparent yes
    # own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    # own_window_class conky
    use_xft yes
    #xftfont ariel:size=8
    xftfont MgOpen Modata-07
    xftalpha 1.0 #0.2
    override_utf8_locale yes
    update_interval 1.0
    total_run_times 0
    double_buffer yes
    no_buffers yes
    cpu_avg_samples 2
    net_avg_samples 2
    use_spacer right
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    alignment tl
    uppercase no
    imlib_cache_size 0
    
    minimum_size 1024 1024
    maximum_width 1024 
    
    gap_x 0 # left-right
    gap_y 0 # up-down
    border_inner_margin 0
    border_outer_margin 0
     
    # Colors
    default_color DCDCDC #Gainsboro
    color0 FFD700 #Gold  #7FFFD4 #Aquamarine
    color1 FFA07A #LightSalmon #CD5C5C IndianRed #00CED1 DarkTurquoise #00FFFF Cyan
    color2 FF8C00 #Darkorange
    color3 7FFF00 #Chartreuse
    color4 778899 #LightSlateGrey
    color5 FFDEAD #NavajoWhite
    color6 00BFFF #DeepSkyBlue
    #	colours below used by colorize script
    color7 48D1CC #MediumTurquoise
    color8 FFFF00 #Yellow
    color9 FF0000 #Red
    text_buffer_size 6144 # 256 is the minimum
    short_units yes
    pad_percents 2
    
    # -- Lua Load -- #
    lua_load ~/scripts/Conky/conky_widgets.lua
    lua_draw_hook_pre widgets
    
    TEXT
    ${voffset -10}${image ~/scripts/Conky/images/pc.png -p 460,100 -s 80x80}${image ~/scripts/Conky/images/proc.png -p 500,240 -s 80x80}
    ${image ~/scripts/Conky/images/amarok.png -p 860,300 -s 100x100}
    #--------------------------Time & Calendar-----------------#
    ${voffset 49}${goto 90}${time %l:%M:%S %P}${color}
    ${voffset 70}${goto 30}${color4} Ireland${goto 90}${color6}${tztime Europe:Ireland %l:%M:%S %P}${color}
    ${goto 30}${color4} Sweden${goto 90}${color6}${tztime Europe:Sweden-1  %l:%M:%S %P}${color}
    ${color4}${execpi 1 /etc/conky/calender.sh}${font}${voffset -2}
    #------------------------External Storage--------------------------#
    #------------------------Elements--------------------------#
    ${voffset -280}${goto 235}${color4} Elements ${if_existing /media/ELEMENTS}
    ${voffset 00}${goto 225}${color6}${fs_used /media/ELEMENTS}${color yellow} of ${color6}${fs_size /media/ELEMENTS}
    ${voffset 00}${goto 248}${color yellow}used
    ${voffset 00}${goto 228}Trash ${execi 1 du -sh /media/ELEMENTS/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 225}${color yellow}NOT MOUNTED${voffset 26}${endif}
    #------------------------Pen Drive--------------------------#
    ${voffset -58}${goto 335}${color4} Pen Drive ${if_existing /media/Pen_Drive}
    ${voffset 00}${goto 325}${color6}${fs_used /media/Pen_Drive}${color yellow} of ${color6}${fs_size /media/Pen_Drive}
    ${voffset 00}${goto 350}${color yellow}used
    ${voffset 00}${goto 335}Trash ${execi 1 du -sh /media/Pen_Drive/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 325}${color yellow}NOT MOUNTED${voffset 28}${endif}
    #------------------------Camera Card--------------------------#
    ${voffset -60}${goto 425}${color4} Camera Card ${if_existing /media/Cam_Card}
    ${voffset 00}${goto 425}${color6}${fs_used /media/Cam_Card}${color yellow} of ${color6}${fs_size /media/Cam_Card}
    ${voffset 00}${goto 448}${color yellow}used
    ${else}${voffset 20}${goto 425}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Movies--------------------------#
    ${voffset -48}${goto 540}${color4} Movies ${if_existing /media/MOVIES}
    ${voffset 00}${goto 525}${color6}${fs_used /media/MOVIES}${color yellow} of ${color6}${fs_size /media/MOVIES}
    ${voffset 00}${goto 545}${color yellow}used
    ${else}${voffset 20}${goto 525}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Sony Mp3--------------------------#
    ${voffset -48}${goto 635}${color4} Sony Mp3${if_existing /media/SONY_MP3}
    ${voffset 00}${goto 623}${color6}${fs_used /media/SONY_MP3}${color yellow} of ${color6}${fs_size /media/SONY_MP3}
    ${voffset 00}${goto 647}${color yellow}used
    ${else}${voffset 20}${goto 625}${color yellow}NOT MOUNTED${endif}
    #------------------------Ring Meters--------------------------#
    ${voffset 10}${goto 830}${color2} CPU ${cpu cpu0}%
    ${voffset -00}${goto 830}${color6} RAM ${memperc}%${color}
    ${voffset -00}${goto 780}${color #FFFF58} Swap ${swap} of ${swapmax} used
    ${voffset -00}${goto 785}${color5} Root ${fs_used /} of ${fs_size /} used
    ${voffset -00}${goto 780}${color8} Shitsta ${fs_used /media/Shitsta} of ${fs_size /media/Shitsta} used
    ${voffset -00}${goto 790}${color #34ff54}Battery ${battery}${color}${execpi 1 acpi -b | cut -c30-31 | xargs /etc/conky/colorize.sh}
    ${voffset -00}${goto 800}Power Consumption
    ${voffset -00}${goto 795}${color #3fd2ff}${exec cat /proc/acpi/battery/BAT0/state | grep 'present rate' | cut -c26-33} / ${exec cat /proc/acpi/battery/BAT0/state | grep 'remaining capacity' | cut -c26-33}${color}
    
    #--------------------------Reminders-----------------# 
    ${voffset 110}${font CloisterBlack:normal:size=18}${goto 65}${color6} Reminders${font}
    ${execi 5 remind ~/.reminders}
    #--------------------------TV-----------------#
    ${font CloisterBlack:normal:size=18}${goto 50}${color6} Tv Schedule${color}${font}
    ${voffset -10}${execp /etc/conky/conkyTV.sh}
    #------------------System-----------------#
    ${voffset -330}${font CloisterBlack:normal:size=30}${goto 300}${color6} System${font}${color}
    ${voffset 20}${goto 300}${font OpenLogos:size=15}u${voffset -4}${font}   Ubuntu 9.04 ${kernel}${voffset -5}${goto 500}${font OpenLogos:size=15}  T${voffset -4}${font}Gnome 2.26.1
    ${goto 300}${voffset +3}${font Illustrate IT:size=15}I${voffset -6}${font}   Intel dual CPU 2 x ${freq 1}
    ${voffset -12}${goto 505}${font StyleBats:size=12}v${voffset -4}${font}   Update: ${execi 600 aptitude search "~U" | wc -l | tail} package(s)${goto 600}${voffset 23}${goto 505}${font StyleBats:size=15}q${voffset -3}${font}  Uptime: ${uptime}${goto 318}${voffset -5}   Temp ${execi 300 hddtemp /dev/sda -n;}° C 
    #--------------------------Processes-----------------#
    ${voffset 15}${font CloisterBlack:normal:size=30}${goto 300}${color6} Processes${font}${color}
    ${voffset 20}${goto 400}$processes processes  $running_processes active
    ${goto 350}${color green}NAME ${goto 500} CPU     MEM${color}
    ${goto 350}${top name 1} ${goto 500} ${top cpu 1}   ${top mem 1}
    ${goto 350}${top name 2} ${goto 500} ${top cpu 2}   ${top mem 2}
    ${goto 350}${top name 3} ${goto 500} ${top cpu 3}   ${top mem 3}
    ${goto 350}${top name 4} ${goto 500} ${top cpu 4}   ${top mem 4}
    ${goto 350}${top name 5} ${goto 500} ${top cpu 5}   ${top mem 5}
    #--------------------------Amarok-----------------#
    ${voffset 10}${if_running amarokapp}${goto 760}${color6}${execi 1 dcop amarok player title}
    ${color red}${goto 760}${execi 1 dcop amarok player artist}${color}
    ${color yellow}${goto 760}${execi 1 dcop amarok player album}${color}${color yellow}
    ${goto 860}Year : ${execi 1 dcop amarok player year}${color}
    ${color #ff5a00}${goto 860}${execi 1 dcop amarok player currentTime} ${color green}/${color #ff5a00} ${execi 1 dcop amarok player totalTime}${color}
    ${goto 780}${color green}Player Volume ${execi 1 /etc/conky/Amarok.sh volume}%${goto 900}${color #ff5a00}Bitrate ${execi 1 dcop amarok player bitrate} kbps
    ${voffset -00}${goto 815}${color red}Current song ${execi 1 /etc/conky/Amarok.sh playCount}
    ${else}${image /home/graham/scripts/Conky/images/face-sad.png -p 860,410 -s 100x100}${voffset -120}${font FRESHBOT:size=30}${goto 830}${color #3fd2ff}T
    ${goto 830}U
    ${goto 830}R
    ${goto 830}N
    ${goto 830}E
    ${goto 830}D${voffset 16}
    ${voffset -210}${goto 970}O
    ${goto 970}F
    ${goto 970}F${color}${endif}${font}
    Code:
    --[[
    Conky Widgets by londonali1010 (2009)
    
    This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
    
    To configure:
    + Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
    + To call the widget, add the following just before the last "end" of the entire script:
    	cr = cairo_create(cs)
    	NAME_OF_FUNCTION(cr, OPTIONS)
    	cairo_destroy(cr)
    + Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    	lua_load ~/scripts/conky_widgets.lua
    	lua_draw_hook_pre widgets
    	
    Changelog:
    + v1.0 -- Original release (17.10.2009)
    ]]
    
    require 'cairo'
    require 'imlib2'
    
    --[[ CLOCK WIDGET ]]
    
    function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    	local function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    	
    	local function draw_ring(pct)
    		local angle_0=sa*(2*math.pi/360)-math.pi/2
    		local angle_f=ea*(2*math.pi/360)-math.pi/2
    		local pct_arc=pct*(angle_f-angle_0)
    
    		-- Draw background ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_f)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    		cairo_set_line_width(cr,t)
    		cairo_stroke(cr)
    	
    		-- Draw indicator ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    	end
    	
    	local function setup_ring()
    		local str = ''
    		local value = 0
    		
    		str = string.format('${%s %s}', name, arg)
    		str = conky_parse(str)
    		
    		value = tonumber(str)
    		if value == nil then value = 0 end
    		pct = value/max
    		
    		draw_ring(pct)
    	end	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then setup_ring() end
    end
    
    --[[ END CLOCK WIDGET ]]
    
    --[[ GRADIENT RING WIDGET ]]
    --[[ Options (name, arg, max, colour, alpha, x, y, inner_radius, outer_radius, frac, thickness, start_angle, end_angle):
            "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
            "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
            "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
            "fg_colour" is the colour of the ring.
            "fg_alpha" is the alpha value of the ring.
            "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
            "inner_radius" is the inner radius of the ring.
            "outer_radius" is the outer radius of the ring.  
            "frac" determines the extent of the gradient around the ring - 2 implies the gradient fades halfway around the ring, 4 equals a quarter of the way, etc...      
            "thickness" is the thickness of the ring, centred around the radius.
            "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
            "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]
         
    function gradient_ring(cr, name, arg, max, fgc, fga, xc, yc, ring_i, ring_o, frac, t, sa, ea)
            local function rgb_to_r_g_b(colour,alpha)
                return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
            end
         
            local function draw_gradient_ring(pct)
                local angle_0=sa*(2*math.pi/360)-math.pi/2
                local angle_f=ea*(2*math.pi/360)-math.pi/2
                local pct_arc=pct*(angle_f-angle_0)
         
                for i = 1,max/frac do
                    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga*i/max)) --for flat shading of bars
            
                    --local pat=cairo_pattern_create_linear(xc-ring_i*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_i*math.cos(angle_0+t_arc+2*math.pi*i/max),xc-ring_o*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_o*math.cos(angle_0+t_arc+2*math.pi*i/max))
                    --cairo_pattern_add_color_stop_rgba(pat,0,rgb_to_r_g_b(fgc,0))
                    --cairo_pattern_add_color_stop_rgba(pat,1,rgb_to_r_g_b(fgc,fga*i/max))
                    --cairo_set_source(cr,pat) -- for gradient shading of bars
            
                    cairo_move_to(cr,xc-ring_i*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_i*math.sin(angle_0+pct_arc+2*math.pi*i/max))
                    cairo_line_to(cr,xc-ring_o*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_o*math.sin(angle_0+pct_arc+2*math.pi*i/max))
        
                    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
                    cairo_set_line_width(cr,t)
                    cairo_stroke(cr)
                end
            end
         
            local function setup_gradient_ring()
                local str = ''
                local value = 0
         
                str = string.format('${%s %s}', name, arg)
                str = conky_parse(str)
         
                value = tonumber(str)
                if value == nil then value = 0 end
                pct = value/max
         
                draw_gradient_ring(pct)
            end    
         
            local updates=conky_parse('${updates}')
            update_num=tonumber(updates)
         
            if update_num>5 then setup_gradient_ring() end
        end
         
    --[[ END GRADIENT RING WIDGET ]]
    
    --[[ PHOTO ALBUM WIDGET ]]
    
    album_dir = "/home/graham/Pictures/Conky/"
    -- "xc" and "yc" are the coordinates of the centre of the photo album, relative to the top left corner of the Conky window, in pixels
    xc, yc = 400, 600
    -- "w_max" and "h_max" are the maximum dimensions, in pixels, that you want the widget to be.  The script will ensure that the photo album fits inside the box bounded by w_max and h_max
    w_max, h_max = 200, 200
    -- "t" is the thickness of the frame, in pixels
    t = 3
    -- "update_interval" is the number of Conky updates between refreshes
    update_interval = 10
    
    function get_file_to_use()
        num_files = tonumber(conky_parse("${exec ls -A " .. album_dir .. " | wc -l}"))
        if num_files == nil then num_files = 0 end
        if num_files == 0 then return "none" end
        
        updates = tonumber(conky_parse("${updates}"))
        whole = math.ceil(updates/update_interval)
        
        if whole <= num_files
        then
            num_file_to_show = whole
        else
            whole = whole % num_files
            num_file_to_show = whole
        end
        
        return conky_parse("${exec ls " .. album_dir .. " | sed -n " .. num_file_to_show .. "p}")
    end
    
    function init_drawing_surface()
        imlib_set_cache_size(4096 * 1024)
        imlib_context_set_dither(1)
    end
    
    function draw_frame()
    	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)
        
        cairo_rectangle(cr, xc - width/2 - t, yc - height/2 - t, width + 2*t, height + 2*t)
        cairo_set_source_rgba(cr, 1, 1, 1, 0.8)
        cairo_fill(cr)   
        
        cairo_destroy(cr)
    end
    
    function draw_image()
        init_drawing_surface()
        
        image = imlib_load_image(album_dir .. filename)
        if image == nil then return end
        imlib_context_set_image(image)
    	
    	w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
    	if w_img >= h_img
    	then
    	    width = w_max - 2*t
    	    height = width * (h_img/w_img)
    	else
    	    height = h_max - 2*t
    	    width = height * (w_img/h_img)
    	end
    	
    	draw_frame()
    	
    	buffer = imlib_create_image(width, height)
    	imlib_context_set_image(buffer)
    	
    	imlib_blend_image_onto_image(image, 0, 0, 0, w_img, h_img, 0, 0, width, height)
    	imlib_context_set_image(image)
    	imlib_free_image()
    	
    	imlib_context_set_image(buffer)
    	imlib_render_image_on_drawable(xc - width/2, yc - height/2)
    	imlib_free_image()
    end
    
    
    function conky_photo_album()
        if conky_window == nil then return end
        filename = get_file_to_use()
        if filename == "none"
        then
            print(album_dir .. ": No files found")
        else
            draw_image()
        end
    end
    
    --[[ END PHOTO ALBUM WIDGET ]]
    
    --[[ BACKGROUND WIDGET ]]
    
    -- Change these settings to affect your background.
    -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
     
    corner_r=15
     
    -- Set the colour and transparency (alpha) of your background.
     
    bg_colour=0xffffff
    bg_alpha=0.2
     
    require 'cairo'
    function rgb_to_r_g_b(colour,alpha)
    	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
     
    function conky_draw_bg()
    	if conky_window==nil then return end
    	local w=conky_window.width
    	local h=conky_window.height
    	local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    	cr=cairo_create(cs)
     
    	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-corner_r)
    	cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    	cairo_line_to(cr,corner_r,h)
    	cairo_curve_to(cr,0,h,0,h,0,h-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,rgb_to_r_g_b(bg_colour,bg_alpha))
    	cairo_fill(cr)
    end
    
    --[[ END BACKGROUND WIDGET ]]
    
    function conky_widgets()
    	if conky_window == nil then return end
    	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    	cr = cairo_create(cs)
    	
    	cairo_destroy(cr)
    
    -------------------[[ TIME SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%I', 12, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%M', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 55, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%S', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.3, 120, 70, 63, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END TIME SETTINGS ]]---------------
    
    -------------------[[ GRADIENT RING SETTINGS ]]---------------
    
    cr = cairo_create(cs)
            gradient_ring(cr, '', '', 12, 0xFF0000, 10.0, 120, 70, 65, 60, 1, 2, 0, 360)
            cairo_destroy(cr)
            
    -------------------[[ END GRADIENT RING SETTINGS ]]---------------
    
    -------------------[[ STORAGE RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/ELEMENTS', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 260, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Pen_Drive', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 360, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Cam_Card', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 460, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 560, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 660, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END STORAGE RINGS SETTINGS ]]---------------
    
    -------------------[[ CPU RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'cpu', 'cpu0', 100, 0xFFFFFF, 0, 0xFF8C00, 1.0, 850, 148, 140, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'memperc', '', 100, 0xFFFFFF, 0, 0x00BFFF, 1.0, 850, 148, 130, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'swapperc', '', 100, 0xFFFFFF, 0, 0xFFFF58, 1.0, 850, 148, 120, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0, 0xFFDEAD, 1.0, 850, 148, 110, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Shitsta', 100, 0xFFFFFF, 0, 0xFFFF00, 1.0, 850, 148, 100, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)	
    
    	cr = cairo_create(cs)
    	ring(cr, 'battery_percent', 'BAT0', 100, 0xFFFFFF, 0, 0x00FF2A, 1.0, 850, 148, 90, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END CPU RINGS SETTINGS ]]---------------	
    
    -------------------[[ PHOTO ALBUM SETTINGS ]]---------------
    --conky_photo_album('/home/graham/Pictures/Conky/', 400, 600, 200, 200, 10, 10)
    -------------------[[ END PHOTO ALBUM SETTINGS ]]---------------
    
    conky_draw_bg(0xFFFFFF, 0.4)
    end

  5. #10985
    Join Date
    Jul 2009
    Location
    Germany > Hessen > DA
    Beans
    26

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mobilediesel View Post
    Yeah it kinda turned into a bit of a competition. This style of competition leaves us ALL winners though since we all get to use the results!

    That's right mobilediesel!!
    64Bit - HP Compaq Presario CQ60-105EG, 4GB RAM, 160GB, NVIDIA GeForce 8200M, AMD Athlon X2 Dual-Core / Mandriva 2009.1, Mandriva 2010, #! Crunchbang 9.04.01 Conky-Hardcore - searchOne

  6. #10986
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by searchOne View Post
    This is great! The best script I've seen in a while ... so it clearly.

    CHIMO!
    Stefan
    And it took all of 35 seconds to write too, I'm a slow typist.

  7. #10987
    Join Date
    Jul 2009
    Location
    Germany > Hessen > DA
    Beans
    26

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Bruce M. View Post
    And it took all of 35 seconds to write too, I'm a slow typist.

    But perfect, without mistakes and very reliable!
    64Bit - HP Compaq Presario CQ60-105EG, 4GB RAM, 160GB, NVIDIA GeForce 8200M, AMD Athlon X2 Dual-Core / Mandriva 2009.1, Mandriva 2010, #! Crunchbang 9.04.01 Conky-Hardcore - searchOne

  8. #10988
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by merlin_ie View Post
    On the subject of music players, I posted a request for help a few days ago regarding Amarok-Conky but it got buried in an avalanche it seems lol so I´ll chance my arm again. I´m using Amarok 1.4 in Jaunty and conky-all, but if I remove the processes section of my conky, conky says Amarok is turned off, although it is actually playing. Also, the other night just for chuckles, I tried rhythmbox script I had, and It´s giving me the same problem - conky states Rhythmbox is closed. Here is my conky (and Lua script, but I really don´t think that´s the problem). REALLY hoping someone can help

    Code:
    background yes
    own_window yes
    own_window_type override
    own_window_transparent yes
    # own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    # own_window_class conky
    use_xft yes
    #xftfont ariel:size=8
    xftfont MgOpen Modata-07
    xftalpha 1.0 #0.2
    override_utf8_locale yes
    update_interval 1.0
    total_run_times 0
    double_buffer yes
    no_buffers yes
    cpu_avg_samples 2
    net_avg_samples 2
    use_spacer right
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    alignment tl
    uppercase no
    imlib_cache_size 0
    
    minimum_size 1024 1024
    maximum_width 1024 
    
    gap_x 0 # left-right
    gap_y 0 # up-down
    border_inner_margin 0
    border_outer_margin 0
     
    # Colors
    default_color DCDCDC #Gainsboro
    color0 FFD700 #Gold  #7FFFD4 #Aquamarine
    color1 FFA07A #LightSalmon #CD5C5C IndianRed #00CED1 DarkTurquoise #00FFFF Cyan
    color2 FF8C00 #Darkorange
    color3 7FFF00 #Chartreuse
    color4 778899 #LightSlateGrey
    color5 FFDEAD #NavajoWhite
    color6 00BFFF #DeepSkyBlue
    #	colours below used by colorize script
    color7 48D1CC #MediumTurquoise
    color8 FFFF00 #Yellow
    color9 FF0000 #Red
    text_buffer_size 6144 # 256 is the minimum
    short_units yes
    pad_percents 2
    
    # -- Lua Load -- #
    lua_load ~/scripts/Conky/conky_widgets.lua
    lua_draw_hook_pre widgets
    
    TEXT
    ${voffset -10}${image ~/scripts/Conky/images/pc.png -p 460,100 -s 80x80}${image ~/scripts/Conky/images/proc.png -p 500,240 -s 80x80}
    ${image ~/scripts/Conky/images/amarok.png -p 860,300 -s 100x100}
    #--------------------------Time & Calendar-----------------#
    ${voffset 49}${goto 90}${time %l:%M:%S %P}${color}
    ${voffset 70}${goto 30}${color4} Ireland${goto 90}${color6}${tztime Europe:Ireland %l:%M:%S %P}${color}
    ${goto 30}${color4} Sweden${goto 90}${color6}${tztime Europe:Sweden-1  %l:%M:%S %P}${color}
    ${color4}${execpi 1 /etc/conky/calender.sh}${font}${voffset -2}
    #------------------------External Storage--------------------------#
    #------------------------Elements--------------------------#
    ${voffset -280}${goto 235}${color4} Elements ${if_existing /media/ELEMENTS}
    ${voffset 00}${goto 225}${color6}${fs_used /media/ELEMENTS}${color yellow} of ${color6}${fs_size /media/ELEMENTS}
    ${voffset 00}${goto 248}${color yellow}used
    ${voffset 00}${goto 228}Trash ${execi 1 du -sh /media/ELEMENTS/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 225}${color yellow}NOT MOUNTED${voffset 26}${endif}
    #------------------------Pen Drive--------------------------#
    ${voffset -58}${goto 335}${color4} Pen Drive ${if_existing /media/Pen_Drive}
    ${voffset 00}${goto 325}${color6}${fs_used /media/Pen_Drive}${color yellow} of ${color6}${fs_size /media/Pen_Drive}
    ${voffset 00}${goto 350}${color yellow}used
    ${voffset 00}${goto 335}Trash ${execi 1 du -sh /media/Pen_Drive/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 325}${color yellow}NOT MOUNTED${voffset 28}${endif}
    #------------------------Camera Card--------------------------#
    ${voffset -60}${goto 425}${color4} Camera Card ${if_existing /media/Cam_Card}
    ${voffset 00}${goto 425}${color6}${fs_used /media/Cam_Card}${color yellow} of ${color6}${fs_size /media/Cam_Card}
    ${voffset 00}${goto 448}${color yellow}used
    ${else}${voffset 20}${goto 425}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Movies--------------------------#
    ${voffset -48}${goto 540}${color4} Movies ${if_existing /media/MOVIES}
    ${voffset 00}${goto 525}${color6}${fs_used /media/MOVIES}${color yellow} of ${color6}${fs_size /media/MOVIES}
    ${voffset 00}${goto 545}${color yellow}used
    ${else}${voffset 20}${goto 525}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Sony Mp3--------------------------#
    ${voffset -48}${goto 635}${color4} Sony Mp3${if_existing /media/SONY_MP3}
    ${voffset 00}${goto 623}${color6}${fs_used /media/SONY_MP3}${color yellow} of ${color6}${fs_size /media/SONY_MP3}
    ${voffset 00}${goto 647}${color yellow}used
    ${else}${voffset 20}${goto 625}${color yellow}NOT MOUNTED${endif}
    #------------------------Ring Meters--------------------------#
    ${voffset 10}${goto 830}${color2} CPU ${cpu cpu0}%
    ${voffset -00}${goto 830}${color6} RAM ${memperc}%${color}
    ${voffset -00}${goto 780}${color #FFFF58} Swap ${swap} of ${swapmax} used
    ${voffset -00}${goto 785}${color5} Root ${fs_used /} of ${fs_size /} used
    ${voffset -00}${goto 780}${color8} Shitsta ${fs_used /media/Shitsta} of ${fs_size /media/Shitsta} used
    ${voffset -00}${goto 790}${color #34ff54}Battery ${battery}${color}${execpi 1 acpi -b | cut -c30-31 | xargs /etc/conky/colorize.sh}
    ${voffset -00}${goto 800}Power Consumption
    ${voffset -00}${goto 795}${color #3fd2ff}${exec cat /proc/acpi/battery/BAT0/state | grep 'present rate' | cut -c26-33} / ${exec cat /proc/acpi/battery/BAT0/state | grep 'remaining capacity' | cut -c26-33}${color}
    
    #--------------------------Reminders-----------------# 
    ${voffset 110}${font CloisterBlack:normal:size=18}${goto 65}${color6} Reminders${font}
    ${execi 5 remind ~/.reminders}
    #--------------------------TV-----------------#
    ${font CloisterBlack:normal:size=18}${goto 50}${color6} Tv Schedule${color}${font}
    ${voffset -10}${execp /etc/conky/conkyTV.sh}
    #------------------System-----------------#
    ${voffset -330}${font CloisterBlack:normal:size=30}${goto 300}${color6} System${font}${color}
    ${voffset 20}${goto 300}${font OpenLogos:size=15}u${voffset -4}${font}   Ubuntu 9.04 ${kernel}${voffset -5}${goto 500}${font OpenLogos:size=15}  T${voffset -4}${font}Gnome 2.26.1
    ${goto 300}${voffset +3}${font Illustrate IT:size=15}I${voffset -6}${font}   Intel dual CPU 2 x ${freq 1}
    ${voffset -12}${goto 505}${font StyleBats:size=12}v${voffset -4}${font}   Update: ${execi 600 aptitude search "~U" | wc -l | tail} package(s)${goto 600}${voffset 23}${goto 505}${font StyleBats:size=15}q${voffset -3}${font}  Uptime: ${uptime}${goto 318}${voffset -5}   Temp ${execi 300 hddtemp /dev/sda -n;}° C 
    #--------------------------Processes-----------------#
    ${voffset 15}${font CloisterBlack:normal:size=30}${goto 300}${color6} Processes${font}${color}
    ${voffset 20}${goto 400}$processes processes  $running_processes active
    ${goto 350}${color green}NAME ${goto 500} CPU     MEM${color}
    ${goto 350}${top name 1} ${goto 500} ${top cpu 1}   ${top mem 1}
    ${goto 350}${top name 2} ${goto 500} ${top cpu 2}   ${top mem 2}
    ${goto 350}${top name 3} ${goto 500} ${top cpu 3}   ${top mem 3}
    ${goto 350}${top name 4} ${goto 500} ${top cpu 4}   ${top mem 4}
    ${goto 350}${top name 5} ${goto 500} ${top cpu 5}   ${top mem 5}
    #--------------------------Amarok-----------------#
    ${voffset 10}${if_running amarokapp}${goto 760}${color6}${execi 1 dcop amarok player title}
    ${color red}${goto 760}${execi 1 dcop amarok player artist}${color}
    ${color yellow}${goto 760}${execi 1 dcop amarok player album}${color}${color yellow}
    ${goto 860}Year : ${execi 1 dcop amarok player year}${color}
    ${color #ff5a00}${goto 860}${execi 1 dcop amarok player currentTime} ${color green}/${color #ff5a00} ${execi 1 dcop amarok player totalTime}${color}
    ${goto 780}${color green}Player Volume ${execi 1 /etc/conky/Amarok.sh volume}%${goto 900}${color #ff5a00}Bitrate ${execi 1 dcop amarok player bitrate} kbps
    ${voffset -00}${goto 815}${color red}Current song ${execi 1 /etc/conky/Amarok.sh playCount}
    ${else}${image /home/graham/scripts/Conky/images/face-sad.png -p 860,410 -s 100x100}${voffset -120}${font FRESHBOT:size=30}${goto 830}${color #3fd2ff}T
    ${goto 830}U
    ${goto 830}R
    ${goto 830}N
    ${goto 830}E
    ${goto 830}D${voffset 16}
    ${voffset -210}${goto 970}O
    ${goto 970}F
    ${goto 970}F${color}${endif}${font}
    Code:
    --[[
    Conky Widgets by londonali1010 (2009)
    
    This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
    
    To configure:
    + Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
    + To call the widget, add the following just before the last "end" of the entire script:
    	cr = cairo_create(cs)
    	NAME_OF_FUNCTION(cr, OPTIONS)
    	cairo_destroy(cr)
    + Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    	lua_load ~/scripts/conky_widgets.lua
    	lua_draw_hook_pre widgets
    	
    Changelog:
    + v1.0 -- Original release (17.10.2009)
    ]]
    
    require 'cairo'
    require 'imlib2'
    
    --[[ CLOCK WIDGET ]]
    
    function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    	local function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    	
    	local function draw_ring(pct)
    		local angle_0=sa*(2*math.pi/360)-math.pi/2
    		local angle_f=ea*(2*math.pi/360)-math.pi/2
    		local pct_arc=pct*(angle_f-angle_0)
    
    		-- Draw background ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_f)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    		cairo_set_line_width(cr,t)
    		cairo_stroke(cr)
    	
    		-- Draw indicator ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    	end
    	
    	local function setup_ring()
    		local str = ''
    		local value = 0
    		
    		str = string.format('${%s %s}', name, arg)
    		str = conky_parse(str)
    		
    		value = tonumber(str)
    		if value == nil then value = 0 end
    		pct = value/max
    		
    		draw_ring(pct)
    	end	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then setup_ring() end
    end
    
    --[[ END CLOCK WIDGET ]]
    
    --[[ GRADIENT RING WIDGET ]]
    --[[ Options (name, arg, max, colour, alpha, x, y, inner_radius, outer_radius, frac, thickness, start_angle, end_angle):
            "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
            "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
            "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
            "fg_colour" is the colour of the ring.
            "fg_alpha" is the alpha value of the ring.
            "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
            "inner_radius" is the inner radius of the ring.
            "outer_radius" is the outer radius of the ring.  
            "frac" determines the extent of the gradient around the ring - 2 implies the gradient fades halfway around the ring, 4 equals a quarter of the way, etc...      
            "thickness" is the thickness of the ring, centred around the radius.
            "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
            "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]
         
    function gradient_ring(cr, name, arg, max, fgc, fga, xc, yc, ring_i, ring_o, frac, t, sa, ea)
            local function rgb_to_r_g_b(colour,alpha)
                return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
            end
         
            local function draw_gradient_ring(pct)
                local angle_0=sa*(2*math.pi/360)-math.pi/2
                local angle_f=ea*(2*math.pi/360)-math.pi/2
                local pct_arc=pct*(angle_f-angle_0)
         
                for i = 1,max/frac do
                    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga*i/max)) --for flat shading of bars
            
                    --local pat=cairo_pattern_create_linear(xc-ring_i*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_i*math.cos(angle_0+t_arc+2*math.pi*i/max),xc-ring_o*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_o*math.cos(angle_0+t_arc+2*math.pi*i/max))
                    --cairo_pattern_add_color_stop_rgba(pat,0,rgb_to_r_g_b(fgc,0))
                    --cairo_pattern_add_color_stop_rgba(pat,1,rgb_to_r_g_b(fgc,fga*i/max))
                    --cairo_set_source(cr,pat) -- for gradient shading of bars
            
                    cairo_move_to(cr,xc-ring_i*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_i*math.sin(angle_0+pct_arc+2*math.pi*i/max))
                    cairo_line_to(cr,xc-ring_o*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_o*math.sin(angle_0+pct_arc+2*math.pi*i/max))
        
                    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
                    cairo_set_line_width(cr,t)
                    cairo_stroke(cr)
                end
            end
         
            local function setup_gradient_ring()
                local str = ''
                local value = 0
         
                str = string.format('${%s %s}', name, arg)
                str = conky_parse(str)
         
                value = tonumber(str)
                if value == nil then value = 0 end
                pct = value/max
         
                draw_gradient_ring(pct)
            end    
         
            local updates=conky_parse('${updates}')
            update_num=tonumber(updates)
         
            if update_num>5 then setup_gradient_ring() end
        end
         
    --[[ END GRADIENT RING WIDGET ]]
    
    --[[ PHOTO ALBUM WIDGET ]]
    
    album_dir = "/home/graham/Pictures/Conky/"
    -- "xc" and "yc" are the coordinates of the centre of the photo album, relative to the top left corner of the Conky window, in pixels
    xc, yc = 400, 600
    -- "w_max" and "h_max" are the maximum dimensions, in pixels, that you want the widget to be.  The script will ensure that the photo album fits inside the box bounded by w_max and h_max
    w_max, h_max = 200, 200
    -- "t" is the thickness of the frame, in pixels
    t = 3
    -- "update_interval" is the number of Conky updates between refreshes
    update_interval = 10
    
    function get_file_to_use()
        num_files = tonumber(conky_parse("${exec ls -A " .. album_dir .. " | wc -l}"))
        if num_files == nil then num_files = 0 end
        if num_files == 0 then return "none" end
        
        updates = tonumber(conky_parse("${updates}"))
        whole = math.ceil(updates/update_interval)
        
        if whole <= num_files
        then
            num_file_to_show = whole
        else
            whole = whole % num_files
            num_file_to_show = whole
        end
        
        return conky_parse("${exec ls " .. album_dir .. " | sed -n " .. num_file_to_show .. "p}")
    end
    
    function init_drawing_surface()
        imlib_set_cache_size(4096 * 1024)
        imlib_context_set_dither(1)
    end
    
    function draw_frame()
    	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)
        
        cairo_rectangle(cr, xc - width/2 - t, yc - height/2 - t, width + 2*t, height + 2*t)
        cairo_set_source_rgba(cr, 1, 1, 1, 0.8)
        cairo_fill(cr)   
        
        cairo_destroy(cr)
    end
    
    function draw_image()
        init_drawing_surface()
        
        image = imlib_load_image(album_dir .. filename)
        if image == nil then return end
        imlib_context_set_image(image)
    	
    	w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
    	if w_img >= h_img
    	then
    	    width = w_max - 2*t
    	    height = width * (h_img/w_img)
    	else
    	    height = h_max - 2*t
    	    width = height * (w_img/h_img)
    	end
    	
    	draw_frame()
    	
    	buffer = imlib_create_image(width, height)
    	imlib_context_set_image(buffer)
    	
    	imlib_blend_image_onto_image(image, 0, 0, 0, w_img, h_img, 0, 0, width, height)
    	imlib_context_set_image(image)
    	imlib_free_image()
    	
    	imlib_context_set_image(buffer)
    	imlib_render_image_on_drawable(xc - width/2, yc - height/2)
    	imlib_free_image()
    end
    
    
    function conky_photo_album()
        if conky_window == nil then return end
        filename = get_file_to_use()
        if filename == "none"
        then
            print(album_dir .. ": No files found")
        else
            draw_image()
        end
    end
    
    --[[ END PHOTO ALBUM WIDGET ]]
    
    --[[ BACKGROUND WIDGET ]]
    
    -- Change these settings to affect your background.
    -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
     
    corner_r=15
     
    -- Set the colour and transparency (alpha) of your background.
     
    bg_colour=0xffffff
    bg_alpha=0.2
     
    require 'cairo'
    function rgb_to_r_g_b(colour,alpha)
    	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
     
    function conky_draw_bg()
    	if conky_window==nil then return end
    	local w=conky_window.width
    	local h=conky_window.height
    	local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    	cr=cairo_create(cs)
     
    	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-corner_r)
    	cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    	cairo_line_to(cr,corner_r,h)
    	cairo_curve_to(cr,0,h,0,h,0,h-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,rgb_to_r_g_b(bg_colour,bg_alpha))
    	cairo_fill(cr)
    end
    
    --[[ END BACKGROUND WIDGET ]]
    
    function conky_widgets()
    	if conky_window == nil then return end
    	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    	cr = cairo_create(cs)
    	
    	cairo_destroy(cr)
    
    -------------------[[ TIME SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%I', 12, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%M', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 55, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%S', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.3, 120, 70, 63, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END TIME SETTINGS ]]---------------
    
    -------------------[[ GRADIENT RING SETTINGS ]]---------------
    
    cr = cairo_create(cs)
            gradient_ring(cr, '', '', 12, 0xFF0000, 10.0, 120, 70, 65, 60, 1, 2, 0, 360)
            cairo_destroy(cr)
            
    -------------------[[ END GRADIENT RING SETTINGS ]]---------------
    
    -------------------[[ STORAGE RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/ELEMENTS', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 260, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Pen_Drive', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 360, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Cam_Card', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 460, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 560, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 660, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END STORAGE RINGS SETTINGS ]]---------------
    
    -------------------[[ CPU RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'cpu', 'cpu0', 100, 0xFFFFFF, 0, 0xFF8C00, 1.0, 850, 148, 140, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'memperc', '', 100, 0xFFFFFF, 0, 0x00BFFF, 1.0, 850, 148, 130, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'swapperc', '', 100, 0xFFFFFF, 0, 0xFFFF58, 1.0, 850, 148, 120, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0, 0xFFDEAD, 1.0, 850, 148, 110, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Shitsta', 100, 0xFFFFFF, 0, 0xFFFF00, 1.0, 850, 148, 100, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)	
    
    	cr = cairo_create(cs)
    	ring(cr, 'battery_percent', 'BAT0', 100, 0xFFFFFF, 0, 0x00FF2A, 1.0, 850, 148, 90, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END CPU RINGS SETTINGS ]]---------------	
    
    -------------------[[ PHOTO ALBUM SETTINGS ]]---------------
    --conky_photo_album('/home/graham/Pictures/Conky/', 400, 600, 200, 200, 10, 10)
    -------------------[[ END PHOTO ALBUM SETTINGS ]]---------------
    
    conky_draw_bg(0xFFFFFF, 0.4)
    end
    I'd love to help, but I don't use Ubuntu nor Amarok so I'm at a loss.

    However, this replt will keep your request current and maybe grab someones interest.

    Have a nice day and good luck.
    Bruce

  9. #10989
    Join Date
    Feb 2009
    Location
    UK
    Beans
    129
    Distro
    Ubuntu

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by merlin_ie View Post
    On the subject of music players, I posted a request for help a few days ago regarding Amarok-Conky but it got buried in an avalanche it seems lol so I´ll chance my arm again. I´m using Amarok 1.4 in Jaunty and conky-all, but if I remove the processes section of my conky, conky says Amarok is turned off, although it is actually playing. Also, the other night just for chuckles, I tried rhythmbox script I had, and It´s giving me the same problem - conky states Rhythmbox is closed. Here is my conky (and Lua script, but I really don´t think that´s the problem). REALLY hoping someone can help

    Code:
    background yes
    own_window yes
    own_window_type override
    own_window_transparent yes
    # own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    # own_window_class conky
    use_xft yes
    #xftfont ariel:size=8
    xftfont MgOpen Modata-07
    xftalpha 1.0 #0.2
    override_utf8_locale yes
    update_interval 1.0
    total_run_times 0
    double_buffer yes
    no_buffers yes
    cpu_avg_samples 2
    net_avg_samples 2
    use_spacer right
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    alignment tl
    uppercase no
    imlib_cache_size 0
    
    minimum_size 1024 1024
    maximum_width 1024 
    
    gap_x 0 # left-right
    gap_y 0 # up-down
    border_inner_margin 0
    border_outer_margin 0
     
    # Colors
    default_color DCDCDC #Gainsboro
    color0 FFD700 #Gold  #7FFFD4 #Aquamarine
    color1 FFA07A #LightSalmon #CD5C5C IndianRed #00CED1 DarkTurquoise #00FFFF Cyan
    color2 FF8C00 #Darkorange
    color3 7FFF00 #Chartreuse
    color4 778899 #LightSlateGrey
    color5 FFDEAD #NavajoWhite
    color6 00BFFF #DeepSkyBlue
    #	colours below used by colorize script
    color7 48D1CC #MediumTurquoise
    color8 FFFF00 #Yellow
    color9 FF0000 #Red
    text_buffer_size 6144 # 256 is the minimum
    short_units yes
    pad_percents 2
    
    # -- Lua Load -- #
    lua_load ~/scripts/Conky/conky_widgets.lua
    lua_draw_hook_pre widgets
    
    TEXT
    ${voffset -10}${image ~/scripts/Conky/images/pc.png -p 460,100 -s 80x80}${image ~/scripts/Conky/images/proc.png -p 500,240 -s 80x80}
    ${image ~/scripts/Conky/images/amarok.png -p 860,300 -s 100x100}
    #--------------------------Time & Calendar-----------------#
    ${voffset 49}${goto 90}${time %l:%M:%S %P}${color}
    ${voffset 70}${goto 30}${color4} Ireland${goto 90}${color6}${tztime Europe:Ireland %l:%M:%S %P}${color}
    ${goto 30}${color4} Sweden${goto 90}${color6}${tztime Europe:Sweden-1  %l:%M:%S %P}${color}
    ${color4}${execpi 1 /etc/conky/calender.sh}${font}${voffset -2}
    #------------------------External Storage--------------------------#
    #------------------------Elements--------------------------#
    ${voffset -280}${goto 235}${color4} Elements ${if_existing /media/ELEMENTS}
    ${voffset 00}${goto 225}${color6}${fs_used /media/ELEMENTS}${color yellow} of ${color6}${fs_size /media/ELEMENTS}
    ${voffset 00}${goto 248}${color yellow}used
    ${voffset 00}${goto 228}Trash ${execi 1 du -sh /media/ELEMENTS/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 225}${color yellow}NOT MOUNTED${voffset 26}${endif}
    #------------------------Pen Drive--------------------------#
    ${voffset -58}${goto 335}${color4} Pen Drive ${if_existing /media/Pen_Drive}
    ${voffset 00}${goto 325}${color6}${fs_used /media/Pen_Drive}${color yellow} of ${color6}${fs_size /media/Pen_Drive}
    ${voffset 00}${goto 350}${color yellow}used
    ${voffset 00}${goto 335}Trash ${execi 1 du -sh /media/Pen_Drive/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 325}${color yellow}NOT MOUNTED${voffset 28}${endif}
    #------------------------Camera Card--------------------------#
    ${voffset -60}${goto 425}${color4} Camera Card ${if_existing /media/Cam_Card}
    ${voffset 00}${goto 425}${color6}${fs_used /media/Cam_Card}${color yellow} of ${color6}${fs_size /media/Cam_Card}
    ${voffset 00}${goto 448}${color yellow}used
    ${else}${voffset 20}${goto 425}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Movies--------------------------#
    ${voffset -48}${goto 540}${color4} Movies ${if_existing /media/MOVIES}
    ${voffset 00}${goto 525}${color6}${fs_used /media/MOVIES}${color yellow} of ${color6}${fs_size /media/MOVIES}
    ${voffset 00}${goto 545}${color yellow}used
    ${else}${voffset 20}${goto 525}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Sony Mp3--------------------------#
    ${voffset -48}${goto 635}${color4} Sony Mp3${if_existing /media/SONY_MP3}
    ${voffset 00}${goto 623}${color6}${fs_used /media/SONY_MP3}${color yellow} of ${color6}${fs_size /media/SONY_MP3}
    ${voffset 00}${goto 647}${color yellow}used
    ${else}${voffset 20}${goto 625}${color yellow}NOT MOUNTED${endif}
    #------------------------Ring Meters--------------------------#
    ${voffset 10}${goto 830}${color2} CPU ${cpu cpu0}%
    ${voffset -00}${goto 830}${color6} RAM ${memperc}%${color}
    ${voffset -00}${goto 780}${color #FFFF58} Swap ${swap} of ${swapmax} used
    ${voffset -00}${goto 785}${color5} Root ${fs_used /} of ${fs_size /} used
    ${voffset -00}${goto 780}${color8} Shitsta ${fs_used /media/Shitsta} of ${fs_size /media/Shitsta} used
    ${voffset -00}${goto 790}${color #34ff54}Battery ${battery}${color}${execpi 1 acpi -b | cut -c30-31 | xargs /etc/conky/colorize.sh}
    ${voffset -00}${goto 800}Power Consumption
    ${voffset -00}${goto 795}${color #3fd2ff}${exec cat /proc/acpi/battery/BAT0/state | grep 'present rate' | cut -c26-33} / ${exec cat /proc/acpi/battery/BAT0/state | grep 'remaining capacity' | cut -c26-33}${color}
    
    #--------------------------Reminders-----------------# 
    ${voffset 110}${font CloisterBlack:normal:size=18}${goto 65}${color6} Reminders${font}
    ${execi 5 remind ~/.reminders}
    #--------------------------TV-----------------#
    ${font CloisterBlack:normal:size=18}${goto 50}${color6} Tv Schedule${color}${font}
    ${voffset -10}${execp /etc/conky/conkyTV.sh}
    #------------------System-----------------#
    ${voffset -330}${font CloisterBlack:normal:size=30}${goto 300}${color6} System${font}${color}
    ${voffset 20}${goto 300}${font OpenLogos:size=15}u${voffset -4}${font}   Ubuntu 9.04 ${kernel}${voffset -5}${goto 500}${font OpenLogos:size=15}  T${voffset -4}${font}Gnome 2.26.1
    ${goto 300}${voffset +3}${font Illustrate IT:size=15}I${voffset -6}${font}   Intel dual CPU 2 x ${freq 1}
    ${voffset -12}${goto 505}${font StyleBats:size=12}v${voffset -4}${font}   Update: ${execi 600 aptitude search "~U" | wc -l | tail} package(s)${goto 600}${voffset 23}${goto 505}${font StyleBats:size=15}q${voffset -3}${font}  Uptime: ${uptime}${goto 318}${voffset -5}   Temp ${execi 300 hddtemp /dev/sda -n;}° C 
    #--------------------------Processes-----------------#
    ${voffset 15}${font CloisterBlack:normal:size=30}${goto 300}${color6} Processes${font}${color}
    ${voffset 20}${goto 400}$processes processes  $running_processes active
    ${goto 350}${color green}NAME ${goto 500} CPU     MEM${color}
    ${goto 350}${top name 1} ${goto 500} ${top cpu 1}   ${top mem 1}
    ${goto 350}${top name 2} ${goto 500} ${top cpu 2}   ${top mem 2}
    ${goto 350}${top name 3} ${goto 500} ${top cpu 3}   ${top mem 3}
    ${goto 350}${top name 4} ${goto 500} ${top cpu 4}   ${top mem 4}
    ${goto 350}${top name 5} ${goto 500} ${top cpu 5}   ${top mem 5}
    #--------------------------Amarok-----------------#
    ${voffset 10}${if_running amarokapp}${goto 760}${color6}${execi 1 dcop amarok player title}
    ${color red}${goto 760}${execi 1 dcop amarok player artist}${color}
    ${color yellow}${goto 760}${execi 1 dcop amarok player album}${color}${color yellow}
    ${goto 860}Year : ${execi 1 dcop amarok player year}${color}
    ${color #ff5a00}${goto 860}${execi 1 dcop amarok player currentTime} ${color green}/${color #ff5a00} ${execi 1 dcop amarok player totalTime}${color}
    ${goto 780}${color green}Player Volume ${execi 1 /etc/conky/Amarok.sh volume}%${goto 900}${color #ff5a00}Bitrate ${execi 1 dcop amarok player bitrate} kbps
    ${voffset -00}${goto 815}${color red}Current song ${execi 1 /etc/conky/Amarok.sh playCount}
    ${else}${image /home/graham/scripts/Conky/images/face-sad.png -p 860,410 -s 100x100}${voffset -120}${font FRESHBOT:size=30}${goto 830}${color #3fd2ff}T
    ${goto 830}U
    ${goto 830}R
    ${goto 830}N
    ${goto 830}E
    ${goto 830}D${voffset 16}
    ${voffset -210}${goto 970}O
    ${goto 970}F
    ${goto 970}F${color}${endif}${font}
    Code:
    --[[
    Conky Widgets by londonali1010 (2009)
    
    This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
    
    To configure:
    + Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
    + To call the widget, add the following just before the last "end" of the entire script:
    	cr = cairo_create(cs)
    	NAME_OF_FUNCTION(cr, OPTIONS)
    	cairo_destroy(cr)
    + Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    	lua_load ~/scripts/conky_widgets.lua
    	lua_draw_hook_pre widgets
    	
    Changelog:
    + v1.0 -- Original release (17.10.2009)
    ]]
    
    require 'cairo'
    require 'imlib2'
    
    --[[ CLOCK WIDGET ]]
    
    function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    	local function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    	
    	local function draw_ring(pct)
    		local angle_0=sa*(2*math.pi/360)-math.pi/2
    		local angle_f=ea*(2*math.pi/360)-math.pi/2
    		local pct_arc=pct*(angle_f-angle_0)
    
    		-- Draw background ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_f)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    		cairo_set_line_width(cr,t)
    		cairo_stroke(cr)
    	
    		-- Draw indicator ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    	end
    	
    	local function setup_ring()
    		local str = ''
    		local value = 0
    		
    		str = string.format('${%s %s}', name, arg)
    		str = conky_parse(str)
    		
    		value = tonumber(str)
    		if value == nil then value = 0 end
    		pct = value/max
    		
    		draw_ring(pct)
    	end	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then setup_ring() end
    end
    
    --[[ END CLOCK WIDGET ]]
    
    --[[ GRADIENT RING WIDGET ]]
    --[[ Options (name, arg, max, colour, alpha, x, y, inner_radius, outer_radius, frac, thickness, start_angle, end_angle):
            "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
            "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
            "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
            "fg_colour" is the colour of the ring.
            "fg_alpha" is the alpha value of the ring.
            "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
            "inner_radius" is the inner radius of the ring.
            "outer_radius" is the outer radius of the ring.  
            "frac" determines the extent of the gradient around the ring - 2 implies the gradient fades halfway around the ring, 4 equals a quarter of the way, etc...      
            "thickness" is the thickness of the ring, centred around the radius.
            "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
            "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]
         
    function gradient_ring(cr, name, arg, max, fgc, fga, xc, yc, ring_i, ring_o, frac, t, sa, ea)
            local function rgb_to_r_g_b(colour,alpha)
                return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
            end
         
            local function draw_gradient_ring(pct)
                local angle_0=sa*(2*math.pi/360)-math.pi/2
                local angle_f=ea*(2*math.pi/360)-math.pi/2
                local pct_arc=pct*(angle_f-angle_0)
         
                for i = 1,max/frac do
                    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga*i/max)) --for flat shading of bars
            
                    --local pat=cairo_pattern_create_linear(xc-ring_i*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_i*math.cos(angle_0+t_arc+2*math.pi*i/max),xc-ring_o*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_o*math.cos(angle_0+t_arc+2*math.pi*i/max))
                    --cairo_pattern_add_color_stop_rgba(pat,0,rgb_to_r_g_b(fgc,0))
                    --cairo_pattern_add_color_stop_rgba(pat,1,rgb_to_r_g_b(fgc,fga*i/max))
                    --cairo_set_source(cr,pat) -- for gradient shading of bars
            
                    cairo_move_to(cr,xc-ring_i*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_i*math.sin(angle_0+pct_arc+2*math.pi*i/max))
                    cairo_line_to(cr,xc-ring_o*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_o*math.sin(angle_0+pct_arc+2*math.pi*i/max))
        
                    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
                    cairo_set_line_width(cr,t)
                    cairo_stroke(cr)
                end
            end
         
            local function setup_gradient_ring()
                local str = ''
                local value = 0
         
                str = string.format('${%s %s}', name, arg)
                str = conky_parse(str)
         
                value = tonumber(str)
                if value == nil then value = 0 end
                pct = value/max
         
                draw_gradient_ring(pct)
            end    
         
            local updates=conky_parse('${updates}')
            update_num=tonumber(updates)
         
            if update_num>5 then setup_gradient_ring() end
        end
         
    --[[ END GRADIENT RING WIDGET ]]
    
    --[[ PHOTO ALBUM WIDGET ]]
    
    album_dir = "/home/graham/Pictures/Conky/"
    -- "xc" and "yc" are the coordinates of the centre of the photo album, relative to the top left corner of the Conky window, in pixels
    xc, yc = 400, 600
    -- "w_max" and "h_max" are the maximum dimensions, in pixels, that you want the widget to be.  The script will ensure that the photo album fits inside the box bounded by w_max and h_max
    w_max, h_max = 200, 200
    -- "t" is the thickness of the frame, in pixels
    t = 3
    -- "update_interval" is the number of Conky updates between refreshes
    update_interval = 10
    
    function get_file_to_use()
        num_files = tonumber(conky_parse("${exec ls -A " .. album_dir .. " | wc -l}"))
        if num_files == nil then num_files = 0 end
        if num_files == 0 then return "none" end
        
        updates = tonumber(conky_parse("${updates}"))
        whole = math.ceil(updates/update_interval)
        
        if whole <= num_files
        then
            num_file_to_show = whole
        else
            whole = whole % num_files
            num_file_to_show = whole
        end
        
        return conky_parse("${exec ls " .. album_dir .. " | sed -n " .. num_file_to_show .. "p}")
    end
    
    function init_drawing_surface()
        imlib_set_cache_size(4096 * 1024)
        imlib_context_set_dither(1)
    end
    
    function draw_frame()
    	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)
        
        cairo_rectangle(cr, xc - width/2 - t, yc - height/2 - t, width + 2*t, height + 2*t)
        cairo_set_source_rgba(cr, 1, 1, 1, 0.8)
        cairo_fill(cr)   
        
        cairo_destroy(cr)
    end
    
    function draw_image()
        init_drawing_surface()
        
        image = imlib_load_image(album_dir .. filename)
        if image == nil then return end
        imlib_context_set_image(image)
    	
    	w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
    	if w_img >= h_img
    	then
    	    width = w_max - 2*t
    	    height = width * (h_img/w_img)
    	else
    	    height = h_max - 2*t
    	    width = height * (w_img/h_img)
    	end
    	
    	draw_frame()
    	
    	buffer = imlib_create_image(width, height)
    	imlib_context_set_image(buffer)
    	
    	imlib_blend_image_onto_image(image, 0, 0, 0, w_img, h_img, 0, 0, width, height)
    	imlib_context_set_image(image)
    	imlib_free_image()
    	
    	imlib_context_set_image(buffer)
    	imlib_render_image_on_drawable(xc - width/2, yc - height/2)
    	imlib_free_image()
    end
    
    
    function conky_photo_album()
        if conky_window == nil then return end
        filename = get_file_to_use()
        if filename == "none"
        then
            print(album_dir .. ": No files found")
        else
            draw_image()
        end
    end
    
    --[[ END PHOTO ALBUM WIDGET ]]
    
    --[[ BACKGROUND WIDGET ]]
    
    -- Change these settings to affect your background.
    -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
     
    corner_r=15
     
    -- Set the colour and transparency (alpha) of your background.
     
    bg_colour=0xffffff
    bg_alpha=0.2
     
    require 'cairo'
    function rgb_to_r_g_b(colour,alpha)
    	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
     
    function conky_draw_bg()
    	if conky_window==nil then return end
    	local w=conky_window.width
    	local h=conky_window.height
    	local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    	cr=cairo_create(cs)
     
    	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-corner_r)
    	cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    	cairo_line_to(cr,corner_r,h)
    	cairo_curve_to(cr,0,h,0,h,0,h-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,rgb_to_r_g_b(bg_colour,bg_alpha))
    	cairo_fill(cr)
    end
    
    --[[ END BACKGROUND WIDGET ]]
    
    function conky_widgets()
    	if conky_window == nil then return end
    	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    	cr = cairo_create(cs)
    	
    	cairo_destroy(cr)
    
    -------------------[[ TIME SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%I', 12, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%M', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 55, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%S', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.3, 120, 70, 63, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END TIME SETTINGS ]]---------------
    
    -------------------[[ GRADIENT RING SETTINGS ]]---------------
    
    cr = cairo_create(cs)
            gradient_ring(cr, '', '', 12, 0xFF0000, 10.0, 120, 70, 65, 60, 1, 2, 0, 360)
            cairo_destroy(cr)
            
    -------------------[[ END GRADIENT RING SETTINGS ]]---------------
    
    -------------------[[ STORAGE RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/ELEMENTS', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 260, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Pen_Drive', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 360, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Cam_Card', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 460, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 560, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 660, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END STORAGE RINGS SETTINGS ]]---------------
    
    -------------------[[ CPU RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'cpu', 'cpu0', 100, 0xFFFFFF, 0, 0xFF8C00, 1.0, 850, 148, 140, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'memperc', '', 100, 0xFFFFFF, 0, 0x00BFFF, 1.0, 850, 148, 130, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'swapperc', '', 100, 0xFFFFFF, 0, 0xFFFF58, 1.0, 850, 148, 120, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0, 0xFFDEAD, 1.0, 850, 148, 110, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Shitsta', 100, 0xFFFFFF, 0, 0xFFFF00, 1.0, 850, 148, 100, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)	
    
    	cr = cairo_create(cs)
    	ring(cr, 'battery_percent', 'BAT0', 100, 0xFFFFFF, 0, 0x00FF2A, 1.0, 850, 148, 90, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END CPU RINGS SETTINGS ]]---------------	
    
    -------------------[[ PHOTO ALBUM SETTINGS ]]---------------
    --conky_photo_album('/home/graham/Pictures/Conky/', 400, 600, 200, 200, 10, 10)
    -------------------[[ END PHOTO ALBUM SETTINGS ]]---------------
    
    conky_draw_bg(0xFFFFFF, 0.4)
    end
    The last I remember, there was an issue in 1.7.2 with $if_running not working properly, and I don't think it's been fixed in that version. Try removing the $if_running variable and see if that works; if it does, it means that it's an $if_running issue.
    - Samsung R519 Silver - Dual-Boot Windows 7/Ubuntu 9.10 -
    - The Official Conky Blog - Follow conkynews on Twitter -
    - My Launchpad PPA -
    - My blog: My Little Desktop -

  10. #10990
    Join Date
    Jul 2008
    Beans
    70

    Re: Post your .conkyrc files w/ screenshots

    Thanks for reply. Yeah, now that I think on it, it seemed to run ok when I removed the $if_running variable and same for Rhythmbox (not at home to check). I thought it was down to my shoddy coding lol but now I know I´m not to blame (this time)

Page 1099 of 2316 FirstFirst ... 99599999104910891097109810991100110111091149119915992099 ... 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
  •