SEARCH

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

You are not logged in.

#1026 2012-10-02 01:23:39

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

Re: interactive conky

Peachy this gradient code is top-notch Sir! cool
2012_10_01_1349140732_1440x900_scrot.jpg

I am going to write some of these repetitive shapes into functions.. good suggestion. smile

Offline

Be excellent to each other!

#1027 2012-10-02 04:50:17

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

thanks falldown

good idea about the shapes
for the pentagon shape you would send the function x,y,color,alpha

main function()
--draw pentagon 1
pentagon(x,y,c,a)
--draw pentagon 2
pentagon(x,y,c,a)
end--main function

pentagon (px,py,pcolor,palpha)
subtab{
{d="start",x=px,y=py},
{other sub tab drawing stuff}
}
grec({sub=1,subtab=subtab,grad={{c=pcolor,a=palpha}},other grec settings})
end--pentagon function

Last edited by mrpeachy (2012-10-02 04:50:29)

Offline

#1028 2012-10-02 13:30:08

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,473
Website

Re: interactive conky

Looking good there falldown.  You two are going hell-bent for space here.

@ mrpeachy - did you drop your "borg" conky?

Offline

#1029 2012-10-02 18:06:51

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

@Sector11 - not drop exactly... i have been busy with other things so conky has had to take a bit of a back seat recently

Offline

#1030 2012-10-02 20:41:36

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,473
Website

Re: interactive conky

mrpeachy wrote:

@Sector11 - not drop exactly... i have been busy with other things so conky has had to take a bit of a back seat recently

Got you loud and clear - I'm in the same boat.

Offline

#1031 2012-10-04 17:13:09

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

Re: interactive conky

^^ and ^  Yes yes.. RL has taken the majority of my time as well.

Peachy I am thinking of incorporating xplanet into this theme.
I want to add it to the weather section.

I have yet to check how much resources it uses.

Offline

#1032 2012-10-05 09:41:35

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

Re: interactive conky

i want to display an rss-feed. each entry should have an 'more'. you click on the word on the respective webpage opens then.

the webpage contains the 'headline' and the respective link:

        <tr>
            <td nowrap="nowrap">04.10.2012&nbsp;&nbsp;</td>
            <td><a href="/index.php?section=news&amp;cmd=details&amp;newsid=613" title="Curiosity bei der Düne namens Rocknest">Curiosity bei der Düne namens Rocknest</a></td>
        </tr>


or the rss-feed (xml-file):

<item>
<title>Curiosity bei der Düne namens Rocknest</title>
<link>
http://www.marspages.eu/index.php?section=news&cmd=details&newsid=613&teaserId=
</link>
<category domain="http://www.marspages.eu/index.php?section=news&category=10">Mars Science Laboratory</category>
<pubDate>Thu, 04 Oct 2012 21:30:31 +0200</pubDate>
</item>

do u have an idea how to realize this?


“If you wish to make an apple pie from scratch, you must first invent the universe.”  Carl Sagan

GET V9000 (german translationtable)  | try my custom v9000

Offline

#1033 2012-10-11 00:15:49

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

Re: interactive conky

I have been so busy recently.. Haven't had the time to play. sad

I have added (or I have attempted to add) some depth to this..
2012_10_10_1349914233_1440x900_scrot.jpg

Hope all is well with everyone smile

Offline

#1034 2012-10-11 00:37:38

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

very nice
ill have to ponder a while to see if i like it better than the flat shapes in your previous shot smile
how are you applying the gradient to the blue pentagon shape?

i'm well... just busy with other things.  So i will join you with sad

Last edited by mrpeachy (2012-10-11 00:38:28)

Offline

#1035 2012-10-11 00:45:24

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,473
Website

Re: interactive conky

^^ & ^

That makes three of us - seems to be going around, I'm in and out in spurts, being busy with other things as well.  Just when I think 'I'm back' ... oops!

@ falldown - that's awesome!  I definitely like it!

Offline

#1036 2012-10-11 00:47:14

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

Re: interactive conky

I'm doing it the hard way Peachy..  big_smile
I do a solid color shape
next I do a black layer set at g=1 with black gradient at {a=0.7,p=0}{a=0,p=0.5}{a=0.7,p=1}
and another layer set at g=2 with the same gradient as above.

