SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#6076 2013-09-01 14:58:03

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: The New Monster Conky Thread

you can nest tables in LUA as much as you want

color={
   gold=0xFFD700;
   yellow=0xFFFF00;
   red=0xFF0000;
   blue=0x0000FF;
   black=0x000000;
   white=0xFFFFFF;
   }

usage

print(string.format("0x%X",color.gold))

Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

Be excellent to each other!

#6077 2013-09-01 16:30:44

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: The New Monster Conky Thread

@dk75

thx for your help.

does anyone know more about this error-message:

conky: /build/buildd-cairo_1.12.2-2-i386-1cmzkR/cairo-1.12.2/src/cairo.c:301: cairo_destroy: Assertion `((*&(&cr->ref_count)->ref_count) > 0)' failed.

it's the first time i see this message! and i do not know what does this message mean sad

Last edited by lionhead (2013-09-01 16:31:59)

Offline

#6078 2013-09-01 16:32:48

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,333

Re: The New Monster Conky Thread

@errorist -

You should be able to set the openbox dock to be above all windows (layers. however they phrase it) so that maximized windows do not cover it.

I never got the own_window_type panel setting in conkyrc to work like a panel. That was a while ago though.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#6079 2013-09-01 21:41:42

tty-tourist
#! CrunchBangian
From: The North
Registered: 2013-05-26
Posts: 263

Re: The New Monster Conky Thread

@ dk 75

#!/usr/bin/env python2.6

... worked. Thanks!


^ The CrunchBanger formerly known as andreas-r

"You're just a tourist with a typewriter." - Charlie Meadows, Barton Fink

Offline

#6080 2013-09-02 00:38:50

Diet
#! Member
From: /home/basement
Registered: 2013-09-01
Posts: 53

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?

Any advice would be helpful, thanks.

Edit* Forgot to post image http://imgur.com/liud7bw


I've not failed, I've just found a thousand ways that don't work.

Offline

#6081 2013-09-02 00:50:05

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,126
Website

Re: The New Monster Conky Thread

@ Diet

Could you post the code here use the code block by hitting "Code" above the message box.

So far:

1. transparency

Easiest way to do that is to use desktop here:

own_window_type desktop

but you loose the ability of right clicking on your conky.

2. alignment issues

Up:${alignr 5}${upspeed wlan0}
Down:${alignr 5}${downspeed wlan0}

unless it is a one line conky ... in which case every element should be controlled with a ${goto xx} (I see the image now)

Up:${goto 100}${upspeed wlan0}${goto 300}Down:${goto 400}${downspeed wlan0}

spacing and goto values depend of your font and font size of course.

Last edited by Sector11 (2013-09-02 01:04:00)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#6082 2013-09-02 01:10:50

Diet
#! Member
From: /home/basement
Registered: 2013-09-01
Posts: 53

Re: The New Monster Conky Thread

Here's the code for reference

#avoid flicker
double_buffer yes
 
#own window to run simultanious 2 or more conkys
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager
 
#borders
draw_borders no
border_margin 1
 
#shades
draw_shades no
 
#position
gap_x 0
gap_y 0
alignment top_left
 
#behaviour
update_interval 1
 
#colour
default_color  9f907d
 
#default_shade_color 000000
own_window_colour 3d352a
 
#font
use_xft yes
xftfont LiberationSans:pixelsize=11
 
#to prevent window from moving
use_spacer no
minimum_size 1280
 
#mpd
mpd_host localhost
mpd_port 6600
 
TEXT
${alignc}Kernel: ${color D7D3C5}$kernel   |  ${color}Date: ${color D7D3C5}${time %B %d} ${color D7D3C5}${time  %I:%M}  |  ${color} Up: ${color D7D3C5}${uptime_short}   |   ${color}Cpu: ${color D7D3C5}${cpu}%   ${color}${cpugraph 10,80 AEA08E 9F907D} ${color D7D3C5}    |   ${color }Mem: ${color D7D3C5}$mem/$memmax - $memperc% ${color} ${membar 6,80}${color D7D3C5}    |   ${color }Net: ${color D7D3C5}${font}${downspeed wlan0} ${color}  ${downspeedgraph wlan0 10,80 AEA08E 9F907D}  ${color D7D3C5} ${totaldown wlan0} down   |   ${color D7D3C5}${upspeed wlan0} ${color} ${upspeedgraph wlan0 10,80 AEA08E 9F907D}  ${color D7D3C5}${totalup wlan0} up
${alignc} ${color }Root: ${color D7D3C5}${font}${fs_used /}  / ${fs_size /} - ${fs_used_perc /}%   |  ${color} Home: ${color D7D3C5}${fs_used /home}  / ${fs_size /home}  - ${fs_used_perc /home}%   |   ${color}Email: ${color D7D3C5}${pop3_unseen **server name** **user name** **password**} new messages   | ${color} Weather: ${color D7D3C5} ${execi 1800 weatherget -f ~/scripts/.conkyweatherrc --station-id=$LOCATION --metric }   |  ${color} Mpd:  ${color D7D3C5}${font}${mpd_smart}

I've not failed, I've just found a thousand ways that don't work.

Offline

#6083 2013-09-02 01:18:22

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,126
Website

Re: The New Monster Conky Thread

Diet wrote:

Here's the code for reference

Perfect ... what is your screen res?

BRB


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#6084 2013-09-02 01:52:44

Diet
#! Member
From: /home/basement
Registered: 2013-09-01
Posts: 53

Re: The New Monster Conky Thread

1280x800

Gotta love that Thinkpad 16x10


I've not failed, I've just found a thousand ways that don't work.

Offline

#6085 2013-09-02 02:37:53

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,126
Website

Re: The New Monster Conky Thread

Diet wrote:

1280x800

Gotta love that Thinkpad 16x10

Thank you.  Getting late here ... will have a little HowTo for you tomorrow to help you get things setup so there is flexibility without the "whole" conky moving.

Two keys:
1. {goto} command vs spaces after a command that has variable width outputs.
- - -ie: September 01 is longer than May 22  - ${uptime_short}: 1h 1m vs 27h 38m

2. Mono fonts allow for better spacing.  Your font is: xftfont LiberationSans:pixelsize=11
- - suggestion: xftfont Anonymous Pro:pixelsize=11 (because of screen size)

Next: create a "hard copy" conky to work your spacing problems out that way:

TEXT
${alignc}Kernel: 3.2.0-4-686-pae | Date: September 01 07:53 | Up: 36m 28s | Cpu: 95% ${cpugraph 10,60} | Mem: 404MiB/1.92GiB - 20% ${membar 10,60} | Net:104B ${downspeedgraph eth0 10,60} 1.30MiB down | 54B ${upspeedgraph eth0 10,60} 163KiB up
${goto 84}Kernel: 3.2.0-4-686-pae | Date: September 01 07:53 | Up: 36m 28s | Cpu: 95% ${cpugraph 10,60} | Mem: 404MiB/1.92GiB - 20% ${membar 10,60} | Net:104B ${downspeedgraph eth0 10,60} 1.30MiB down | 54B ${upspeedgraph eth0 10,60} 163KiB up


${alignc}Root: 3.70GiB / 143GiB - 2% | Home: 3.70GiB / 143GiB -2% | Email: 0 new messages | Weather: | Mpd: text here
${goto 321}Root: 3.70GiB / 143GiB - 2% | Home: 3.70GiB / 143GiB -2% | Email: 0 new messages | Weather: | Mpd: text here

More tomorrow a Proper HowTo.  Here's a  rough start:
2013_09_01_23_35_50_1920x1080_Sector11.jpg


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#6086 2013-09-02 02:49:01

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,333

Re: The New Monster Conky Thread

@diet -

For the window shadow, are you using compton as compositor? If so add:

shadow-exclude = ["n:e:Conky"];

to your .compton.conf file.

You may also want to try using the conky argb settings for transparency:

own_window yes
own_window_type desktop
own_window_colour 1A1919
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 96
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#6087 2013-09-02 02:55:28

Diet
#! Member
From: /home/basement
Registered: 2013-09-01
Posts: 53

Re: The New Monster Conky Thread

Sector11 wrote:
Diet wrote:

1280x800

Gotta love that Thinkpad 16x10

Thank you.  Getting late here ... will have a little HowTo for you tomorrow to help you get things setup so there is flexibility without the "whole" conky moving.

Two keys:
1. {goto} command vs spaces after a command that has variable width outputs.
- - -ie: September 01 is longer than May 22  - ${uptime_short}: 1h 1m vs 27h 38m

2. Mono fonts allow for better spacing.  Your font is: xftfont LiberationSans:pixelsize=11
- - suggestion: xftfont Anonymous Pro:pixelsize=11 (because of screen size)

Next: create a "hard copy" conky to work your spacing problems out that way:

TEXT
${alignc}Kernel: 3.2.0-4-686-pae | Date: September 01 07:53 | Up: 36m 28s | Cpu: 95% ${cpugraph 10,60} | Mem: 404MiB/1.92GiB - 20% ${membar 10,60} | Net:104B ${downspeedgraph eth0 10,60} 1.30MiB down | 54B ${upspeedgraph eth0 10,60} 163KiB up
${goto 84}Kernel: 3.2.0-4-686-pae | Date: September 01 07:53 | Up: 36m 28s | Cpu: 95% ${cpugraph 10,60} | Mem: 404MiB/1.92GiB - 20% ${membar 10,60} | Net:104B ${downspeedgraph eth0 10,60} 1.30MiB down | 54B ${upspeedgraph eth0 10,60} 163KiB up


${alignc}Root: 3.70GiB / 143GiB - 2% | Home: 3.70GiB / 143GiB -2% | Email: 0 new messages | Weather: | Mpd: text here
${goto 321}Root: 3.70GiB / 143GiB - 2% | Home: 3.70GiB / 143GiB -2% | Email: 0 new messages | Weather: | Mpd: text here

More tomorrow a Proper HowTo.  Here's a  rough start:
http://s20.postimg.org/6bt8wlzbd/2013_09_01_23_35_50_1920x1080_Sector11.jpg

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.

Desktop


I've not failed, I've just found a thousand ways that don't work.

Offline

#6088 2013-09-03 00:08:21

tty-tourist
#! CrunchBangian
From: The North
Registered: 2013-05-26
Posts: 263

Re: The New Monster Conky Thread

How to I make conky display text in front on tint 2 on transparent background?

Tried:

own_window yes
own_window_transparent yes
own_window_type panel
own_window_hints undecorated,sticky,skip_taskbar,skip_pager

... but with that conky fails to display anything at all.

Thanks!

Last edited by tty-tourist (2013-09-03 00:17:40)


^ The CrunchBanger formerly known as andreas-r

"You're just a tourist with a typewriter." - Charlie Meadows, Barton Fink

Offline

#6089 2013-09-03 00:34:31

Inodoro Pereyra
#! Junkie
From: Buenos Aires, Argentina
Registered: 2013-07-01
Posts: 265

Re: The New Monster Conky Thread

andreas-r wrote:

How to I make conky display text in front on tint 2 on transparent background?

Try this:

gap_x 0           # <<------change this to position your conky the way you like it
gap_y 20

own_window yes
own_window_type normal  # <<----- Look here. I don't know if it makes a difference
own_window_transparent yes
own_window_argb_visual yes
own_window_argb_value 0
own_window_class conky
own_window_title Dates
own_window_hints sticky,undecorated,skip_taskbar,skip_pager,above  #<<-- this here does the trick

However, be aware that will put conky above EVERYTHING, including tint2 (might as well get rid of it), all your apps, your terminal, etc. Very annoying, to say the least.

Last edited by Inodoro Pereyra (2013-09-03 03:49:26)

Offline

#6090 2013-09-03 03:43:33

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: The New Monster Conky Thread

New conky in the works..

2013_09_02_1378179648_1440x900_scrot.jpg

Offline

#6091 2013-09-03 23:08:38

errorist
#! CrunchBanger
Registered: 2012-05-24
Posts: 100

Re: The New Monster Conky Thread

@PackRat : Have tested all of Conkys "own_window_*" settings again, and I definitely
have not seen a screen space preserving behaviour with any of them.

Only Openbox gives me an option with its margins settings.

And with OBs dock settings, you could even let Conky disappear from the screen auto-
matically, and bring it back by moving the mouse cursor to the screen edge.

Maybe, we are just overinterpreting Conkys config-manual a little, and it does mean
just what it is working like.

PackRat wrote:

You should be able to set the openbox dock to be above all windows (layers. however
they phrase it) so that maximized windows do not cover it.

Yes, but then everything will be displayed beneath Conky.

Thanks for your help, and conky on !


Cheers,

errorist

Offline

#6092 2013-09-04 20:44:41

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

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!

Offline

#6093 2013-09-04 21:22:21

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: The New Monster Conky Thread

lionhead wrote:

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

And here is my glass effect settings..

--######################################################################
subtab={
{d="start",x=0,y=sysb+5},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=15,degs=90},
{d="arc_c",q=2,r=15,degs=90},
{d="rline",x=-200,y=0},
}
grec({g=1,x=0,y=sysb+5,w=180,h=30,grad={{c=0xFFFFFF,a=0.7,p=0},{c=0xFFFFFF,a=0.0,p=0.5},{c=0x000000,a=0.7,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################

I will post my complete conky when finished lionhead. smile

Offline

#6094 2013-09-05 01:33:18

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: The New Monster Conky Thread

I remember having this issue and fixing it but for the life of me I cant remember what I did.......

Ive got conky calling an image and a cpu bar being called with mrpeachys allcombined.lua but the lua bar always wants to be behind the image. Hopefully someone can help me with this

screenshot-09042013-061819pm.png


max_specials 10000  
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_argb_value 0
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1920 300
maximum_width 1920
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 10
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color1 86acad #darker blue
color2 b1c9c9 #lighter blue
text_buffer_size 100000
top_name_width 5
update_interval 1
short_units yes
temperature_unit fahrenheit

## Colors
color1 white     	#7E7E7E - color for stylebats icons
color2 grey       	#b2b2b2 - grey   #FFFFF0 - ivory for main text
color3 orange    	# for hr lines not used anymore
color4 red    	#FFA54F - orange color - for titles

## Set the path to your script here.
lua_load ~/Conky/allcombined_2.lua
lua_draw_hook

## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}


TEXT
${image /home/luke/Conky/grey2.png -s 2175x350 -p -115,-40}${image /home/luke/Conky/AMD.png -s 35x35 -p 22,43}${image /home/luke/Conky/ram.png -s 45x45 -p 340,40}${image /home/luke/Conky/thermometer.png -s 50x50 -p 570,35}

${goto 65}${voffset 10}${font PointFree:bold:size=11}CPU1 ${goto 115}${cpu cpu1}%${goto 150}CPU3${goto 200}${cpu cpu3}%${goto 235}CPU5${goto 285}${cpu cpu5}%${voffset -10}${voffset 10}${goto 400}RAM${goto 440}${mem}${goto 495}/ ${memmax}${voffset -10}${font PointFree:bold:size=50}${alignc}${time %I}:${time %M}${time %P}${voffset -128}
${goto 65}${voffset 10}${font PointFree:bold:size=11}CPU2 ${goto 115}${cpu cpu2}%${goto 150}CPU4${goto 200}${cpu cpu4}%${goto 235}CPU6${goto 285}${cpu cpu6}%${voffset -10}${voffset 10}${goto 400}SWAP${goto 453}${swap}${goto 495}/ ${swapmax}${voffset -10}${goto 610}${platform it87.656 temp 1}F${voffset -10}${goto 1305}${upspeedgraph eth0 24,588 CCCCCC 0000CC -l -t}${voffset 10}
${voffset -3}${goto 25}${cpugraph cpu0 24,588 CCCCCC 0000CC -l -t}${voffset 3}${voffset -3}${goto 1305}${downspeedgraph eth0 24,588 CCCCCC 0000CC -l -t}${voffset 3}

${voffset -35}${font PointFree:bold:size=31}${alignc}${time %a} ${time %D}${voffset 35}${color}

${lua gradbar {5,125,"${cpu cpu0}",100,122,2,50,0,0xFFFFFF,1,0xCCCCCC,.75,0x0000FF,.75,0x0000CC,1}}

It still needs alot of work and cleaning up so be gentle

Offline

#6095 2013-09-05 01:41:05

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,333

Re: The New Monster Conky Thread

@lwfitz -

I think

lua_draw_hook_post

is what you're after so the lua script is drawn last.

Last edited by PackRat (2013-09-05 01:41:36)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#6096 2013-09-05 01:49:27

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: The New Monster Conky Thread

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

Offline

#6097 2013-09-05 01:54:57

Inodoro Pereyra
#! Junkie
From: Buenos Aires, Argentina
Registered: 2013-07-01
Posts: 265

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.

Offline

#6098 2013-09-05 02:00:45

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: The New Monster Conky Thread

^Thanks Ill check it out. I got this figured out before but am totally drawing a blank

Offline

#6099 2013-09-05 02:10:57

Inodoro Pereyra
#! Junkie
From: Buenos Aires, Argentina
Registered: 2013-07-01
Posts: 265

Re: The New Monster Conky Thread

Let me know if I can help. smile

Offline

Help fund CrunchBang, donate to the project!

#6100 2013-09-05 02:35:27

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: The New Monster Conky Thread

Worked like a charm Inidoro Pereyra. Thanks a bunch, Im bookmarking that conky of yours.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo