You are not logged in.
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. 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Peachy would a function to change the perspective (or skew) of text be difficult?
example:
I know there are a few text scripts floating around on the web, but stepping out on my favorite scriptwriter would be sacrilege.. 
EDIT
the grec function would be great in determining skew angle and direction.
Last edited by falldown (2012-10-19 01:09:04)
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Why the thought of it !!!!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Why the thought of it !!!!
I feel guilty for even googling "lua code" 
I have been so indecisive lately with a new setup. Kinda like writers block, but not. 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
^:o

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?? 
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
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... 
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
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...
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
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;#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
^:o
![]()
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??
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!! 
I have looked at a lot of codes, but they look like gibberish to my bias eyes. 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
mrpeachy wrote:^:o
![]()
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??
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 transformsMoment of weakness.. That covers it completely!!
I have looked at a lot of codes, but they look like gibberish to my bias eyes.
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 
have to do some testing of my own
Last edited by mrpeachy (2012-10-20 00:03:35)
Offline
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
Last edited by mrpeachy (2012-10-20 02:08:56)
Offline
^ 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.0This 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
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. 
Last edited by falldown (2012-10-20 18:38:16)
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Peachy how would I incorporate the skew function into the bargraph lua?
Last edited by falldown (2012-10-20 21:59:17)
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
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
My previous theme hit a brick wall.. kinda lost on where to go with it next.
(not giving up on it) 
Soo on to another concept I had while looking at Peachy's blog. 
Just started on it earlier today so I don't have much done.
Last edited by falldown (2012-10-22 03:21:53)
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
i can sympathize entirely with your statements: "kinda lost on where to go with it next." 
the new setup is looking good
Offline
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
well they work http://youtu.be/8AD-huG3u5k
Offline
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
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 
Offline
Very cool bugtraqstaff.. glad you got it sorted out.
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
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?
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
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.

--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--functionOffline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.