[xmonad] Re: float, match by regex?

mail at justinbogner.com mail at justinbogner.com
Sun Feb 15 18:47:23 EST 2009


lowly coder
<lowlycoder at huoyanjinjing.com> writes:
> so in .xmonad/xmonad.hs, I see how i can make a window float, by selecting it's
> title; however, suppose I wnat a bunch of windows to float, i.e.:
>
> "float1"
> "float2" ...
>
> is it possible to instaed of listing out all titles, specify a regex, or a
> function that goes [Char] -> Bool ? (for deciding whether to float the window
> or not)
>
> thanks!

You want the function `elem`, which returns true if the first argument
is an element of a list. To use it as a managehook, you could do
something like this:

    className <? [ "feh"
                 , "Gitk"
                 , "Meld"
                 , "Kompare"
                 , "Mbrowse"
                 , "Zenity"
                 ]           --> doFloat

    -- | Return 'True' if @q@ is an element of @xs@
    q <? xs = fmap (flip elem xs) q



More information about the xmonad mailing list