Hi!

I think this change make the whole configuration more weird. I never
used more than one function per key.

And as far as I can see, if I change the value of NFUNCS, I have to
change every single line of my keydefs. Nobody uses more than 3
keydefs which could use this feature.

What is wrong about multiplexer functions for a few functions? They
are easy to implement, easy to read, and easy to understand. Imho they
are self-explaining. I think even users can add them in 2 min.

Grusz
Enno Boland

2006/11/27, Anselm R. Garbe <[EMAIL PROTECTED]>:
Hi there,

I applied the togglefloat patch to mainstream dwm and bound it
to $MODKEY-Shift-space - I consider this feature useful in
several cases when one only wants to make the selected client
floating and not the rest.

Also, I changed the Key structure as follows:

Old:

typedef struct {
        unsigned long mod;
        KeySym keysym;
        void (*func)(Arg *arg);
        Arg arg;
} Key;


New:

typedef struct {
        unsigned long mod;
        KeySym keysym;
        void (*func[NFUNCS])(Arg *arg);
                   ^^^^^^^^
        Arg arg;
} Key;


This results that config.h now needs the additional NFUNCS macro
which defines the number of functions in the array of a key
definition (default is 1). Assumed you

#define NFUNCS 2

you can now declare shortcuts like:

static Key key[] = { \
                /* modifier                                     key             
        functions                               arguments */ \
                { ControlMask|ShiftMask,        XK_1,           { tag, view },  
                {.i = 0 } }, \
                { MODKEY,                                       XK_m,           
{ togglefloat, zoom },  { 0 } }, \
...
};

This avoids such weird patches to implement tagandview or
maxtiled stuff and other things - with 3 additional LOC only.

Regards,
--
 Anselm R. Garbe >< http://suckless.org/~arg/ >< GPG key: 0D73F361




--
http://www.gnuffy.org - Real Community Distro
http://www.gnuffy.org/index.php/GnuEm - Gnuffy on Ipaq (Codename Peggy)

Reply via email to