Page 1055 of 2348 FirstFirst ... 55555955100510451053105410551056105710651105115515552055 ... LastLast
Results 10,541 to 10,550 of 23480

Thread: Post your .conkyrc files w/ screenshots

  1. #10541
    Join Date
    Feb 2009
    Location
    UK
    Beans
    129
    Distro
    Ubuntu

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by proxess View Post
    What if Cairo is looking for actions over the printed items, and not Conky?

    I had a teacher (and boss after I finished school) that said "Whatever you can do with a specific programming language, you can do with any programming language.
    This may seem like a long shot, and he was kind of nuts, but he was probably the smartest and most intelligent person I've ever met.
    I think what I was getting at is that with the normal lua_draw_hook_pre command, you execute a function once every second, say, but how would you have it watch for a keypress? I guess you could have it watch for a keypress for one second...

    I also don't know whether the Lua part of Conky goes off and operates on its own, or whether Conky waits for it to finish before continuing. Either way, you could either get an awful lot of processes waiting for a keypress on the same location, or your Conky would end up stalling until you click... :S

    I would probably just have a standalone script that watched the desktop for clicks, but called from my conky-start script at the same time as Conky...I wonder if that would work?
    - 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 -

  2. #10542
    Join Date
    Jul 2005
    Location
    The Netherlands
    Beans
    209
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by londonali1010 View Post
    I think what I was getting at is that with the normal lua_draw_hook_pre command, you execute a function once every second, say, but how would you have it watch for a keypress? I guess you could have it watch for a keypress for one second...

    I also don't know whether the Lua part of Conky goes off and operates on its own, or whether Conky waits for it to finish before continuing. Either way, you could either get an awful lot of processes waiting for a keypress on the same location, or your Conky would end up stalling until you click... :S

    I would probably just have a standalone script that watched the desktop for clicks, but called from my conky-start script at the same time as Conky...I wonder if that would work?
    Something that works similar to conkyForecast's template system, only with code, could work. You could initiate the code from Conky, run the "script" that builds from a "template", which looks for mouse clicks over an "image" within that "template", knowing exactly where to look, from the "image's" position, Conky's position, and image size.
    Laptop: i7 4930MX @3.9GHz undervolted; 32GB 4x8GB Kingston HyperX Impact 1600MHz; Nvidia 780M 4GB; Samsung 840 EVO mSATA 250GB; Ubuntu 16.04 and Windows 10 Pro.
    Ubuntu #8076 / Linux #429448

  3. #10543
    Join Date
    Sep 2008
    Location
    Italy Varese..
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Post your .conkyrc files w/ screenshots

    Hi boys.
    I have installed conky 1.7.2 with the option.lua. cairo.
    I would now want to install the option to visualize the clock "clock_rings.lua" As I can do?
    I use Jaunty 9.04.
    May conky:

    Code:
    deegan@deegan-jaunty:~$ conky -version
    Conky 1.7.2 compiled Wed Nov 18 20:21:52 CET 2009 for Linux 2.6.28-16-generic (i686)
    
    Compiled in features:
    
    System config file: /usr/local/etc/conky/conky.conf
    Package library path: /usr/local/lib/conky
    
     X11:
      * Xdamage extension
      * XDBE (double buffer extension)
      * Xft
    
     Music detection:
      * MPD
      * MOC
    
     General:
      * math
      * hddtemp
      * portmon
      * config-output
      * apcupsd
      * iostats
      * Lua
    
      Lua bindings:
       * Cairo
    deegan@deegan-jaunty:~$
    I would want to visualize this:

    Code:
    --[[
    Clock Rings by londonali1010 (2009) Edited by jpope
    
    This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
    
    IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
    
    To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    	lua_load ~/scripts/clock_rings.lua
    	lua_draw_hook_pre clock_rings
    	
    Changelog:
    + v1.0 -- Original release (30.09.2009)
       v1.1p -- jpope edit (05.10.2009)
       v1.2p -- jpope edit (06.10.2009)
       v1.3p -- jpope edit (10.10.2009)
    ]]
    
    settings_table = {
    	{
    		-- Edit this table to customise your rings.
    		-- You can create more rings simply by adding more elements to settings_table.
    		-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    		name='time',
    		-- "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 ''.
    		arg='%I.%M',
    		-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    		max=12,
    		-- "bg_colour" is the colour of the base ring.
    		bg_colour=0x3399cc,
    		-- "bg_alpha" is the alpha value of the base ring.
    		bg_alpha=0.2,
    		-- "fg_colour" is the colour of the indicator part of the ring.
    		fg_colour=0x3399cc,
    		-- "fg_alpha" is the alpha value of the indicator part of the ring.
    		fg_alpha=0.2,
    		-- "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.
    		x=900, y=160,
    		-- "radius" is the radius of the ring.
    		radius=50,
    		-- "thickness" is the thickness of the ring, centred around the radius.
    		thickness=5,
    		-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    		start_angle=0,
    		-- "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 than start_angle.
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%M.%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=900, y=160,
    		radius=56,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=160,
    		radius=62,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%d',
    		max=31,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%m',
    		max=12,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%w',
    		max=6,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='time',
    		arg='%U',
    		max=52,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='cpu',
    		arg='cpu0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=660, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu1',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu2',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='freq',
    		arg='',
    		max=1600,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=660, y=40,
    		radius=10,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=420, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=420, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='memperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=780, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='swapperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=780, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/Ubuntu',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=900, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/WinXP',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=900, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='wireless_link_qual_perc',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=540, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='upspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='downspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=300, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=300, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    }
    
    -- Use these settings to define the origin and extent of your clock.
    
    clock_r=100
    
    -- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
    
    clock_x=900
    clock_y=160
    
    show_seconds=true
    
    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 draw_ring(cr,t,pt)
    	local w,h=conky_window.width,conky_window.height
    	
    	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    
    	local angle_0=sa*(2*math.pi/360)-math.pi/2
    	local angle_f=ea*(2*math.pi/360)-math.pi/2
    	local t_arc=t*(angle_f-angle_0)
    
    	-- Draw background ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    	cairo_set_line_width(cr,ring_w)
    	cairo_stroke(cr)
    	
    	-- Draw indicator ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    	cairo_stroke(cr)		
    end
    
    function draw_clock_hands(cr,xc,yc)
    	local secs,mins,hours,secs_arc,mins_arc,hours_arc
    	local xh,yh,xm,ym,xs,ys
    	
    	secs=os.date("%S")	
    	mins=os.date("%M")
    	hours=os.date("%I")
    		
    	secs_arc=(2*math.pi/60)*secs
    	mins_arc=(2*math.pi/60)*mins+secs_arc/60
    	hours_arc=(2*math.pi/12)*hours+mins_arc/12
    		
    	-- Draw hour hand
    	
    	xh=xc+0.7*clock_r*math.sin(hours_arc)
    	yh=yc-0.7*clock_r*math.cos(hours_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xh,yh)
    	
    	cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    	cairo_set_line_width(cr,5)
    	cairo_set_source_rgba(cr,0.2,0.6,1,0.4)
    	cairo_stroke(cr)
    	
    	-- Draw minute hand
    	
    	xm=xc+clock_r*math.sin(mins_arc)
    	ym=yc-clock_r*math.cos(mins_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xm,ym)
    	
    	cairo_set_line_width(cr,3)
    	cairo_stroke(cr)
    	
    	-- Draw seconds hand
    	
    	if show_seconds then
    		xs=xc+clock_r*math.sin(secs_arc)
    		ys=yc-clock_r*math.cos(secs_arc)
    		cairo_move_to(cr,xc,yc)
    		cairo_line_to(cr,xs,ys)
    	
    		cairo_set_line_width(cr,1)
    		cairo_stroke(cr)
    	end
    end
    
    function conky_clock_rings()
    	local function setup_rings(cr,pt)
    		local str=''
    		local value=0
    		
    		str=string.format('${%s %s}',pt['name'],pt['arg'])
    		str=conky_parse(str)
    		
    		value=tonumber(str)
    		pct=value/pt['max']
    		
    		draw_ring(cr,pct,pt)
    	end
    	
    	-- Check that Conky has been running for at least 5s
    
    	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)	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then
    		for i in pairs(settings_table) do
    			setup_rings(cr,settings_table[i])
    		end
    	end
    	
    	draw_clock_hands(cr,clock_x,clock_y)
    end
    Grazie......

  4. #10544
    Join Date
    Jul 2008
    Location
    Connecticut, U.S.
    Beans
    106
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by degan View Post
    Hi boys.
    I have installed conky 1.7.2 with the option.lua. cairo.
    I would now want to install the option to visualize the clock "clock_rings.lua" As I can do?
    I use Jaunty 9.04.
    May conky:

    Code:
    deegan@deegan-jaunty:~$ conky -version
    Conky 1.7.2 compiled Wed Nov 18 20:21:52 CET 2009 for Linux 2.6.28-16-generic (i686)
    
    Compiled in features:
    
    System config file: /usr/local/etc/conky/conky.conf
    Package library path: /usr/local/lib/conky
    
     X11:
      * Xdamage extension
      * XDBE (double buffer extension)
      * Xft
    
     Music detection:
      * MPD
      * MOC
    
     General:
      * math
      * hddtemp
      * portmon
      * config-output
      * apcupsd
      * iostats
      * Lua
    
      Lua bindings:
       * Cairo
    deegan@deegan-jaunty:~$
    I would want to visualize this:

    Code:
    --[[
    Clock Rings by londonali1010 (2009) Edited by jpope
    
    This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
    
    IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
    
    To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    	lua_load ~/scripts/clock_rings.lua
    	lua_draw_hook_pre clock_rings
    	
    Changelog:
    + v1.0 -- Original release (30.09.2009)
       v1.1p -- jpope edit (05.10.2009)
       v1.2p -- jpope edit (06.10.2009)
       v1.3p -- jpope edit (10.10.2009)
    ]]
    
    settings_table = {
    	{
    		-- Edit this table to customise your rings.
    		-- You can create more rings simply by adding more elements to settings_table.
    		-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    		name='time',
    		-- "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 ''.
    		arg='%I.%M',
    		-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    		max=12,
    		-- "bg_colour" is the colour of the base ring.
    		bg_colour=0x3399cc,
    		-- "bg_alpha" is the alpha value of the base ring.
    		bg_alpha=0.2,
    		-- "fg_colour" is the colour of the indicator part of the ring.
    		fg_colour=0x3399cc,
    		-- "fg_alpha" is the alpha value of the indicator part of the ring.
    		fg_alpha=0.2,
    		-- "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.
    		x=900, y=160,
    		-- "radius" is the radius of the ring.
    		radius=50,
    		-- "thickness" is the thickness of the ring, centred around the radius.
    		thickness=5,
    		-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    		start_angle=0,
    		-- "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 than start_angle.
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%M.%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=900, y=160,
    		radius=56,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=160,
    		radius=62,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%d',
    		max=31,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%m',
    		max=12,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%w',
    		max=6,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='time',
    		arg='%U',
    		max=52,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='cpu',
    		arg='cpu0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=660, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu1',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu2',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='freq',
    		arg='',
    		max=1600,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=660, y=40,
    		radius=10,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=420, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=420, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='memperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=780, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='swapperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=780, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/Ubuntu',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=900, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/WinXP',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=900, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='wireless_link_qual_perc',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=540, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='upspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='downspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=300, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=300, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    }
    
    -- Use these settings to define the origin and extent of your clock.
    
    clock_r=100
    
    -- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
    
    clock_x=900
    clock_y=160
    
    show_seconds=true
    
    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 draw_ring(cr,t,pt)
    	local w,h=conky_window.width,conky_window.height
    	
    	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    
    	local angle_0=sa*(2*math.pi/360)-math.pi/2
    	local angle_f=ea*(2*math.pi/360)-math.pi/2
    	local t_arc=t*(angle_f-angle_0)
    
    	-- Draw background ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    	cairo_set_line_width(cr,ring_w)
    	cairo_stroke(cr)
    	
    	-- Draw indicator ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    	cairo_stroke(cr)		
    end
    
    function draw_clock_hands(cr,xc,yc)
    	local secs,mins,hours,secs_arc,mins_arc,hours_arc
    	local xh,yh,xm,ym,xs,ys
    	
    	secs=os.date("%S")	
    	mins=os.date("%M")
    	hours=os.date("%I")
    		
    	secs_arc=(2*math.pi/60)*secs
    	mins_arc=(2*math.pi/60)*mins+secs_arc/60
    	hours_arc=(2*math.pi/12)*hours+mins_arc/12
    		
    	-- Draw hour hand
    	
    	xh=xc+0.7*clock_r*math.sin(hours_arc)
    	yh=yc-0.7*clock_r*math.cos(hours_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xh,yh)
    	
    	cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    	cairo_set_line_width(cr,5)
    	cairo_set_source_rgba(cr,0.2,0.6,1,0.4)
    	cairo_stroke(cr)
    	
    	-- Draw minute hand
    	
    	xm=xc+clock_r*math.sin(mins_arc)
    	ym=yc-clock_r*math.cos(mins_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xm,ym)
    	
    	cairo_set_line_width(cr,3)
    	cairo_stroke(cr)
    	
    	-- Draw seconds hand
    	
    	if show_seconds then
    		xs=xc+clock_r*math.sin(secs_arc)
    		ys=yc-clock_r*math.cos(secs_arc)
    		cairo_move_to(cr,xc,yc)
    		cairo_line_to(cr,xs,ys)
    	
    		cairo_set_line_width(cr,1)
    		cairo_stroke(cr)
    	end
    end
    
    function conky_clock_rings()
    	local function setup_rings(cr,pt)
    		local str=''
    		local value=0
    		
    		str=string.format('${%s %s}',pt['name'],pt['arg'])
    		str=conky_parse(str)
    		
    		value=tonumber(str)
    		pct=value/pt['max']
    		
    		draw_ring(cr,pct,pt)
    	end
    	
    	-- Check that Conky has been running for at least 5s
    
    	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)	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then
    		for i in pairs(settings_table) do
    			setup_rings(cr,settings_table[i])
    		end
    	end
    	
    	draw_clock_hands(cr,clock_x,clock_y)
    end
    Grazie......
    Save the lua script to a file called clock.lua

    then in your conky configuration file, above TEXT, add a the following:

    Code:
    lua_load ~/path/to/clocks.lua
    remember to change the red portion to the correct path. That should be it.

    In the words of Aldo Raine.... "Bonjeeerrnoo"
    Registered Ubuntu User #29430

  5. #10545
    Join Date
    Sep 2008
    Location
    Italy Varese..
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Post your .conkyrc files w/ screenshots

    @dmillerct

    .conkyrc

    Code:
    ##############################################
    #  Settings  conkyForecast 2.0.9 By; Deegan  #
    ##############################################
    
    
    # — Conky settings — #
    background no
    update_interval 1
    
    cpu_avg_samples 2
    net_avg_samples 2
    
    override_utf8_locale yes
    
    double_buffer yes
    no_buffers yes
    
    text_buffer_size 2048
    imlib_cache_size 0
    
    # — Window specifications — #
    
    own_window yes
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    
    border_inner_margin 0
    border_outer_margin 0
    
    minimum_size 1000 250
    maximum_width 1000
    
    # - Text alignment - #
    
    #alignment tl
    #alignment top_left
    #alignment top_middle
    #alignment bottom_left
    #alignment bottom_right
    alignment top_right
    
    gap_x 15 # left-right
    gap_y 25  # up-down
    
    # — Graphics settings — #
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    
    # — Text settings — #
    use_xft yes
    xftfont Aller Display:size=24
    xftalpha 0.8
    
    uppercase no
    
    default_color A0A0A0
    
    # — Lua Load — #
    lua_load ~/conky/conkyrings3/clocks.lua
    
    
    ############################################## 
    #                 Output                     #
    ##############################################
    
    TEXT
    ${font Paintbrush:size=23}Jaunty \#! 9.04    ${font Paintbrush:size=26} \#!Deegan...
    /home/deegan/conky/conkyrings3/clocks.lua

    Code:
    --[[
    Clock Rings by londonali1010 (2009) Edited by jpope
    
    This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
    
    IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
    
    To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    	lua_load ~/scripts/clock_rings.lua
    	lua_draw_hook_pre clock_rings
    	
    Changelog:
    + v1.0 -- Original release (30.09.2009)
       v1.1p -- jpope edit (05.10.2009)
       v1.2p -- jpope edit (06.10.2009)
       v1.3p -- jpope edit (10.10.2009)
    ]]
    
    settings_table = {
    	{
    		-- Edit this table to customise your rings.
    		-- You can create more rings simply by adding more elements to settings_table.
    		-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    		name='time',
    		-- "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 ''.
    		arg='%I.%M',
    		-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    		max=12,
    		-- "bg_colour" is the colour of the base ring.
    		bg_colour=0x3399cc,
    		-- "bg_alpha" is the alpha value of the base ring.
    		bg_alpha=0.2,
    		-- "fg_colour" is the colour of the indicator part of the ring.
    		fg_colour=0x3399cc,
    		-- "fg_alpha" is the alpha value of the indicator part of the ring.
    		fg_alpha=0.2,
    		-- "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.
    		x=900, y=160,
    		-- "radius" is the radius of the ring.
    		radius=50,
    		-- "thickness" is the thickness of the ring, centred around the radius.
    		thickness=5,
    		-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    		start_angle=0,
    		-- "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 than start_angle.
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%M.%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=900, y=160,
    		radius=56,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=160,
    		radius=62,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%d',
    		max=31,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%m',
    		max=12,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%w',
    		max=6,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='time',
    		arg='%U',
    		max=52,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='cpu',
    		arg='cpu0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=660, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu1',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu2',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='freq',
    		arg='',
    		max=1600,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=660, y=40,
    		radius=10,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=420, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=420, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='memperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=780, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='swapperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=780, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/Ubuntu',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=900, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/WinXP',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=900, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='wireless_link_qual_perc',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=540, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='upspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='downspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=300, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=300, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    }
    
    -- Use these settings to define the origin and extent of your clock.
    
    clock_r=100
    
    -- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
    
    clock_x=900
    clock_y=160
    
    show_seconds=true
    
    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 draw_ring(cr,t,pt)
    	local w,h=conky_window.width,conky_window.height
    	
    	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    
    	local angle_0=sa*(2*math.pi/360)-math.pi/2
    	local angle_f=ea*(2*math.pi/360)-math.pi/2
    	local t_arc=t*(angle_f-angle_0)
    
    	-- Draw background ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    	cairo_set_line_width(cr,ring_w)
    	cairo_stroke(cr)
    	
    	-- Draw indicator ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    	cairo_stroke(cr)		
    end
    
    function draw_clock_hands(cr,xc,yc)
    	local secs,mins,hours,secs_arc,mins_arc,hours_arc
    	local xh,yh,xm,ym,xs,ys
    	
    	secs=os.date("%S")	
    	mins=os.date("%M")
    	hours=os.date("%I")
    		
    	secs_arc=(2*math.pi/60)*secs
    	mins_arc=(2*math.pi/60)*mins+secs_arc/60
    	hours_arc=(2*math.pi/12)*hours+mins_arc/12
    		
    	-- Draw hour hand
    	
    	xh=xc+0.7*clock_r*math.sin(hours_arc)
    	yh=yc-0.7*clock_r*math.cos(hours_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xh,yh)
    	
    	cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    	cairo_set_line_width(cr,5)
    	cairo_set_source_rgba(cr,0.2,0.6,1,0.4)
    	cairo_stroke(cr)
    	
    	-- Draw minute hand
    	
    	xm=xc+clock_r*math.sin(mins_arc)
    	ym=yc-clock_r*math.cos(mins_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xm,ym)
    	
    	cairo_set_line_width(cr,3)
    	cairo_stroke(cr)
    	
    	-- Draw seconds hand
    	
    	if show_seconds then
    		xs=xc+clock_r*math.sin(secs_arc)
    		ys=yc-clock_r*math.cos(secs_arc)
    		cairo_move_to(cr,xc,yc)
    		cairo_line_to(cr,xs,ys)
    	
    		cairo_set_line_width(cr,1)
    		cairo_stroke(cr)
    	end
    end
    
    function conky_clock_rings()
    	local function setup_rings(cr,pt)
    		local str=''
    		local value=0
    		
    		str=string.format('${%s %s}',pt['name'],pt['arg'])
    		str=conky_parse(str)
    		
    		value=tonumber(str)
    		pct=value/pt['max']
    		
    		draw_ring(cr,pct,pt)
    	end
    	
    	-- Check that Conky has been running for at least 5s
    
    	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)	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then
    		for i in pairs(settings_table) do
    			setup_rings(cr,settings_table[i])
    		end
    	end
    	
    	draw_clock_hands(cr,clock_x,clock_y)
    end
    But!!!!

    Code:
    deegan@deegan-jaunty:~$ conky -c .conkyrc3
    Conky: .conkyrc3: 19: no such configuration: 'imlib_cache_size'
    Conky: desktop window (1400035) is subwindow of root window (aa)
    Conky: window type - override
    Conky: drawing to created window (0x4400001)
    Conky: drawing to double buffer
    No image...


  6. #10546
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by searchOne View Post
    Hi all!

    I've got a little problem: I wanted to compile Conky 1.7.2 on my Mandriva 2009.1 64Bit system (I know this is a Ubuntu - forum!). But I always get this message

    Code:
    checking for LUA ... yes
    checking for cairo ... yes
    checking for cairo_xlib ... yes
    checking for tolua ++... tolua + +
    checking for library containing tolua_error ... no
    configure: error: not found tolua_error
    I've tried, but all "tolua" Libraries are installed. Has anyone else an idea?

    On my 64Bit #! CrunchBang system, I installed it without problems!
    Conky 1.7.2+ needs, NEEDS, NEEDS!!!, NEEDS!!! tolua++5.1 to compile not tolua++.
    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. #10547
    Join Date
    Jul 2008
    Location
    Connecticut, U.S.
    Beans
    106
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by degan View Post
    @dmillerct

    .conkyrc

    Code:
    ##############################################
    #  Settings  conkyForecast 2.0.9 By; Deegan  #
    ##############################################
    
    
    # — Conky settings — #
    background no
    update_interval 1
    
    cpu_avg_samples 2
    net_avg_samples 2
    
    override_utf8_locale yes
    
    double_buffer yes
    no_buffers yes
    
    text_buffer_size 2048
    imlib_cache_size 0
    
    # — Window specifications — #
    
    own_window yes
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    
    border_inner_margin 0
    border_outer_margin 0
    
    minimum_size 1000 250
    maximum_width 1000
    
    # - Text alignment - #
    
    #alignment tl
    #alignment top_left
    #alignment top_middle
    #alignment bottom_left
    #alignment bottom_right
    alignment top_right
    
    gap_x 15 # left-right
    gap_y 25  # up-down
    
    # — Graphics settings — #
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    
    # — Text settings — #
    use_xft yes
    xftfont Aller Display:size=24
    xftalpha 0.8
    
    uppercase no
    
    default_color A0A0A0
    
    # — Lua Load — #
    lua_load ~/conky/conkyrings3/clocks.lua
    
    
    ############################################## 
    #                 Output                     #
    ##############################################
    
    TEXT
    ${font Paintbrush:size=23}Jaunty \#! 9.04    ${font Paintbrush:size=26} \#!Deegan...
    /home/deegan/conky/conkyrings3/clocks.lua

    Code:
    --[[
    Clock Rings by londonali1010 (2009) Edited by jpope
    
    This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
    
    IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
    
    To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    	lua_load ~/scripts/clock_rings.lua
    	lua_draw_hook_pre clock_rings
    	
    Changelog:
    + v1.0 -- Original release (30.09.2009)
       v1.1p -- jpope edit (05.10.2009)
       v1.2p -- jpope edit (06.10.2009)
       v1.3p -- jpope edit (10.10.2009)
    ]]
    
    settings_table = {
    	{
    		-- Edit this table to customise your rings.
    		-- You can create more rings simply by adding more elements to settings_table.
    		-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    		name='time',
    		-- "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 ''.
    		arg='%I.%M',
    		-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    		max=12,
    		-- "bg_colour" is the colour of the base ring.
    		bg_colour=0x3399cc,
    		-- "bg_alpha" is the alpha value of the base ring.
    		bg_alpha=0.2,
    		-- "fg_colour" is the colour of the indicator part of the ring.
    		fg_colour=0x3399cc,
    		-- "fg_alpha" is the alpha value of the indicator part of the ring.
    		fg_alpha=0.2,
    		-- "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.
    		x=900, y=160,
    		-- "radius" is the radius of the ring.
    		radius=50,
    		-- "thickness" is the thickness of the ring, centred around the radius.
    		thickness=5,
    		-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    		start_angle=0,
    		-- "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 than start_angle.
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%M.%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=900, y=160,
    		radius=56,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%S',
    		max=60,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=160,
    		radius=62,
    		thickness=5,
    		start_angle=0,
    		end_angle=360
    	},
    	{
    		name='time',
    		arg='%d',
    		max=31,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%m',
    		max=12,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=-90,
    		end_angle=89
    	},
    	{
    		name='time',
    		arg='%w',
    		max=6,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.8,
    		x=900, y=160,
    		radius=70,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='time',
    		arg='%U',
    		max=52,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=1,
    		x=900, y=160,
    		radius=76,
    		thickness=5,
    		start_angle=90,
    		end_angle=269
    	},
    	{
    		name='cpu',
    		arg='cpu0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=660, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu1',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='cpu',
    		arg='cpu2',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=660, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='freq',
    		arg='',
    		max=1600,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=660, y=40,
    		radius=10,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=420, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='battery_percent',
    		arg='BAT0',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=420, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='memperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=780, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='swapperc',
    		arg='',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.4,
    		x=780, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=900, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/Ubuntu',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=900, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    	{
    		name='fs_used_perc',
    		arg='/mnt/WinXP',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.2,
    		x=900, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='wireless_link_qual_perc',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=540, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='upspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=15,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='downspeedf',
    		arg='wlan0',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=540, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=100,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.6,
    		x=300, y=40,
    		radius=25,
    		thickness=5,
    		start_angle=-90,
    		end_angle=180
    	},
    		{
    		name='weather',
    		arg='http://xoap.weather.com/weather/local/ 65101 temperature 30',
    		max=200,
    		bg_colour=0x3399cc,
    		bg_alpha=0.2,
    		fg_colour=0x3399cc,
    		fg_alpha=0.3,
    		x=300, y=40,
    		radius=20,
    		thickness=4,
    		start_angle=-90,
    		end_angle=180
    	},
    }
    
    -- Use these settings to define the origin and extent of your clock.
    
    clock_r=100
    
    -- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
    
    clock_x=900
    clock_y=160
    
    show_seconds=true
    
    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 draw_ring(cr,t,pt)
    	local w,h=conky_window.width,conky_window.height
    	
    	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    
    	local angle_0=sa*(2*math.pi/360)-math.pi/2
    	local angle_f=ea*(2*math.pi/360)-math.pi/2
    	local t_arc=t*(angle_f-angle_0)
    
    	-- Draw background ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    	cairo_set_line_width(cr,ring_w)
    	cairo_stroke(cr)
    	
    	-- Draw indicator ring
    
    	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    	cairo_stroke(cr)		
    end
    
    function draw_clock_hands(cr,xc,yc)
    	local secs,mins,hours,secs_arc,mins_arc,hours_arc
    	local xh,yh,xm,ym,xs,ys
    	
    	secs=os.date("%S")	
    	mins=os.date("%M")
    	hours=os.date("%I")
    		
    	secs_arc=(2*math.pi/60)*secs
    	mins_arc=(2*math.pi/60)*mins+secs_arc/60
    	hours_arc=(2*math.pi/12)*hours+mins_arc/12
    		
    	-- Draw hour hand
    	
    	xh=xc+0.7*clock_r*math.sin(hours_arc)
    	yh=yc-0.7*clock_r*math.cos(hours_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xh,yh)
    	
    	cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    	cairo_set_line_width(cr,5)
    	cairo_set_source_rgba(cr,0.2,0.6,1,0.4)
    	cairo_stroke(cr)
    	
    	-- Draw minute hand
    	
    	xm=xc+clock_r*math.sin(mins_arc)
    	ym=yc-clock_r*math.cos(mins_arc)
    	cairo_move_to(cr,xc,yc)
    	cairo_line_to(cr,xm,ym)
    	
    	cairo_set_line_width(cr,3)
    	cairo_stroke(cr)
    	
    	-- Draw seconds hand
    	
    	if show_seconds then
    		xs=xc+clock_r*math.sin(secs_arc)
    		ys=yc-clock_r*math.cos(secs_arc)
    		cairo_move_to(cr,xc,yc)
    		cairo_line_to(cr,xs,ys)
    	
    		cairo_set_line_width(cr,1)
    		cairo_stroke(cr)
    	end
    end
    
    function conky_clock_rings()
    	local function setup_rings(cr,pt)
    		local str=''
    		local value=0
    		
    		str=string.format('${%s %s}',pt['name'],pt['arg'])
    		str=conky_parse(str)
    		
    		value=tonumber(str)
    		pct=value/pt['max']
    		
    		draw_ring(cr,pct,pt)
    	end
    	
    	-- Check that Conky has been running for at least 5s
    
    	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)	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then
    		for i in pairs(settings_table) do
    			setup_rings(cr,settings_table[i])
    		end
    	end
    	
    	draw_clock_hands(cr,clock_x,clock_y)
    end
    But!!!!

    Code:
    deegan@deegan-jaunty:~$ conky -c .conkyrc3
    Conky: .conkyrc3: 19: no such configuration: 'imlib_cache_size'
    Conky: desktop window (1400035) is subwindow of root window (aa)
    Conky: window type - override
    Conky: drawing to created window (0x4400001)
    Conky: drawing to double buffer
    No image...

    Try replacing what is above TEXT in your configuration with this:

    Code:
    # -- Conky settings -- #
    background no
    update_interval 1
    cpu_avg_samples 2
    net_avg_samples 2
    override_utf8_locale yes
    double_buffer yes
    no_buffers yes
    text_buffer_size 2048
    imlib_cache_size 0
    # -- Window specifications -- #
    own_window yes
    own_window_type desktop
    own_window_transparent yes
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    border_inner_margin 0
    border_outer_margin 0
    minimum_size 1020 600
    maximum_width 1000
    alignment tl
    gap_x 10
    gap_y 0
    # -- Graphics settings -- #
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    # -- Text settings -- #
    use_xft yes
    xftfont Santana:size=8
    xftalpha 0.8
    uppercase no
    # -- Colors --#
    color1 White
    color2 Yellow
    color3 Red
    default_color White
    # -- Lua Load -- #
    lua_load ~/conky/conkyrings3/clocks.lua
    TEXT
    Registered Ubuntu User #29430

  8. #10548
    Join Date
    Sep 2008
    Location
    Italy Varese..
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Post your .conkyrc files w/ screenshots

    no!!!!

    Look..


  9. #10549
    Join Date
    Jul 2008
    Location
    Connecticut, U.S.
    Beans
    106
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by degan View Post
    no!!!!

    Look..

    i see you are on Karmic so you probably have the correct build from the repos but just to be sure go ahead and type conky -v in a terminal and post the output.

    Also when you try to execute your conky is terminal reporting any errors? if so can you post those here as well?

    Thanks.
    Registered Ubuntu User #29430

  10. #10550
    Join Date
    Jul 2009
    Location
    Germany > Hessen > DA
    Beans
    26

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by dk75 View Post
    Conky 1.7.2+ needs, NEEDS, NEEDS!!!, NEEDS!!! tolua++5.1 to compile not tolua++.
    Hi dk75,
    what loss? Must you shout so?
    The issue is of Conky, I do not even realized that I needed to tolua + +5.1.

    The real problem with Mandriva Linux is a completely different as I have now experienced. Namely there is the off lua support. So is also the compile Conky wrong. I have now opened a bug report and I am in contact with the developers, sometimes what you see say!

    No more scream!
    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

Page 1055 of 2348 FirstFirst ... 55555955100510451053105410551056105710651105115515552055 ... 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
  •