Offline

#1037 2012-10-11 00:55:47

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

Re: interactive conky

Thanks guys!! smile

Just a lot of school activities going on with the young ones.

Offline

#1038 2012-10-11 01:27:02

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

falldown wrote:

I'm doing it the hard way Peachy..  big_smile
I do a solid color shape
next I do a black layer set at g=1 with black gradient at {a=0.7,p=0}{a=0,p=0.5}{a=0.7,p=1}
and another layer set at g=2 with the same gradient as above.

thats what i suspected... but not the hard way, seems entirely reasonable to me smile

Offline

#1039 2012-10-11 23:06:48

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

Re: interactive conky

Here is the cpu window..
2012_10_11_1349996589_1440x900_scrot.jpg
Reworked the bargraphs a bit.

Offline

#1040 2012-10-12 01:06:02

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

im thinking the gradrec function needs a circular gradient option big_smile

Offline

#1041 2012-10-12 01:16:03

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,473
Website

Re: interactive conky

Good to see two master at work again!

Lookin' good!

Offline

#1042 2012-10-12 02:15:41

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

Re: interactive conky

peachy wrote:

im thinking the gradrec function needs a circular gradient option big_smile

That might be the best thing that I have heard all week.. or maybe the best disguised criticism of the week!! lol

Offline

#1043 2012-10-12 03:17:04

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,473
Website

Re: interactive conky

falldown wrote:

That might be the best thing that I have heard all week.. or maybe the best disguised criticism of the week!! lol

Or a touch of both with a bit of bat wings. smile

Offline

#1044 2012-10-12 17:58:49

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

Re: interactive conky

smile Peachy I wasn't being serious about the criticism joke above.

A circular grec would be awesome as well as a grec that could be used with text.. (like maybe a subtab=subtab) function. subtab=text or however it would look.

Offline

#1045 2012-10-12 18:42:00

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

^ i know, and there wasn't a hint of criticism in my statement smile
that is a good idea to combine text into the function
i have been working on a text function that does some things with gradients and text positioning
ill see if i can get the circular gradient implemented today

Offline

#1046 2012-10-12 20:01:15

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

ok, try this
should replace the existing grec function without anything breaking

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

a couple of new things first
g=6 sets the radial gradient
uses the same method of colors and points as the other gradient types
when g=6 x and y settings are now the middle of the gradient rather than the bottom left corner
set db=1 and you get a circle instead of a rectangle

when g=6 set r=radius of circle (w and h not used)
to adjust the gradient set
rgx= (radial gradient x)
rgy= (radial gradient y)
these setting move the center point of the gradient around within the circle
if rgx and rgy are not set, the gradient center point is at x,y

also there is another drawing option
d=aline
this allows you to specify a length and an angle and the script draws a line to that point

try this out and youll see how aline and g=6 work

subtab={
{d="start",x=200,y=200},
{d="aline",l=50,a=45},
{d="aline",l=50,a=135},
{d="aline",l=50,a=180+45},
{d="aline",l=50,a=270+45},
}
grec({g=6,r=40,x=235,y=200,rgx=235,rgy=220,w=50,h=-50,grad={{c=0xffff00,a=1,p=0},{c=0x0000ff,a=1,p=1}},lw=2,sub=1,db=1,subtab=subtab})

Last edited by mrpeachy (2012-10-12 20:05:06)

Offline

#1047 2012-10-12 21:02:43

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

Re: interactive conky

Very cool Peachy!!

This aline looks interesting.
Time to play!! smile

Offline

#1048 2012-10-13 01:38:50

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

Re: interactive conky

Much prettier Peachy..
2012_10_12_1350092137_1440x900_scrot.jpg

The circular gradient works perfectly. big_smile

Offline

#1049 2012-10-14 19:51:22

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

Re: interactive conky

A slightly less is more direction..
2012_10_14_1350244025_1440x900_scrot.jpg
cycle button opened first step..
2012_10_14_1350244042_1440x900_scrot.jpg

Offline

Be excellent to each other!

#1050 2012-10-14 21:25:14

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 2,755

Re: interactive conky

^i think you should have a separate bar for each output rathet than up and down on the same one
other than that its coming along nicely
how far have you gotten?

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