New XMonad layout based on bspwm

Hi, I've written a binary space partition layout based of bspwm. Each time a window is inserted, it splits the current window into two. You can resize, rotate, and swap the leafs of the BSP tree around. Attached is the darcs patch. Cheers, Ben

This 1-patch bundle was just applied to http://code.haskell.org/XMonadContrib: 20140430205848 benweitzman@gmail.com * Add BinarySpacePartition layout -- This message was brought to you by DarcsWatch http://darcswatch.nomeata.de/repo_http:__code.haskell.org_XMonadContrib.html...

Hello Ben,
I've applied it. I've changed Bound to XMonad.Util.Types.Direction2D.
Swap conflicts with the Swap in XMonad.Layout.WindowNavigation, but I
dunno if it's worth giving it an odd name (Exchange or SwapBSP) to
help a few people avoid qualified imports.
Ideally the ExpandTowards R message should do something when the
window is already the right-most window on the screen. Probably that
action should be what ShrinkTowards L does. Or maybe it should be what
ExpandTowards L does. One way to get around that configuration mess is
have the message include a function.
There are other layouts (Mosaic and MosaicAlt) in contrib that also
recursively split areas in half. It might be nice to switch between a
more automatically balanced tree (Mosaic) and one in which the layout
is more "under your control".
Regards,
Adam
On Wed, Apr 30, 2014 at 5:17 PM, Ben Weitzman
Hi,
I've written a binary space partition layout based of bspwm. Each time a window is inserted, it splits the current window into two. You can resize, rotate, and swap the leafs of the BSP tree around.
Attached is the darcs patch.
Cheers, Ben
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

Thanks Adam,
First of all, thanks for the name conflict info. Even after a year with
XMonad there are still lots of things I don't know :)
Could you clarify why you think ExpandTowards R should do something if the
window is up against the right edge? It seems like it might be
counterintuitive for a window to grow towards the left if it can't grow
towards the right. Perhaps a more general Expand or Expand
Vertical/Horizontal message would be helpful?
Ben
On Wed, Apr 30, 2014 at 9:54 PM, adam vogt
Hello Ben,
I've applied it. I've changed Bound to XMonad.Util.Types.Direction2D. Swap conflicts with the Swap in XMonad.Layout.WindowNavigation, but I dunno if it's worth giving it an odd name (Exchange or SwapBSP) to help a few people avoid qualified imports.
Ideally the ExpandTowards R message should do something when the window is already the right-most window on the screen. Probably that action should be what ShrinkTowards L does. Or maybe it should be what ExpandTowards L does. One way to get around that configuration mess is have the message include a function.
There are other layouts (Mosaic and MosaicAlt) in contrib that also recursively split areas in half. It might be nice to switch between a more automatically balanced tree (Mosaic) and one in which the layout is more "under your control".
Regards, Adam
On Wed, Apr 30, 2014 at 5:17 PM, Ben Weitzman
wrote: Hi,
I've written a binary space partition layout based of bspwm. Each time a window is inserted, it splits the current window into two. You can resize, rotate, and swap the leafs of the BSP tree around.
Attached is the darcs patch.
Cheers, Ben
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

Hi Ben, ExpandTowards R could mean something like "grow the current window, preferably shrinking the one(s) to the right". Yes it might be counterintuitive, but my opinion is that a layout should do something somewhat sensible instead of nothing. I don't mind if that's a separate message. To expand on my suggestion earlier, you might add a message: data ModifyTree = ModifyTree (Zipper Split -> Maybe (Zipper Split))
From which it would be straightforward to make up a "counterintuitive" keybindings with something like:
moveABorderToTheLeft :: X ()
moveABorderToTheLeft = sendMessage $
ModifyTree $ msum [
expandTreeTowards L,
shrinkTreeTowards R]
Possibly make an instance Monoid ModifyTree that does what the
MonadPlus instance used above does, and then it could be a pretty as:
("M-<Left>", sendMessage (expandTreeTowards' L <> shrinkTreeTowards' R)),
where expandTreeTowards' :: Direction2D -> ModifyTree is exported by
the BSP module.
Regards,
Adam
On Wed, Apr 30, 2014 at 10:21 PM, Ben Weitzman
Thanks Adam,
First of all, thanks for the name conflict info. Even after a year with XMonad there are still lots of things I don't know :)
Could you clarify why you think ExpandTowards R should do something if the window is up against the right edge? It seems like it might be counterintuitive for a window to grow towards the left if it can't grow towards the right. Perhaps a more general Expand or Expand Vertical/Horizontal message would be helpful?
Ben
On Wed, Apr 30, 2014 at 9:54 PM, adam vogt
wrote: Hello Ben,
I've applied it. I've changed Bound to XMonad.Util.Types.Direction2D. Swap conflicts with the Swap in XMonad.Layout.WindowNavigation, but I dunno if it's worth giving it an odd name (Exchange or SwapBSP) to help a few people avoid qualified imports.
Ideally the ExpandTowards R message should do something when the window is already the right-most window on the screen. Probably that action should be what ShrinkTowards L does. Or maybe it should be what ExpandTowards L does. One way to get around that configuration mess is have the message include a function.
There are other layouts (Mosaic and MosaicAlt) in contrib that also recursively split areas in half. It might be nice to switch between a more automatically balanced tree (Mosaic) and one in which the layout is more "under your control".
Regards, Adam
On Wed, Apr 30, 2014 at 5:17 PM, Ben Weitzman
wrote: Hi,
I've written a binary space partition layout based of bspwm. Each time a window is inserted, it splits the current window into two. You can resize, rotate, and swap the leafs of the BSP tree around.
Attached is the darcs patch.
Cheers, Ben
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
participants (3)
-
adam vogt
-
Ben Weitzman
-
darcswatch@nomeata.de