On Fri, Jul 29, 2011 at 02:20:41PM +0200, mauro tonon wrote: > Usually, in dwm, I prefer to have only terminals (xterm, rxvt, etc) > in tiled mode and all other applications in floating mode... > At first, I added many lines to the rules section in config.h > but, now, I solved the problem in this way: > > in file config.def.h, before the rules, add: > > + /* Floating default rule for a generic window: > + 0 if you want (current) tiled layout as default > + 1 if you want floating layout as default */ > + #define FLOATING_AS_DEFAULT 1 > > with this rule: > > + { "XTerm", NULL, NULL, 0, False, -1 }, > > and in file dwm.c, in function applyrules: > > - c->isfloating = c->tags = 0; > + c->isfloating = FLOATING_AS_DEFAULT; > + c->tags = 0; > > Note that this is not the same that to set "floating" as default layout mode > (i.e. all applications in floating mode). > With my patch, terminals are tiled, by default, but all others applications > not. >
Why not just add "default" rule first. Like this: { NULL, NULL, NULL, 0, True, -1 }, { "XTerm", NULL, NULL, 0, False, -1 }, First rule sets isfloating=True. Then it is changed to False for terminals.