Re: The New Monster Conky Thread

Hello, I'm setting up my conky and I'm having a bit of trouble.1. As you can see in my picture, I used the transparent background option in the Conky config, but it leaves this transparent box where the window used to be. I tried turning the window itself off, but when I do, it makes every window on the screen disappear at every update to conky, making the computer almost unusable. Is there any way to turn off this window without screwing up my computer?

2. In conky (found here http://pastebin.com/juP59wbg) I have {downspeed wlan0} and {upspeed wlan0} so I can see what my current down/up speed rate is. On the conky itself, the text fluctuates between 2-5 characters, and when it does, the entire auto centers and the whole line of text moves. Its kind of hard to explain, but basically the entire line of text grows and expands every time conky updates, and it's really annoying to look at. Is there any way I can have the {downspeed wlan0} and {upspeed wlan0} update continuously without moving the other text?

Wow! I am more than impressed with the amount of effort you've put in to this! I am in disbelief that someone could be this helpful lol! I actually ended up removing both features simply because I didn't want to mess around with them (pic related), but if you want to post a Howto, I will be more than happy to read, learn, and use. Thank you very much for your help Sector11.

Re: The New Monster Conky Thread

how do you realize the buttons that show the title? the glossy buttons? could you please share the could you are using!

I am using Peachy bargraph.lua and drawing a 3 step gradient to accomplish the glass effect.Here is bargraph.lua..

--easy compound shape drawing with gradients by mrpeachy 8/13/12
require 'cairo'
function conky_main_bars()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--[[subtab={} instructions #############################################################################
each step of the drawn shape must be in a sub table
first entry must be d="start", set x and y of start point of shape
other entried can be these types
d="line" , draws a line to set coordinates,x and y
d="rline" , draws a relative line starting at the last set point of the shape, x and y values are relative to this point
d="arc_c" , draws an clockwise arc for the set amount of degrees starting at the last set point of the shape
d="arc_a" , draws an anticlockwise arc for the set amount of degrees starting at the last set point of the shape
for arc_c and arc_a you need to set a circle quandrant where the arc will start
q=1 is the top right quarter of the circle
q=2 is the bottom right quarter
q=3 is bottom left quarter
q=4 is the top left quarter
r is the radius of the circle
degs is the number of degrees to be drawn
EG:
subtab={--start of sub path table
{d="start",x=100,y=100},
{d="rline",x=150,y=0},
{d="arc_c",q=1,r=50,degs=90},
{d="rline",x=0,y=25},
{d="rline",x=-50,y=0},
{d="rline",x=0,y=-10},
{d="arc_a",q=1,r=15,degs=90},
{d="line",x=100,y=150},
}--end of sub path table
--NOTE setting up subtab by ityself does not draw anything, subtab is then sent to the function grec in the table below
--grec settings ######################################################################################
g=1 --1=vertical, 2 = horizontal, 5=angled, 0=no gradient fill in color 1, 3=outline only in color1, 4=fill col1, outline col2 (default = 1)
x=100 --default =0
y=100 --default =0
w=50 --default =50
h=100 --default =50
grad={} --set colors, alphas and gradient positions in seperate tables within a containing table. subtables must be seperated by commas
--subtables contain -- {c=color,a=alpha,p=position} for position, in a vertical gradient 0 is the top, 1 is the bottom, 0.5 is half way etc -- no defaults
gan=45 --angle of gradient for g=5
lw=1 --line width for g=3 or g=4
sub=1 --draw sub path shape, 1=draw, 0=don't draw (default is 0)
db=1 --draw boundary, 1 for draw, 0 no draw (default is 0) - this can help in getting your shape positioned within the gradient rectangle correctly
subtab=subtab --you could enter the contents of subtab directly in here but for ease of use i have set up subtab above
EG:
grec({g=2,x=100,y=100,w=200,h=80,grad={{c=0xffff00,a=1,p=0},{c=0xff0000,a=1,p=0.5}},sub=1,db=0,subtab=subtab})
--#########################################################################################################--]]
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end--end main function
function grec(gtab)--#################################################################################
local function color(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local function pt(px,py,prad,pdeg)
local ppo=(math.pi/180)*pdeg
local px1=px+prad*(math.sin(ppo))
local py1=py-prad*(math.cos(ppo))
return px1,py1
end
local function sub_draw(sdtab)
cdsx={}
cdsy={}
dr={}
limit=#sdtab
for i=1,limit do
local d=sdtab[i].d
if d=="start" then
table.insert(dr,"cairo_move_to(cr,"..tostring(sdtab[i].x)..","..tostring(sdtab[i].y)..");")
table.insert(cdsx,sdtab[i].x)
table.insert(cdsy,sdtab[i].y)
end
if d=="line" then
table.insert(dr,"cairo_line_to(cr,"..tostring(sdtab[i].x)..","..tostring(sdtab[i].y)..");")
table.insert(cdsx,sdtab[i].x)
table.insert(cdsy,sdtab[i].y)
end
if d=="rline" then
table.insert(dr,"cairo_rel_line_to(cr,"..tostring(sdtab[i].x)..","..tostring(sdtab[i].y)..");")
table.insert(cdsx,cdsx[i-1]+sdtab[i].x)
table.insert(cdsy,cdsy[i-1]+sdtab[i].y)
end
if d=="aline" then
--pt(px,py,prad,pdeg)
local alx,aly=pt(cdsx[i-1],cdsy[i-1],sdtab[i].l,sdtab[i].a)
table.insert(dr,"cairo_line_to(cr,"..tostring(alx)..","..tostring(aly)..");")
table.insert(cdsx,alx)
table.insert(cdsy,aly)
end
if d=="arc" then
local ang1=(math.pi/180)*((sdtab[i].a1)-90)
local ang2=(math.pi/180)*((sdtab[i].a2)-90)
local rad=sdtab[i].r
local x=sdtab[i].x
local y=sdtab[i].y
table.insert(dr,"cairo_arc(cr,"..tostring(x)..","..tostring(y)..","..tostring(rad)..","..tostring(ang1)..","..tostring(ang2)..");")
local ang2=(math.pi/180)*(sdtab[i].a2)
local ax=0+rad*(math.sin(ang2))
local ay=0-rad*(math.cos(ang2))
table.insert(cdsx,x+ax)
table.insert(cdsy,y+ay)
end
if d=="arc_c" then
local q=sdtab[i].q
local rad=sdtab[i].r
if q==4 then
ang1=(math.pi/180)*(270-90)
x=cdsx[i-1]+rad
y=cdsy[i-1]
elseif q==1 then
ang1=(math.pi/180)*(360-90)
x=cdsx[i-1]
y=cdsy[i-1]+rad
elseif q==2 then
ang1=(math.pi/180)*(90-90)
x=cdsx[i-1]-rad
y=cdsy[i-1]
elseif q==3 then
ang1=(math.pi/180)*(180-90)
x=cdsx[i-1]
y=cdsy[i-1]-rad
end
local ang2=ang1+((math.pi/180)*(sdtab[i].degs))
table.insert(dr,"cairo_arc(cr,"..tostring(x)..","..tostring(y)..","..tostring(rad)..","..tostring(ang1)..","..tostring(ang2)..");")
local ang2=ang2+((math.pi/180)*90)
local ax=0+rad*(math.sin(ang2))
local ay=0-rad*(math.cos(ang2))
table.insert(cdsx,x+ax)
table.insert(cdsy,y+ay)
end
if d=="arc_a" then
local q=sdtab[i].q
local rad=sdtab[i].r
if q==4 then
ang1=(math.pi/180)*(360-90)
x=cdsx[i-1]
y=cdsy[i-1]+rad
elseif q==1 then
ang1=(math.pi/180)*(90-90)
x=cdsx[i-1]-rad
y=cdsy[i-1]
elseif q==2 then
ang1=(math.pi/180)*(180-90)
x=cdsx[i-1]
y=cdsy[i-1]-rad
elseif q==3 then
ang1=(math.pi/180)*(270-90)
x=cdsx[i-1]+rad
y=cdsy[i-1]
end
local ang2=ang1-(math.pi/180)*(sdtab[i].degs)
table.insert(dr,"cairo_arc_negative(cr,"..tostring(x)..","..tostring(y)..","..tostring(rad)..","..tostring(ang1)..","..tostring(ang2)..");")
local ang2=ang2+((math.pi/180)*90)
local ax=0+rad*(math.sin(ang2))
local ay=0-rad*(math.cos(ang2))
table.insert(cdsx,x+ax)
table.insert(cdsy,y+ay)
end
end
return table.concat(dr)
end--of local function sub_draw
local g=gtab.g or 1
local x=gtab.x or 0
local y=gtab.y or 0
local w=gtab.w or 50
local h=gtab.h or 50
local r=gtab.r or 50
local rgx=gtab.rgx or x
local rgy=gtab.rgy or y
local grad=gtab.grad or {{c=0xffffff}}
local gan=gtab.gan or 45
local lw=gtab.lw or 1
local sub=gtab.sub or 0
local db=gtab.db or 0
local subtab=gtab.subtab
if db==1 and g~=6 then
cairo_set_source_rgba (cr,1,1,1,1)
cairo_set_line_width (cr,1)
cairo_rectangle (cr,x,y,w,h)
cairo_stroke (cr)
elseif db==1 and g==6 then
cairo_set_source_rgba (cr,1,1,1,1)
cairo_set_line_width (cr,1)
cairo_arc (cr,x,y,r,0,2*math.pi)
cairo_stroke (cr)
end
--##########################################
if g==1 or g==2 or g==5 or g==6 then --rectangular gradients
if g==1 then
pat = cairo_pattern_create_linear (0,y,0,y+h);
elseif g==2 then
pat = cairo_pattern_create_linear (x,0,x+w,0);
elseif g==5 then
--calculate hypotenuse across middle of rectange
local hyp=math.sqrt((w^2)+(h^2))
local rad=hyp/2
--center point of rectangle
local crx=x+(w/2)
local cry=y+(h/2)
--calculate point 1
local point=(math.pi/180)*gan
local x1=crx+rad*(math.sin(point))
local y1=cry-rad*(math.cos(point))
--calculate point 2
local point=(math.pi/180)*(gan+180)
local x2=crx+rad*(math.sin(point))
local y2=cry-rad*(math.cos(point))
--gradient
pat = cairo_pattern_create_linear (x1,y1,x2,y2);
elseif g==6 then
pat = cairo_pattern_create_radial (rgx, rgy, 0, x, y, r);
end
local gnum=#grad
for i=1,gnum do
cairo_pattern_add_color_stop_rgba (pat,grad[i].p,color(grad[i].c,grad[i].a));
end--for loop
if sub==1 then
cairo_save (cr)
cairo_clip(cr)
cairo_new_sub_path(cr)
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_restore (cr)
end
cairo_set_source (cr, pat);
cairo_fill(cr);
cairo_pattern_destroy (pat);
--###########################################
elseif g==0 and sub==1 then --non gradient
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill(cr)
elseif g==3 and sub==1 then
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_close_path (cr)
cairo_stroke(cr);
elseif g==4 and sub==1 then
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill_preserve(cr);
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[2].c,grad[2].a));
cairo_close_path (cr)
cairo_stroke(cr);
elseif g==0 and sub~=1 then
cairo_rectangle (cr,x,y,w,h)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill(cr);
elseif g==3 and sub~=1 then
cairo_rectangle (cr,x,y,w,h)
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_close_path (cr)
cairo_stroke(cr);
elseif g==4 and sub~=1 then
cairo_rectangle (cr,x,y,w,h)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill_preserve(cr);
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[2].c,grad[2].a));
cairo_close_path (cr)
cairo_stroke(cr);
--radial gradients
elseif g==6 then
pat = cairo_pattern_create_radial (cx, cy, crad-(clw/2)-2,--
cx, cy, crad+(clw/2)+4);
cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1);
cairo_pattern_add_color_stop_rgba (pat, 0.5, 0, 0, 0, 0);
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
cairo_set_source (cr, pat);
cairo_arc (cr, cx, cy, crad+(clw/2), 0, 2*math.pi);
cairo_fill (cr);
cairo_pattern_destroy (pat);
end--of g type
end--of function grec

Re: The New Monster Conky Thread

lwfitz wrote:

^ yeah I thought the dame thing but it didnt seem to make any difference

I used to have the same problem. Lua tends to be kinda temperamental sometimes. The only way I could reliably solve the problem was to put the background images on a separate conky. Take a look at my signature. Maybe you can adapt that method to your conky.