[dwm] nmaster port for dwm 4.6 + tips

From: pancake <pancake_AT_youterm.com>
Date: Wed, 17 Oct 2007 04:15:34 +0200

I have decided to port the nmaster patch to support the latest
dwm changes about the supertile. I think that the new model is
nice, but it needs more work to be finished.

Here'r my tips.

Out of the tile() layout. there's no way to manage mwfact. This
is wrong, but for floating layout it's fine. In my case (nmaster)
I had to comment out two lines to make it work.

      - if(!ISTILE)
      - return;

Also the zoom doesn't works

      - if(!sel || !ISTILE || sel->isfloating)
                return;
      + if(!sel || sel->isfloating)
                return;

There's one more reference to ISTILE easy to be killed too.

Some variables has been required to be used by nmaster which are not
exported by dwm.h. Here's the list:

        extern Client *clients;
        extern Client *sel;
        extern double mwfact;
        extern int screen, sx, sy, sw, sh, wax, way, waw, wah;
        extern unsigned int bh, bpos;
        int nmaster = NMASTER;

config.h problem:

There's no way to include "config.h" outside dwm.c, because therer
some variables defined there, not only definitions, so I had to
hardcode these values into the nmaster.c. This is really UGLY..
but I can't find a right way to solve this.

        #define NMASTER 1
        #define BORDERPX 1
        #define RESIZEHINTS False

Another option would be to define those variables into config.mk or
Makefile as -D CFLAGS but in this way we are splitting the configuration
in two files making stupidly complex.

How would you fix that?

Finally I have used to run dwm in this way to log out all the stuff
which is really cool for development.

.xinitrc:

 (sleep 1 && xterm -bg black -fg gray -fn 10x20 -e tail -f ~/.dwm.log) &
 while : ; date ; sleep 1 ; done | dwm > ~/.dwm.log

The nmaster.c patch for dwm-4.6 supertile is attached in config.h
you have to define this:

/* ntile - nmaster */
extern void ntile(void);
void incnmaster(const char *arg);

Layout layouts[] = {
        /* symbol function */
        { "[]=", tile }, /* first entry is default */
        { "-|=", ntile }, /* first entry is default */
        { "><>", floating },
};
..
        { MODKEY|ShiftMask, XK_j, incnmaster, "+1"}, \
        { MODKEY|ShiftMask, XK_k, incnmaster, "-1"}, \
..

--pancake

Received on Wed Oct 17 2007 - 02:33:53 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:59:55 UTC