SEARCH

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

You are not logged in.

#1051 2012-10-14 21:53:45

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

Re: interactive conky

I agree with the separate bars.

I am on the mem window (third step cycle button).

Not getting much done today because of
The Walking Dead marathon on AMC in preparation for the season 3 premier.  big_smile

Offline

Help fund CrunchBang, donate to the project!

#1052 2012-10-19 00:15:22

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

Re: interactive conky

Peachy would a function to change the perspective (or skew) of text be difficult?
example:
system.jpg

I know there are a few text scripts floating around on the web, but stepping out on my favorite scriptwriter would be sacrilege.. big_smile


EDIT
the grec function would be great in determining skew angle and direction.

Last edited by falldown (2012-10-19 01:09:04)

Offline

#1053 2012-10-19 00:31:15

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

Re: interactive conky

falldown wrote:

Peachy would a function to change the perspective (or skew) of text be difficult?
example:
system.jpg

I know there are a few text scripts floating around on the web, but stepping out on my favorite scriptwriter would be sacrilege.. big_smile

Why the thought of it !!!!


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

Online

#1054 2012-10-19 00:38:44

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

Re: interactive conky

S11 wrote:

Why the thought of it !!!!

I feel guilty for even googling "lua code" big_smile

I have been so indecisive lately with a new setup. Kinda like writers block, but not. smile

Offline

#1055 2012-10-19 02:57:28

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

Re: interactive conky

