[xmonad] Property vs Query Bool

Roman Cheplyaka roma at ro-che.info
Mon Mar 30 12:35:26 EDT 2009

* Konstantin Sobolev <konstantin.sobolev at gmail.com> [2009-03-30 00:54:03-0400]
> I'm trying to implement my own LayoutClass which mixes the ideas of IM
> and CombineTwo. It has to contain some predicate as a part of it's
> state, which will tell where to put new windows.
> As I see IM uses WindowProperties for this purpose, but I wouldn't
> like to use it for 2 reasons:
> 1. Property essentially duplicates Query Bool.
> 2. Property isn't flexible enough. For instance, I can't match a
> window by title substring, while I can easily do it with Query.
> However, there's one problem (and I guess that's why Property was
> introduced): Query doesn't derive Read and Show, and as far as I
> understand it's not so easy to implement them.

You are right.

> So what should I use, Query Bool with empty (Read, Show)
> implementations, losing state between restarts; or Property losing
> flexibility that I'd like to have?

You should use Property. Concerning flexibility, if you can not
discriminate windows by exact matches, it's typically a problem with
that application and is a reason to submit a bug report.

Roman I. Cheplyaka (aka Feuerbach @ IRC)

More information about the xmonad mailing list