Le 31/10/2013 23:13, Michael Hauser a écrit :
Hi,
quick question: why the distinction between global and client keys and
how to unify?
From what I understood, in default rc.lua : functions associated to
keys in clientkeys take a client as parameter (often referenced as
parameter "c"), while global keys don't. But nothing prevent you to
unify both (to confirm).
Perhaps I just don't see how to adress a focused client with global key
bindings?
I don't understand your problem, as default rc.lua already does that, at
least for maximize/redraw,....
I'm in the process of implementing a modal UI (vim like) and don't want
the need of a second key, if no client is on the screen…
I did something like this (with my own understanding of what a modal UI
is), which might help/inspire you :
https://github.com/Vlamy/dotfiles/blob/master/awesome/furious.lua
Ok ! Its draft, and I planned some month ago to clean it an publish,
but .... :)
Anyway, it implements modal behavior as it allows to define modes to
wich you can associate keys. I used it to implement "run_or_raise",
"catch" (i.e. bring target client to current tag" and "dropdowm"
behavior with client, but it also work with global keys (tested, even if
I found it useless with global actions).
For example with Gvim and Urxvt :
* ROR mode (mod + "t"):
o mod + "t" + "e" --> "run_or_raise Gvim"
o mod + "t" + "s" --> "run_or_raise urxvt"
* catch mode (mod + "s"):
o mod + "s" + "e" --> "grab Gvim"
o mod + "s" + "t" l--> "grab urxvt"
* drop mode (mod + "r"):
o mod + "r" + "e" lanch "dropdown Gvim"
o mod + "r" + "s" lanch "dropdown urxvt"
It's useful to me, but I don't know if it will suite to your needs.
It's GPL, but if you wan't to pick something and release later under a
less restrictive license, I can modify the license on request.
I hope it's heplful for you (and maybe for other awesome fans).
Do not hesitate to ask questions about the code :)
Vlamy.
BTW, awesome rocks!
cheers, mih