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,727

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,727

Re: interactive conky

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

Offline

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

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: interactive conky

Offline

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

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

Re: interactive conky

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,165
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

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

Offline

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

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: interactive conky

 - 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;

Offline

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

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

Re: interactive conky

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

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

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)

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: 987

Re: interactive conky

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

Offline

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

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

Re: interactive conky

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,727

Re: interactive conky

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,727

Re: interactive conky

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

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

Offline

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

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

Re: interactive conky

Offline

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

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

Re: interactive conky

Offline

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

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

Re: interactive conky

Offline

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

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

Re: interactive conky

Offline

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

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

Re: interactive conky

--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

Offline

Help fund CrunchBang, donate to the project!

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

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,083
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.  ^_^

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.
Server: bleh

Debian Logo