I'm using the londonali1010 code. It does exactly what I want/need. Well... sort of.
I was having a problem with the Conky table scrolling off the screen, e.g. an alignment problem.
Initially, I could only get rounded corners on the top, or the bottom, but not on the top & bottom, at the same time.
After hours of farting around with the londonali1010 code, I realized all I had to do is subtract 100 pixels from conky_window.height
That's my sole contribution, so far... LoL!Code:--[[ Background by londonali1010 (2009) This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish. To call this script in Conky, use (assuming you have saved this script to ~/scripts/): lua_load ~/scripts/draw_bg.lua lua_draw_hook_pre draw_bg Changelog: + v1.0 -- Original release (07.10.2009) ]] -- 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=30 -- Set the colour and transparency (alpha) of your background. bg_colour=0x2a2a2a bg_alpha=0.40 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 -100 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
It allowed me to 'raise' the lower frame, on the table, and display rounded corners on both top & bottom.
Agreed!
I prefer the second example, as well.
Last edited by VinDSL; December 19th, 2010 at 09:57 PM. Reason: ADDED SCREENIE
Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU
Greetings All! I know, the new thing is semi-transparent backgrounds using lua. I'm a bit behind there. I tried a semi-transparent png background and didn't like how it looked, so didn't bother.
HOWEVER! I have been playing with LUA rings and converting parts of my Conky over to it. Still same old problem with that total bandwidth usage ring, so there's currently a gap in my display. It's intentional until I can figure out how to not cause such a massive system hiccup when I run that particular script.
Now, thanks to Mr.Peachy's ring script he gave me, I've done some manipulating to get some rings going. MUCH work in progress.
.conkyrc.main
The reason you don't see a ring for "Swap" is because SWAP fills in the center of the ring, and I'm using none right now, nor do I seem to be able to MAKE it use the SWAP right now. So you don't see it. Extra note! If you want a lua ring fill up like a pie chart/pac man type thing, set the thickness of the ring to exactly twice it's radius. Seems to work every time.Code:#-----Run in Background background yes #-----Use XFT for Fonts use_xft yes xftfont DiamondFantasy:size=16 xftalpha 0.5 #-----How often to run, in seconds update_interval 1.0 #-----Window Controls, Has it's own, Normal, Transparent Window... own_window yes own_window_type normal own_window_transparent yes #-----...Undecorated, Sticky Window without putting it in the Taskbar or Pager, all Below everything else. own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager #-----Text Buffer, how big a script can be when called. text_buffer_size 2048 #-----Window Size and Width minimum_size 350 50 maximum_width 600 #-----Stops the Blinking! double_buffer yes #-----Don't draw any shadows, shades, or outlines for the window or text. draw_shades no draw_outline no draw_borders no #-----DO draw borders around the graphs draw_graph_borders yes #-----Put the whole thing, top right. alignment top_right #-----Gap of 40 pixels between the Conky, and the edge of the screen, No gap at the top or bottom. gap_x 50 gap_y 0 #-----Disables file system buffers from used memory no_buffers yes #-----How many samples to average for measuring CPU activity. cpu_avg_samples 2 #---Dunno exactly, required for Weather section to work properly. override_utf8_locale yes #-----Helps keep certain things aligned. use_spacer right #-----Lua Script for System Rings. lua_load /home/dorian/Conky/Scripts/ringtest.lua lua_draw_hook_pre draw_ring #-----Code shortcut for colours. default_color 808080 #Grey color0 FF0000 #Red color1 FFFF00 #Yellow color2 FFFFFF #White color3 808080 #Grey color4 00FF00 #Green color5 C0C0C0 #Silver color6 FFD700 #Gold TEXT#-----System Header, Conky Version(Only When Needed), and Xubuntu Graphic ${font}${color1}Xubuntu 10.10 (Maverick Meerkat) $sysname $kernel on $machine ${color2}Uptime:${goto 100}$uptime #${conky_version} ${image /home/dorian/Conky/Icons/XubuntuLogoForConky.png -p 250,0 -s 80x80} ${color2}WEATHER: ${execi 3600 conkyForecast -l CAXX0342 -d CN}${color0}${hr 1}${color2} Now${goto 75}${execi 3600 conkyForecast -l CAXX0342 -d DW -w -s 1}${goto 135}${execi 3600 conkyForecast -l CAXX0342 -d DW -w -s 2}${goto 195}${execi 3600 conkyForecast -l CAXX0342 -d DW -w -s 3}${goto 255}Tomorrow: #-----High Temp:/Sunrise Title H:${execi 3600 conkyForecast -l CAXX0342 -d HT -u -x}${font TransponderAOE}°${font}C${goto 75}${execi 3600 conkyForecast -l CAXX0342 -d HT -u -x -s 2}${font TransponderAOE}°${font}C${goto 135}${execi 3600 conkyForecast -l CAXX0342 -d HT -u -x -s 3}${font TransponderAOE}°${font}C${goto 195}${execi 3600 conkyForecast -l CAXX0342 -d HT -u -x -s 4}${font TransponderAOE}°${font}C${goto 255}${goto 255}Sunrise: #-----Low Temp:/Sunrise ${voffset -15}L:${execi 3600 conkyForecast -l CAXX0342 -d LT -u -x}${font TransponderAOE}°${font}C${goto 75}${execi 3600 conkyForecast -l CAXX0342 -d LT -u -x -s 2}${font TransponderAOE}°${font}C${goto 135}${execi 3600 conkyForecast -l CAXX0342 -d LT -u -x -s 3}${font TransponderAOE}°${font}C${goto 195}${execi 3600 conkyForecast -l CAXX0342 -d LT -u -x -s 4}${font TransponderAOE}°${font}C${goto 255}${execi 3600 conkyForecast -l CAXX0342 -d SR -s 2} #-----Weather Conditions:/Sunset ${color1}${font conkyWeather:size=30}${execi 3600 conkyForecast -l CAXX0342 -d WF}${goto 75}${execi 3600 conkyForecast -l CAXX0342 -d WF -s 2}${goto 135}${execi 3600 conkyForecast -l CAXX0342 -d WF -s 3}${goto 195}${execi 3600 conkyForecast -l CAXX0342 -d WF -s 4}${color2}${font}${voffset -25}${goto 255}Sunset: ${goto 255}${execi 3600 conkyForecast -l CAXX0342 -d SS -s 2} #-----Moon Phase Title ${goto 255}Moon ${goto 255}Phase: #-----Wind Direction:/Moon Font ${font ConkyWindNESW:size=40}${voffset -25}${execi 3600 conkyForecast -l CAXX0342 -d BF}${goto 75}${execi 3600 conkyForecast -l CAXX0342 -d BF -s 2}${goto 135}${execi 3600 conkyForecast -l CAXX0342 -d BF -s 3}${goto 195}${execi 3600 conkyForecast -l CAXX0342 -d BF -s 4}${goto 310}${font MoonPhases:size=30}${execi 3600 conkyForecast -l CAXX0342 -d MF}${font} #-----Wind Speed(With spacing edit by VinDSL):/Moon Phase ${execi 3600 conkyForecast -l CAXX0342 -d WS | sed -e 's/calm'/' Calm/g' -e 's/kph'/' kph/g'}${goto 75}${execi 3600 conkyForecast -l CAXX0342 -d WS -s 2 | sed -e 's/calm'/' Calm/g' -e 's/kph'/' kph/g'}${goto 135}${execi 3600 conkyForecast -l CAXX0342 -d WS -s 3 | sed -e 's/calm'/' Calm/g' -e 's/kph'/' kph/g'}${goto 195}${execi 3600 conkyForecast -l CAXX0342 -d WS -s 4 | sed -e 's/calm'/' Calm/g' -e 's/kph'/' kph/g'}${goto 255}${execi 3600 conkyForecast -l CAXX0342 -d MP} #-----System/Drive Info ${voffset 5}${font}${color2}SYSTEM ${color0}${hr 1}${color2} CPU1:${goto 55}${freq_g 1}Ghz${goto 120}${color1}R:${cpu cpu1}%${goto 175}Used ${color2}CPU2:${goto 55}${freq_g 2}Ghz${goto 120}${color1}L:${cpu cpu2}%${goto 175}Used ${color2}RAM:${goto 55}${memmax}${goto 120}${color5}C:${memperc}%${goto 175}Used${color2} ${color2}SWAP:${goto 55}${swapmax}${goto 120}${color5}M:${swapperc}%${goto 175}Used${color2} #-----Main Drives ${color2}SYSTEM DRIVES ${color0}${hr 1}${color2} ${color2}Root:${goto 50}${fs_size /}${goto 110}${fs_used_perc /}%${goto 150}Used${goto 190}${color0}${fs_bar 5,120 /} ${color2}Home:${goto 50}${fs_size /home}${goto 110}${fs_used_perc /home}%${goto 150}Used${goto 190}${color1}${fs_bar 5,120 /home} ${color2}Test1:${goto 50}${fs_size /media/Test1}${goto 110}${fs_used_perc /media/Test1}%${goto 150}Used${goto 190}${color5}${fs_bar 5,120 /media/Test1} ${color2}Test2:${goto 50}${fs_size /media/Test2}${goto 110}${fs_used_perc /media/Test2}%${goto 150}Used${goto 190}${color5}${fs_bar 5,120 /media/Test2} ${color2}${if_mounted /media/120}120:${goto 50}${fs_size /media/120}${goto 110}${fs_used_perc /media/120}%${goto 150}Used${goto 190}${color5}${fs_bar 5,120 /media/120}${else}120:${goto 50}Not Connected${endif} #-----USB Drives (Special because it checks to see if they're plugged in first.) ${color2}CONNECTED DRIVES ${color0}${hr 1}${color2} ${if_mounted /media/7GBACKUP}${color2}${fs_used_perc /media/7GBACKUP}%${goto 40}7GBACKUP:${goto 130}${fs_size /media/7GBACKUP}${else}${color2}7GBACKUP: N/A${endif}${if_mounted /media/7GBACKUP2}${goto 210}${fs_used_perc /media/7GBACKUP2}%${goto 230}${color2}7GBACKUP2:${goto 330}${fs_size /media/7GBACKUP2}${else}${goto 210}${color2}7GBACKUP2: N/A${endif} ${if_mounted /media/7GBACKUP3}${voffset 18}${color2}${fs_used_perc /media/7GBACKUP3}%${goto 40}7GBACKUP3:${goto 130}${fs_size /media/7GBACKUP3}${else}${voffset 18}${color2}7GBACKUP3: N/A${endif} #-----Network Info ${color2}NETWORK ${color0}${hr 1}${color2} ${color2}Hostname${goto 95}$nodename${goto 145}|${goto 165}Inbound${goto 235}|${goto 245}Outbound INet: ${addr eth1}${goto 145}|${goto 165}${color4}${downspeed eth1}${goto 220}/s${goto 235}${color2}|${goto 245}${color1}${upspeed eth1}${goto 305}/s${image ~/Conky/Icons/Globe.png -p 330,625 -s 20x20} ${color2}Private ${addr eth0}${goto 145}|${goto 165}${color4}${downspeed eth0}${goto 220}/s${goto 235}${color2}|${goto 245}${color1}${upspeed eth0}${goto 305}/s${image ~/Conky/Icons/Private.png -p 330,665 -s 20x20} ${color2}Bluetooth ${addr pan1}${goto 145}|${goto 165}${color4}${downspeed pan1}${goto 220}/s${goto 235}${color2}|${goto 245}${color1}${upspeed pan1}${goto 305}/s${image ~/Conky/Icons/bluetooth.png -p 330,700 -s 20x20} #-----Calendar by VinDSL ${voffset 105}${color2}CALENDAR:${goto 100}${execpi 60 date +'%B${offset 6}%Y'}${color0}${hr 1}${color2} ${voffset 1}${font TransponderAOE:bold:size=15}${execpi 60 cal | sed '1d' | sed s/^/"\$\{offset 37"\}/ | sed '/^ *$/d' | sed 's/\<'"$(date +%-d)"'\>/${color1}&${color2}/'}
.conkyrc.clock (Not to be shown, just the code.)
.conkyrc.network (This one is currently on hold due to crashing.)Code:#-----Run in Background background yes #-----Use XFT for Fonts use_xft yes xftfont TransponderAOE:size=32 xftalpha 0.5 #-----How often to run, in seconds update_interval 1.0 #-----Window Controls, Has it's own, Normal, Transparent Window... own_window yes own_window_type normal own_window_transparent yes #-----...Undecorated, Sticky Window without putting it in the Taskbar or Pager, all Below everything else. own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager #-----Text Buffer, how big a script can be when called. text_buffer_size 2048 #-----Window Size and Width minimum_size 350 10 maximum_width 400 #-----Stops the Blinking! double_buffer yes #-----Don't draw any shadows, shades, or outlines for the window or text. draw_shades no draw_outline no draw_borders no #-----DO draw borders around the graphs draw_graph_borders yes #-----Put the whole thing, top right. alignment top_right #-----Gap of 40 pixels between the Conky, and the edge of the screen, No gap at the top or bottom. gap_x 450 gap_y 110 #-----Disables file system buffers from used memory no_buffers yes #-----How many samples to average for measuring CPU activity. cpu_avg_samples 2 #---Dunno exactly, required for Weather section to work properly. override_utf8_locale yes #-----Helps keep certain things aligned. use_spacer right #-----Code shortcut for colours. default_color 000000 #Grey color0 FF0000 #Red color1 FFFF00 #Yellow color2 FFFFFF #White color3 808080 #Grey color4 00FF00 #Green color5 C0C0C0 #Silver color6 FFD700 #Gold TEXT #-----This Entire Conky Script Is For a Clock. Yes. I Have Wasted an Entire Conky for this drivel. ${font DiamondFantasy:size=16}${color6}${hr 2}${goto 150}${color2}Time ${color6}${hr 2}${color2} #-----This is how to do a proper shadow hilight. ${font TransponderAOE:size=60}${color1}${offset -13}${time %l:%M:%S %p} ${voffset -100}${font TransponderAOE:size=60}${color2}${offset -15}${time %l:%M:%S %p} ${voffset -50}${color6}${hr 2}
Now the lua scripts.Code:#-----Run in Background background yes #-----Use XFT for Fonts use_xft yes xftfont DiamondFantasy:size=16 xftalpha 1.0 #-----How often to run, in seconds update_interval 5.0 #-----Window Controls, Has it's own, Normal, Transparent Window... own_window yes own_window_type normal own_window_transparent yes #-----...Undecorated, Sticky Window without putting it in the Taskbar or Pager, all Below everything else. own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager #-----Text Buffer, how big a script can be when called. text_buffer_size 2048 #-----Window Size and Width minimum_size 350 0 maximum_width 600 #-----Gap of 50 pixels between the Conky, and the edge of the screen, Enough gap at the top or bottom to put this script in the right spot. gap_x 65 gap_y 200 #-----Put the whole thing, bottom right. alignment bottom_right #-----Stops the Blinking! double_buffer yes #-----Don't draw any shadows, shades, or outlines for the window or text. draw_shades no draw_outline no draw_borders no #-----DO draw borders around the graphs draw_graph_borders yes #-----Disables file system buffers from used memory no_buffers yes #-----How many samples to average for measuring CPU activity. cpu_avg_samples 2 #---Dunno exactly, required for Weather section to work properly. override_utf8_locale yes #-----Helps keep certain things aligned. use_spacer right #-----Lua Script To Load(When It's Ready, Currently In Development) lua_load /home/dorian/Conky/Scripts/BandwidthTotal.lua lua_draw_hook_pre conky_draw_vnring #-----Code shortcut for colours. default_color 808080 #Grey color0 FF0000 #Red color1 FFFF00 #Yellow color2 FFFFFF #White color3 808080 #Grey color4 00FF00 #Green color5 C0C0C0 #Silver color6 FFD700 #Gold TEXT #-----Monthly/Daily Bandwidth Usage ${color2}NETWORK DATA USE${color0}${hr 1}${color2} ${goto 25}${color2}Today${goto 125}Monthly ${color2}U:${goto 25}${color1}${execi 60 vnstat | grep "today" | awk '{print $5}'}${goto 75}${execi 60 vnstat | grep "today" | awk '{print $6}'}${goto 125}${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $6}'}${goto 175}${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $7}'}${goto 265}${color2}25 ${color2}D:${goto 25}${color4}${execi 60 vnstat | grep "today" | awk '{print $2}'}${goto 75}${execi 60 vnstat | grep "today" | awk '{print $3}'}${goto 125}${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $3}'}${goto 175}${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $4}'}${goto 265}${color2}GB ${color2}T:${goto 25}${color5}${execi 60 vnstat | grep "today" | awk '{print $8}'}${goto 75}${execi 60 vnstat | grep "today" | awk '{print $9}'}${goto 125}${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $9}'}${goto 175}${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $10}'}${goto 220}${color2}Total Allowance${font}
ringtest.lua (New rings in the main body.)
And the "Broken" code, which I'm convinced is working properly, but there is something hinky about calling vnstat so often.Code:--Insert into Conky when Ready: --lua_load /home/dorian/Conky/Scripts/ringtest.lua --lua_draw_hook_pre draw_ring require 'cairo' function draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) local angle_0=rstart*(2*math.pi/360)-math.pi/2 local angle_f=rend*(2*math.pi/360)-math.pi/2 local t_arc=(co/100)*(angle_f-angle_0) -- Draw background ring cairo_arc(cr,across,down,rad,angle_0,angle_f) cairo_set_source_rgba(cr,bgr,bgg,bgb,bga) cairo_set_line_width(cr,inlw) cairo_stroke(cr) -- Draw indicator ring cairo_arc(cr,across,down,rad,angle_0,angle_0+t_arc) cairo_set_source_rgba(cr,inr,ing,inb,ina) cairo_stroke(cr) end function conky_draw_ring() if conky_window == nil then return end local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) cr = cairo_create(cs) local updates=tonumber(conky_parse('${updates}')) if updates>=2 then --RING 1 SETUP:CPU Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${cpu cpu1}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=275 down=345 --radius of ring----------------------- rad=40 --ring width--------------------------- inlw=10 --start and end angles--------------- rstart=0 rend=180 --color and alpha for indicator---- inr,ing,inb,ina=255,0,0,1 --background ring color and alpha----- bgr,bgg,bgb,bga=255,255,0,1 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 1 SETUP---------------copy setup section and paste for additional rings---------- --RING 2 SETUP:CPU2 Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${cpu cpu2}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=275 down=345 --radius of ring----------------------- rad=40 --ring width--------------------------- inlw=10 --start and end angles--------------- rstart=180 rend=360 --color and alpha for indicator---- inr,ing,inb,ina=255,0,0,1 --background ring color and alpha----- bgr,bgg,bgb,bga=255,255,0,1 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 2 SETUP---------------copy setup section and paste for additional rings---------- --RING 3 SETUP:RAM Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${memperc}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=275 down=345 --radius of ring----------------------- rad=25 --ring width--------------------------- inlw=10 --start and end angles--------------- rstart=-180 rend=180 --color and alpha for indicator---- inr,ing,inb,ina=128,128,128,0.75 --background ring color and alpha----- bgr,bgg,bgb,bga=128,128,128,0.5 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 3 SETUP---------------copy setup section and paste for additional rings---------- --RING 4 SETUP:SWAP Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${swapperc}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=275 down=345 --radius of ring----------------------- rad=8 --ring width--------------------------- inlw=16 --start and end angles--------------- rstart=-180 rend=180 --color and alpha for indicator---- inr,ing,inb,ina=128,128,128,0.75 --background ring color and alpha----- bgr,bgg,bgb,bga=128,128,128,0 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 4 SETUP---------------copy setup section and paste for additional rings---------- --RING 5 SETUP:7GBACKUP DRIVE Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${fs_used_perc /media/7GBACKUP}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=200 down=545 --radius of ring----------------------- rad=25 --ring width--------------------------- inlw=16 --start and end angles--------------- rstart=-90 rend=0 --color and alpha for indicator---- inr,ing,inb,ina=255,0,0,0.75 --background ring color and alpha----- bgr,bgg,bgb,bga=0,0,0,0 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 5 SETUP---------------copy setup section and paste for additional rings---------- --RING 6 SETUP:7GBACKUP2 DRIVE Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${fs_used_perc /media/7GBACKUP2}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=200 down=545 --radius of ring----------------------- rad=25 --ring width--------------------------- inlw=16 --start and end angles--------------- rstart=0 rend=90 --color and alpha for indicator---- inr,ing,inb,ina=255,0,0,0.75 --background ring color and alpha----- bgr,bgg,bgb,bga=0,0,0,0 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 6 SETUP---------------copy setup section and paste for additional rings---------- --RING 7 SETUP:7GBACKUP DRIVE Ring----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 30)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${fs_used_perc /media/7GBACKUP3}')) end if co==nil then co=0 end --max number-------------------------- max=100 --position----------------------------- across=200 down=545 --radius of ring----------------------- rad=25 --ring width--------------------------- inlw=16 --start and end angles--------------- rstart=180 rend=270 --color and alpha for indicator---- inr,ing,inb,ina=255,0,0,0.75 --background ring color and alpha----- bgr,bgg,bgb,bga=0,0,0,0 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 7 SETUP---------------copy setup section and paste for additional rings---------- end end
BandwidthTotal.lua
Yes. I have multiple lua scripts. I also have multiple .conkyrc files. Still only one script per file.Code:--Insert into Conky when Ready: --lua_load /home/dorian/Conky/Scripts/BandwidthTotal.lua --lua_draw_hook_pre draw_vnring require 'cairo' function draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) local angle_0=rstart*(2*math.pi/360)-math.pi/2 local angle_f=rend*(2*math.pi/360)-math.pi/2 local t_arc=(co/100)*(angle_f-angle_0) -- Draw background ring cairo_arc(cr,across,down,rad,angle_0,angle_f) cairo_set_source_rgba(cr,bgr,bgg,bgb,bga) cairo_set_line_width(cr,inlw) cairo_stroke(cr) -- Draw indicator ring cairo_arc(cr,across,down,rad,angle_0,angle_0+t_arc) cairo_set_source_rgba(cr,inr,ing,inb,ina) cairo_stroke(cr) end function conky_draw_vnring() if conky_window == nil then return end local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) cr = cairo_create(cs) local updates=tonumber(conky_parse('${updates}')) if updates>=2 then --RING 1 SETUP----------------------------------------------------------------------------- --conky object to be displayed----- wtimer=(updates % 60)+1 if updates>=6 or wtimer>=1 then co=tonumber(conky_parse('${exec vnstat -m | grep "`date +"%b \'%y"\`\" | awk \'{print $9}\'}')) units=tostring(conky_parse('${exec vnstat -m | grep "`date +"%b \'%y"`" | awk \'{print $10}\'}')) end if co==nil then co=0 end --max number-------------------------- if units=="GiB" then max=25 end if units =="MiB" then max=25600 end if units =="KiB" then max=26214400 end if max==nil then max=0 end --position----------------------------- across=275 down=55 --radius of ring----------------------- rad=25 --ring width--------------------------- inlw=15 --start and end angles--------------- rstart=-135 rend=135 --color and alpha for indicator---- inr,ing,inb,ina=255,0,0,1 --background ring color and alpha----- bgr,bgg,bgb,bga=255,255,0,1 --calculation, do not edit below--------- co=(co/max)*100 draw_ring(co, across, down, rad, inlw, rstart, rend, bgr, bgg, bgb, bga, inr, ing, inb, ina) --END RING 1 SETUP---------------copy setup section and paste for additional rings---------- end end
And of course: The new screen shot (Just the main this time. The rest hasn't changed at all.)
And to VinDSL, I hope you're not offended that I took the vanity string out and just gave you credit in the comments for the calendar.
Crinos512 and Timo(?) co-developed a semi-transparent font just before conky came out with lua and argb support.
Have any of you Cconkystadors using gnome or another DE with compositing gotten the conky argb visuals to work? Seems like everyone went the lua or image route.
Last edited by ddnev45; December 20th, 2010 at 01:57 AM.
The mark of an honest man ... is that he means what he says and knows what he means.
A.R.
Bookmarks