Re: [wmii] Fwd: Re: wmii post from requires approval

From: Salva Peiró <>
Date: Fri, 7 Apr 2006 09:26:15 +0000

On 4/6/06, <> wrote:
> On Thursday 06 April 2006 11:38, Anselm R. Garbe wrote:
> > If someone presents a nice idea which works with sh, maybe in
> > conjunction with awk, I'm open to do it. Otherwise blame X that
> > it needs to grab shortcuts and there is no portable way to get
> > keyboard events in any other way.

As talked yesterday on irc, about removing the duplicity of having to write
the keybindings in two places (and thus keep them consistent), so as
garbeam suggested, i've wrote a wmiirc that greps itself for extracting the
list of keybindings to be grabbed, and then write them to /def/keys,
and also grouped all the key handling related stuff in a handlekeys function.

Now, more than ever, I think a advice/comments regarding this behaviour,
it's worth, just because it's not the default way of doing things, and because
it can obviously have unwanted side effects, due to grep matching '$MODKEY.*)'
that we don't want:

MODKEY=M4 # changed $MODKEY to Mod4 (instead of $MODKEY=Alt)
that matches '$MODKEY=Alt)'

        klist=`grep '$MODKEY.*)' $HOME/.wmii-3/wmiirc |
        sed -n 's/^[ ]*//g; s/).*$//; s/$MODKEY/'$MODKEY'/; 2,$p'`
also as the grep command in wmiirc, used to extract the keys matches itself:
'$MODKEY.*)', it has to be dropped by sed that discards it's first match.

by now i've placed:
handlekeys() {
# greps wmiirc itself, to extract keybidings to be un/grabbed or reacted
# you're adviced to be careful, because putting $MODKEY.*), could trash
# /def/keys and result in a apparently strange key reacting behavious at worst.
(it's long but necessary, tand now hope that people read their wmiirc :-P)

That's all, now it's your turn

gualteri (at)

Received on Fri Apr 07 2006 - 11:26:47 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:01:55 UTC