^:o yikes yikes
so you were on google and one thing led to another... your fingers "slipped" and typed "lua" into the search box??
i suppose it was a moment of weakness and didn't "mean" anything??
big_smile
i dont think skewing is too hard to do... i just havnt done much of that kind of thing (i will be googling the subject myself - transforms and matrix's)
wlourf has some scrips out there that do fancy things with text transforms

Offline

#1056 2012-10-19 03:14:30

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: interactive conky

A couple of questions on this before I begin on a project...

On the first page, mrpeachy mentions the need for xwininfo, and that it needed to be installed ... I did not see a source for that tool, and as indicated it is not in Debian sources.

Where is the latest and greatest source for this interactive lua?  I tried to download a couple of links from the early stages but they are were broken.  I just want to make sure I have the latest.

I am starting very small with the first attempt, just to build a conky that when you click on the Debian logo I have, it will bring up the Xfce or OB menu.

Thanks... Great work here by all involved, well done... cool


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#1057 2012-10-19 03:20:50

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

Re: interactive conky

VastOne wrote:

A couple of questions on this before I begin on a project...

On the first page, mrpeachy mentions the need for xwininfo, and that it needed to be installed ... I did not see a source for that tool, and as indicated it is not in Debian sources.

Where is the latest and greatest source for this interactive lua?  I tried to download a couple of links from the early stages but they are were broken.  I just want to make sure I have the latest.

I am starting very small with the first attempt, just to build a conky that when you click on the Debian logo I have, it will bring up the Xfce or OB menu.

Thanks... Great work here by all involved, well done... cool

this is where the most recent button script is hiding
http://crunchbanglinux.org/forums/post/245759/#p245759

re - xwininfo, i believe it is part of the x11-utils package

Offline

#1058 2012-10-19 03:45:26

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

Re: interactive conky

mrpeachy wrote:

re - xwininfo, i believe it is part of the x11-utils package

B·I·N·G·O!

 - appres, editres, listres and viewres, which query the X resource database;
 - luit, a filter that can be run between an arbitrary application and a
   UTF-8 terminal emulator;
 - xdpyinfo, a display information utility for X;
 - xdriinfo, query configuration information of DRI drivers;
 - xev, an X event displayer;
 - xfd, a tool that displays all the glyphs in a given X font;
 - xfontsel, a tool for browsing and selecting X fonts;
 - xkill, a tool for terminating misbehaving X clients;
 - xlsatoms, which lists interned atoms defined on an X server;
 - xlsclients, which lists client applications running on an X display;
 - xlsfonts, a server font list displayer;
 - xmessage, a tool to display message or dialog boxes;
 - xprop, a property displayer for X;
 - xvinfo, an Xv extension information utility for X;
 - xwininfo, a window information utility for X;

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

Online

#1059 2012-10-19 23:23:02

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

Re: interactive conky

mrpeachy wrote:

^:o yikes yikes
so you were on google and one thing led to another... your fingers "slipped" and typed "lua" into the search box??
i suppose it was a moment of weakness and didn't "mean" anything??
big_smile
i dont think skewing is too hard to do... i just havnt done much of that kind of thing (i will be googling the subject myself - transforms and matrix's)
wlourf has some scrips out there that do fancy things with text transforms

Moment of weakness.. That covers it completely!! big_smile

I have looked at a lot of codes, but they look like gibberish to my bias eyes. neutral

Offline

#1060 2012-10-19 23:38:10

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

Re: interactive conky

falldown wrote:
mrpeachy wrote:

^:o yikes yikes
so you were on google and one thing led to another... your fingers "slipped" and typed "lua" into the search box??
i suppose it was a moment of weakness and didn't "mean" anything??
big_smile
i dont think skewing is too hard to do... i just havnt done much of that kind of thing (i will be googling the subject myself - transforms and matrix's)
wlourf has some scrips out there that do fancy things with text transforms

Moment of weakness.. That covers it completely!! big_smile

I have looked at a lot of codes, but they look like gibberish to my bias eyes. neutral

ill see if i can get to looking into it over the weekend
i also cant follow the "man page" approach to what is supposed to be going on with the matrix command in lua smile
have to do some testing of my own

Last edited by mrpeachy (2012-10-20 00:03:35)

Offline

#1061 2012-10-20 01:49:29

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

Re: interactive conky

so skewing is relatively straight forward

cairo_save(cr)
matrix = cairo_matrix_t:create(); tolua.takeownership(matrix)
cairo_matrix_init(matrix,
            1,--adjust width
            0,--shear vertical
            1,--shear horizontal
            1,--vertical height * height
            0,--moves horizontal by pixels
            0)--moves vertical by pixels
cairo_transform(cr, matrix)
cairo_set_source_rgba(cr,1,1,1,1)
font="Mono"
fsize=50
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_move_to (cr,50,50)
cairo_show_text(cr,"HELLO")
cairo_stroke(cr)
cairo_restore(cr)

but i cant see how to do the double skew like you wanted in your pic
system.jpg

Last edited by mrpeachy (2012-10-20 02:08:56)

Offline

#1062 2012-10-20 03:27:01

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 905

Re: interactive conky

^ I think it is all in the math outlined here, it just depends on what settings you use.

cairo_matrix_init ()

void                cairo_matrix_init                   (cairo_matrix_t *matrix,
                                                         double xx,
                                                         double yx,
                                                         double xy,
                                                         double yy,
                                                         double x0,
                                                         double y0);

Sets matrix to be the affine transformation given by xx, yx, xy, yy, x0, y0. The transformation is given by:

 x_new = xx * x + xy * y + x0;
 y_new = yx * x + yy * y + y0;

matrix :
    a cairo_matrix_t

xx :
    xx component of the affine transformation

yx :
    yx component of the affine transformation

xy :
    xy component of the affine transformation

yy :
    yy component of the affine transformation

x0 :
    X translation component of the affine transformation

y0 :
    Y translation component of the affine transformation

Since 1.0

This might tell you what the equations do depending on how much calculus you know.
It is to late for me to think about calculus now, I may look at it again tomorrow.

Offline

#1063 2012-10-20 18:25:51

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

Re: interactive conky

Peachy I might be able to do this without some of your lua magic.

EDIT scratch that.. Thought I could do it with a large to small font size, but it looks just like it sounds.  roll

Last edited by falldown (2012-10-20 18:38:16)

Offline

#1064 2012-10-20 19:37:05

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

Re: interactive conky

Peachy how would I incorporate the skew function into the bargraph lua?

Last edited by falldown (2012-10-20 21:59:17)

Offline

#1065 2012-10-20 22:45:52

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

Re: interactive conky

which kind of bar graph?
it should work like this:

cairo_save(cr)
matrix = cairo_matrix_t:create(); tolua.takeownership(matrix)
cairo_matrix_init(matrix,
            1,--adjust width
            0,--shear vertical
            1,--shear horizontal
            1,--vertical height * height
            0,--moves horizontal by pixels
            0)--moves vertical by pixels
cairo_transform(cr, matrix)
--##########################
all bar graph setup
--##########################
cairo_restore(cr)

Offline

#1066 2012-10-21 22:09:07

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

Re: interactive conky

My previous theme hit a brick wall.. kinda lost on where to go with it next.
(not giving up on it) smile

Soo on to another concept I had while looking at Peachy's blog.
2012_10_21_1350856951_1440x900_scrot.jpg
Just started on it earlier today so I don't have much done.

little more..
2012_10_21_1350875665_1440x900_scrot.jpg

Last edited by falldown (2012-10-22 03:21:53)

Offline

#1067 2012-10-22 19:07:01

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

Re: interactive conky

i can sympathize entirely with your statements:  "kinda lost on where to go with it next." smile
the new setup is looking good

Offline

#1068 2012-12-15 13:23:02

olgmen
New Member
Registered: 2012-12-15
Posts: 1

Re: interactive conky

Hi all, I'm sorry, but I do not know much English and so I write through Google Translate. Explore this section and made himself such conky

s_1355500141_3269573_51cd2086c1.png

well they work http://youtu.be/8AD-huG3u5k

Offline

#1069 2012-12-15 19:32:56

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

Re: interactive conky

olgmen wrote:

Hi all, I'm sorry, but I do not know much English and so I write through Google Translate. Explore this section and made himself such conky

http://storage5.static.itmages.ru/i/12/1214/s_1355500141_3269573_51cd2086c1.png

well they work http://youtu.be/8AD-huG3u5k

very nice work olgmen!

Offline

#1070 2013-01-18 09:19:40

bugtraqstaff
Member
Registered: 2012-09-04
Posts: 16

Re: interactive conky

Hi all again,

We finih the Bugtraq 2 Black Widow Beta, with the new conky... You can see pictures in our website on in our youtube channel.
The only problem that have its that lua dont admit more than X zones to click, but works perfect, and you can turn UP or DOWN the services of the system.

Thanks all for your help to create our conky that its based in your codes smile

Offline

#1071 2013-01-19 01:34:43

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

Re: interactive conky

Very cool bugtraqstaff.. glad you got it sorted out.

Offline

#1072 2013-01-19 01:36:23

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

Re: interactive conky

Peachy
Working on a new interactive conky.. using the bargraph.lua and trying to keep it simple.  yikes
2013_01_18_1358558763_1440x900_scrot.jpg

Offline

#1073 2013-02-06 16:13:43

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

Re: interactive conky

Panel in action..

Default interactive conky panel

Now to clean it up and get it all together.

Peachy is it possible to have lua find the local username and then assign it a generic name?

Offline

#1074 2013-04-05 17:22:50

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: interactive conky

thought I would toss in my buttons.lua i tried to make this as simple as possible. Starting form mrpeachy's work I stripped it down it's individual parts clickfunction, button_make and button_draw. Then added status, override and count, the newest addition that I made was for a top list that I was building. I made a kill button, very simple, just holds the name and pid of a process for you while you decide if you want to kill it or not. I figure that I would post all of my button codes for anyone that wants it.
2013_04_05_1365181932_114x126_scrot.png2013_04_05_1365182077_336x134_scrot.png

--Remember your "own_window_title clicky" line in conky
require 'cairo'

function conky_buttons ()
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 == 3 then
--######################################################################
--######################################################################
--######################################################################
buttons={}
click_start=1
alternating_table={}
end-- updates == 4
--######################################################################
--######################################################################
--######################################################################
if updates > 5 then
--buttons={}
localx,localy,localnowx,localnowy=clickfunction()--dont edit
--alternating_table={}
if updates > 5 then if alternating_table[3] == 1 then alternating=-1 else if alternating_table[3] == -1 then alternating=1 end end end
for i = 1,3 do
if alternating_table[i+1]==nil then alternating_table[i+1]=1 end
alternating_table[i]=alternating_table[i+1]
if i==3 then alternating_table[i]=alternating end
if alternating_table[3] == nil then alternating_table[3]=1 end
end
--######################################################################
--######################################################################
--######################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
--######################################################################
--######################################################################
--######################################################################
function button_make(name,tlx,tly,width,height)
if buttons[""..(name).."_button"]==nil then buttons[""..(name).."_button"]=0 end
--calculate if click was inside box
if localx>=(tlx) and localx<=(tlx)+(width) and localy>=(tly) and localy<=(tly)+(height) and buttons[""..(name).."_button"]~=1 then
buttons[""..(name).."_button"]=1
elseif localx>=(tlx) and localx<=(tlx)+(width) and localy>=(tly) and localy<=(tly)+(height) and buttons[""..(name).."_button"]==1 then
buttons[""..(name).."_button"]=0
end
end--function
--######################################################################
--######################################################################
--######################################################################
function button_count(name,tlx,tly,width,height,max_value)
if buttons[""..(name).."_button"]==nil then buttons[""..(name).."_button"]=0 end
--calculate if click was inside box
if localx>=(tlx) and localx<=(tlx)+(width) and localy>=(tly) and localy<=(tly)+(height) and buttons[""..(name).."_button"] ~= (max_value) then
buttons[""..(name).."_button"]=(buttons[""..(name).."_button"])+1
elseif localx>=(tlx) and localx<=(tlx)+(width) and localy>=(tly) and localy<=(tly)+(height) and buttons[""..(name).."_button"] == (max_value) then
buttons[""..(name).."_button"]=0 end
end--function
--######################################################################
--######################################################################
--######################################################################
function button_status(name)
return buttons[""..(name).."_button"]
end--function
--######################################################################
--######################################################################
--######################################################################
function button_override(name,value)
buttons[""..(name).."_button"]=(value)
end--function
--######################################################################
--######################################################################
--######################################################################
function button_draw(tlx,tly,width,height,color,fill,fill_color)
cairo_set_line_width (cr,2)
cairo_rectangle (cr,tlx,tly,width,height)
if fill == 1 then
cairo_set_source_rgba (cr,fill_color[1],fill_color[2],fill_color[3],fill_color[4])
cairo_fill_preserve(cr)
end
cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
cairo_stroke (cr)
end--function
--######################################################################
--######################################################################
--######################################################################
function kill_button(name,tlx,tly,process,pid,reset,reset_inpute)
button_make(""..name.."1",tlx,tly,40,20)
if (button_status(""..name.."1")) == 1 then
buttons[""..name.."_process"]=process
buttons[""..name.."_pid"]=pid
button_override(""..name.."1",2)
end
if (button_status(""..name.."1")) == 0 then
button_draw(tlx,tly,40,20,{.5,.5,.5,1},1,{.25,.25,.25,.5})
cairo_move_to(cr,(tlx+1),(tly+15))
cairo_set_source_rgba(cr,.8,.8,.8,1)
cairo_select_font_face (cr,"mono",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size (cr,15)
cairo_show_text(cr,"kill")
cairo_stroke(cr)
elseif (button_status(""..name.."1")) == 2 then
cairo_set_line_width(cr,2)
cairo_rectangle(cr,tlx,tly,265,50)
cairo_set_source_rgba(cr,.5,.5,.5,1)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,.25,.25,.25,1)
cairo_stroke(cr)
x={1,57}
t={"Are you sure you want to kill",""..buttons[""..name.."_process"]..""..buttons[""..name.."_pid"]..""}
for i = 1,2 do
cairo_move_to(cr,(tlx+x[i]),(tly+(i*15)))
cairo_set_source_rgba(cr,0,0,0,1)
cairo_select_font_face (cr,"mono",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size (cr,15)
cairo_show_text(cr,t[i])
cairo_stroke(cr)
end
button_make(""..name.."2",(tlx+20),(tly+30),40,20)
cairo_move_to(cr,(tlx+21),(tly+45))
cairo_set_source_rgba(cr,.8,.8,.8,1)
cairo_select_font_face (cr,"mono",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size (cr,15)
cairo_show_text(cr,"kill")
cairo_stroke(cr)
button_make(""..name.."3",(tlx+200),(tly+30),50,20)
cairo_move_to(cr,(tlx+202),(tly+45))
cairo_set_source_rgba(cr,.8,.8,.8,1)
cairo_select_font_face (cr,"mono",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size (cr,15)
cairo_show_text(cr,"Close")
cairo_stroke(cr)
if (button_status(""..name.."3")) == 1 then
button_override(""..name.."3",0)
button_override(""..name.."2",0)
button_override(""..name.."1",0)
end
if (button_status(""..name.."2")) == 1 then
os.execute("kill "..buttons[""..name.."_pid"].."")
button_override(""..name.."1",0)
button_override(""..name.."2",0)
end--if (button_status(""..name.."2")) == 1 then
end--if (button_status(""..name.."1")) == 0 then
end--function
--######################################################################
--######################################################################
--######################################################################
function clickfunction()
--start click logging and calculations ##########################################
if click_start==1 then
xdot=conky_parse("${if_running xdotool}1${else}0${endif}")
if tonumber(xdot)==1 then
os.execute("killall xdotool && echo 'xdo killed' &")
end
os.execute("xdotool search --name 'clicky' behave %@ mouse-click getmouselocation >> /tmp/xdo &")
local f = io.popen("xwininfo -name 'clicky' | grep 'Absolute'")
geometry = f:read("*a")
f:close()
local geometry=string.gsub(geometry,"[\n]","")
s,f,abstlx=string.find(geometry,"X%p%s*(%d*)")
s,f,abstly=string.find(geometry,"Y%p%s*(%d*)")
click_start=nil
end--if click_start=1 ######################################
--click calculations #################################
local f=io.open("/tmp/xdo")
click=f:read()
f:close()
if click~=nil then
local f = io.open("/tmp/xdo","w")
f:write("")
f:close()
end--if click=nil
if click==nil then click="x:0 y:0 " end
--print (click)
local s,f,mousex=string.find(click,"x%p(%d*)%s")
local s,f,mousey=string.find(click,"y%p(%d*)%s")
localx=tonumber(mousex)-abstlx
localy=tonumber(mousey)-abstly
--get now location
os.execute("xdotool getmouselocation > /tmp/xdonow ")
local f=io.open("/tmp/xdonow")
mousenow=f:read()
f:close()
local s,f,mousenowx=string.find(mousenow,"x%p(%d*)%s")
local s,f,mousenowy=string.find(mousenow,"y%p(%d*)%s")
localnowx=tonumber(mousenowx)-abstlx
localnowy=tonumber(mousenowy)-abstly
--END CLICK CALCULATIONS #################################
return localx,localy,localnowx,localnowy
end--function

You can find my work here

Make everything ok button

Offline

Be excellent to each other!

#1075 2013-09-16 00:15:22

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,050
Website

Re: interactive conky

wow, i'm really late to this.

i had stopped using conky ages ago because it wasnt interactive.

only just started looking into this, after farhaven from suckless suggested it sounded like i wanted conky + dzen.

it had been years since i searched for interactive conky.  it was like i was the first to do so back then, but now, a quick websearch, and there's results popping up everywhere.  smile

yet to read through this whole thread... i'll be back when i've done more homework.  ^_^


~ think ~
i have chosen to commit to bedrocklinux.
causes of the mo: remember aaron | stop lennart (& systemd) | without a shot fired

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