Vincent Bernat | 1 Aug 2012 15:44
Gravatar

List of clients

Hi!

Not all clients seem to be available through `client.get()`. What the
criteria for a client to be in this list? For example, I am trying to
get x2x in the list of clients but it does not seem available, even if
it does create a small window. I am able to spot it with `xwininfo` (but
not with `xlsclients`):

     0x3200003 "x2x localhost:10.0": ()  2x1076+3838+2  +3838+2
--

-- 
Use uniform input formats.
            - The Elements of Programming Style (Kernighan & Plauger)

Vincent Bernat | 2 Aug 2012 15:22
Gravatar

Is the mouse button pressed?

Hi!

I would like to determine if a mouse button is pressed. It is possible
using events and tracking the button states myself but something
like mouse.coords would be more helpful. Is something like this already
available?

--

-- 
panic("kmem_cache_init(): Offsets are wrong - I've been messed with!");
	2.2.16 /usr/src/linux/mm/slab.c

David Gomes | 2 Aug 2012 15:26
Favicon

Re: Is the mouse button pressed?

Use flags. When that key is pressed (awful.key.bind()) set a certain
variable to true. When that key is released, set it to false. And then
use that variable to check.

I'm just not sure of how you can check if a key is rleeased.

On Thu, Aug 2, 2012 at 2:22 PM, Vincent Bernat <bernat <at> luffy.cx> wrote:
>
> Hi!
>
> I would like to determine if a mouse button is pressed. It is possible
> using events and tracking the button states myself but something
> like mouse.coords would be more helpful. Is something like this already
> available?
>
> --
> panic("kmem_cache_init(): Offsets are wrong - I've been messed with!");
>         2.2.16 /usr/src/linux/mm/slab.c
>
> --
> To unsubscribe, send mail to awesome-unsubscribe <at> naquadah.org.

Julien Danjou | 2 Aug 2012 15:26
Gravatar

Re: Is the mouse button pressed?

On Thu, Aug 02 2012, Vincent Bernat wrote:

> I would like to determine if a mouse button is pressed. It is possible
> using events and tracking the button states myself but something
> like mouse.coords would be more helpful. Is something like this already
> available?

mouse.coords() returns the button status too in the returned table:
mouse.coords[1] is true or false according to the status of button 1,
etc.

--

-- 
Julien Danjou
;; Free Software hacker & freelance
;; http://julien.danjou.info
David Gomes | 2 Aug 2012 15:32
Favicon

Re: Is the mouse button pressed?

Oh! I confused "button" with "key", I'm sorry, my answer is pretty useless then.

On Thu, Aug 2, 2012 at 2:26 PM, Julien Danjou <julien <at> danjou.info> wrote:
> On Thu, Aug 02 2012, Vincent Bernat wrote:
>
>> I would like to determine if a mouse button is pressed. It is possible
>> using events and tracking the button states myself but something
>> like mouse.coords would be more helpful. Is something like this already
>> available?
>
> mouse.coords() returns the button status too in the returned table:
> mouse.coords[1] is true or false according to the status of button 1,
> etc.
>
> --
> Julien Danjou
> ;; Free Software hacker & freelance
> ;; http://julien.danjou.info

Vincent Bernat | 2 Aug 2012 15:41
Gravatar

Re: Is the mouse button pressed?

 ❦  2 août 2012 15:26 CEST, Julien Danjou <julien <at> danjou.info> :

>> I would like to determine if a mouse button is pressed. It is possible
>> using events and tracking the button states myself but something
>> like mouse.coords would be more helpful. Is something like this already
>> available?
>
> mouse.coords() returns the button status too in the returned table:
> mouse.coords[1] is true or false according to the status of button 1,
> etc.

OK, thanks! That's mouse.coords().buttons[1].
--

-- 
 /*
  * For moronic filesystems that do not allow holes in file.
  * We may have to extend the file.
  */
	2.4.0-test2 /usr/src/linux/fs/buffer.c

Vincent Bernat | 2 Aug 2012 19:46
Gravatar

Re: Is the mouse button pressed?

 ❦  2 août 2012 15:22 CEST, Vincent Bernat <bernat <at> luffy.cx> :

> I would like to determine if a mouse button is pressed. It is possible
> using events and tracking the button states myself but something
> like mouse.coords would be more helpful. Is something like this already
> available?

I was needing this for a "mouse follows focus" (combined with a classic
"sloppy focus"). I think I have now a fairly working setup around
this. For interested people (not all the file is revelant to this
functionality):

 https://github.com/vincentbernat/awesome-configuration/blob/master/rc/signals.lua
--

-- 
 /* Nobody will ever see this message :-) */
panic("Cannot initialize video hardware\n");
	2.0.38 /usr/src/linux/arch/m68k/atari/atafb.c

Javier Garcia | 2 Aug 2012 21:56
Picon

Run or rise does works as expected with xterm

Hi,


I followed this instructions.


After that, I have this ror.lua file:

module("ror")
table5={
   ["a"]={"teminator","Terminator"},
   ["d"]={"xterm","Xterm"},
   ["y"]={"chromium-browser","Chromium"},
   ["e"]={"firefox","Firefox"},
}


The problem: when i press Mod+d it opens a new xterm window, event if there are other xterm already opened. The rest of the apps work ok.

Any idea?

Javi
Javier Garcia | 2 Aug 2012 22:13
Picon

Re: Run or rise does works as expected with xterm

The same happens with xchat..

2012/8/2 Javier Garcia <tirengarfio <at> gmail.com>
Hi,

I followed this instructions.


After that, I have this ror.lua file:

module("ror")
table5={
   ["a"]={"teminator","Terminator"},
   ["d"]={"xterm","Xterm"},
   ["y"]={"chromium-browser","Chromium"},
   ["e"]={"firefox","Firefox"},
}


The problem: when i press Mod+d it opens a new xterm window, event if there are other xterm already opened. The rest of the apps work ok.

Any idea?

Javi

Vincent Bernat | 3 Aug 2012 00:43
Gravatar

Re: Run or rise does works as expected with xterm

 ❦  2 août 2012 21:56 CEST, Javier Garcia <tirengarfio <at> gmail.com> :

> I followed this instructions.
>
> http://awesome.naquadah.org/wiki/Run_or_raise
>
> After that, I have this ror.lua file:
>
> module("ror")
> table5={
>    ["a"]={"teminator","Terminator"},
>    ["d"]={"xterm","Xterm"},
>    ["y"]={"chromium-browser","Chromium"},
>    ["e"]={"firefox","Firefox"},
> }
>
>
> The problem: when i press Mod+d it opens a new xterm window, event if there
> are other xterm already opened. The rest of the apps work ok.

Class for xterm is `XTerm`, not `Xterm`.
--

-- 
 /*
  * Hash table gook..
  */
	2.4.0-test2 /usr/src/linux/fs/buffer.c


Gmane