Re: [dwm] applyrules()

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Tue, 9 Dec 2008 22:41:05 +0000

2008/12/6 yy <yiyu.jgl_AT_gmail.com>:
> Great 5.3.1 release!
>
> What about this little change in applyrules?
> @@ -259,7 +259,7 @@
> && (!r->class || (ch.res_class &&
> strstr(ch.res_class, r->class)))
> && (!r->instance || (ch.res_name &&
> strstr(ch.res_name, r->instance)))) {
> c->isfloating = r->isfloating;
> - c->tags |= r->tags & TAGMASK;
> + c->tags |= r->tags & TAGMASK ? r->tags
> & TAGMASK : tagset[seltags];
> }
> }
> if(ch.res_class)
>
> This way you can define rules like:
> { "MPlayer", NULL, NULL, 0, True },
> { "MPlayer", NULL, NULL, 1 << 6, True },
> and have mplayer tagged to the currently selected tags and to the 6th
> tag, for example. This trick is very convenient to group windows by
> categories, I do it with image viewers, music players... and I think
> it makes clearer the rules definition. With the current
> implementation, if r->tags is 0 the result of applying that rule is
> undefined depending on the previous rules. The only problem I can see
> is that somebody could be doing:
> { NULL, NULL, NULL, 0, True },
> to treat new windows like float by default, by I doubt there's anybody
> here doing such a thing...
> - yiyus || JGL .

I see the use and won't worry to much about this corner case. I
consider making this mainstream as well.

Kind regards,
--Anselm
Received on Tue Dec 09 2008 - 22:41:05 UTC

This archive was generated by hypermail 2.2.0 : Tue Dec 09 2008 - 23:00:07 UTC