[xmonad] Re: darcs patch: add XMonad.Hooks.PlaceNext

Ben Boeckel mathstuf at gmail.com
Sat Jun 26 00:40:47 EDT 2010


Ben Boeckel <mathstuf-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
<snip>

Hi,

Sorry for the self-reply, but I reworked the code to be more general and
support toggling of any ManageHook. I also have a patch for
X.H.FocusNext if it isn't going to be deprecated (unsure of whether a
module which just curry's another module's functions and re-export is
worth hanging around). X.H.InsertPosition could also be rewritten or
deprecated as well. It is probably worth keeping around because of the
``workaround'' I had to do to get dependent ManageHooks to interact
properly. Probably worth documenting as well.

    myManageHook = composeAll
        [ goBelow =? False --> (toggleHook hFocus $ doF W.focusDown)
        , goBelow          --> (toggleHook hFocus $ doF W.focusUp)
        , toggleHook hBelow $ doF W.swapDown
        ]
            where
                goBelow = liftX $ willHook hBelow

Since the above/below hook swaps how the focus should be changed, it
needs to be meta-conditioned as to which direction to swap the focus.

Maybe an operator should be added to go along with (-->) to do
if/then/else rather than just if/then. An operator similar to <!> might
also be nice. I can write these patches up if so.

--Ben


More information about the xmonad mailing list