[dwm] some useful changes

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Mon, 27 Nov 2006 13:33:44 +0100

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
Received on Mon Nov 27 2006 - 13:33:44 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:32:48 UTC