[xmonad] Fwd: Patch to add new Layout message

Christian Wills cwills.dev at gmail.com
Fri Oct 3 02:05:13 UTC 2014


I prefer Devin's solution to mine but just for completeness here is an
updated version of my method which works no matter how many master windows
have been manually added or removed with mod-, or mod-. by resetting the
layout (effectively setting the number of master windows to 1). Thanks to
Brandon for pointing out some silliness I was doing.

data MasterPaneFlag = MasterPaneFlag { getFlag :: Bool }
    deriving (Show, Typeable)

instance ExtensionClass MasterPaneFlag where
    initialValue = MasterPaneFlag False

pickIncrFun :: Bool -> X ()
pickIncrFun flag = if flag then (sendMessage (IncMasterN (1))) else
(sendMessage (IncMasterN 0))

toggleMasterPane :: X ()
toggleMasterPane  = do
    flag <- XS.get
    XS.modify(MasterPaneFlag . not . getFlag)
    asks config >>= \c -> setLayout (XMonad.layoutHook c) >> pickIncrFun
(getFlag flag)


On Thu, Oct 2, 2014 at 3:57 PM, Mike Meyer <mwm at mired.org> wrote:

> Thanks to all for the help. I've now got it done as a configuration using
> an extension of Tall.  I added a note to the issue (
> http://code.google.com/p/xmonad/issues/detail?id=577&q=message#makechanges)
> that it can be closed.
>
> Final question - is there a writeup somewhere on extending the builtin
> Layouts as Devin showed here?
>
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141002/fb7dfef7/attachment.html>


More information about the xmonad mailing list