xmonad-contrib-0.15: Third party extensions for xmonad

Copyright(c) 2013 Ben Weitzman <benweitzman@gmail.com>
2015 Anton Pirogov <anton.pirogov@gmail.com>
LicenseBSD3-style (see LICENSE)
MaintainerBen Weitzman <benweitzman@gmail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

XMonad.Layout.BinarySpacePartition

Contents

Description

Layout where new windows will split the focused window in half, based off of BSPWM

Synopsis

Usage

You can use this module with the following in your ~/.xmonad/xmonad.hs:

import XMonad.Layout.BinarySpacePartition

Then add the layout, using the default BSP (BinarySpacePartition)

myLayout = emptyBSP ||| etc ..

It may be a good idea to use XMonad.Actions.Navigation2D to move between the windows.

This layout responds to SetGeometry and is compatible with e.g. XMonad.Actions.MouseResize or XMonad.Layout.BorderResize. You should probably try both to decide which is better for you, if you want to be able to resize the splits with the mouse.

If you don't want to use the mouse, add the following key bindings to resize the splits with the keyboard:

, ((modm .|. altMask,               xK_l     ), sendMessage $ ExpandTowards R)
, ((modm .|. altMask,               xK_h     ), sendMessage $ ExpandTowards L)
, ((modm .|. altMask,               xK_j     ), sendMessage $ ExpandTowards D)
, ((modm .|. altMask,               xK_k     ), sendMessage $ ExpandTowards U)
, ((modm .|. altMask .|. ctrlMask , xK_l     ), sendMessage $ ShrinkFrom R)
, ((modm .|. altMask .|. ctrlMask , xK_h     ), sendMessage $ ShrinkFrom L)
, ((modm .|. altMask .|. ctrlMask , xK_j     ), sendMessage $ ShrinkFrom D)
, ((modm .|. altMask .|. ctrlMask , xK_k     ), sendMessage $ ShrinkFrom U)
, ((modm,                           xK_r     ), sendMessage Rotate)
, ((modm,                           xK_s     ), sendMessage Swap)
, ((modm,                           xK_n     ), sendMessage FocusParent)
, ((modm .|. ctrlMask,              xK_n     ), sendMessage SelectNode)
, ((modm .|. shiftMask,             xK_n     ), sendMessage MoveNode)

Here's an alternative key mapping, this time using additionalKeysP, arrow keys, and slightly different behavior when resizing windows

, ("M-M1-<Left>",    sendMessage $ ExpandTowards L)
, ("M-M1-<Right>",   sendMessage $ ShrinkFrom L)
, ("M-M1-<Up>",      sendMessage $ ExpandTowards U)
, ("M-M1-<Down>",    sendMessage $ ShrinkFrom U)
, ("M-M1-C-<Left>",  sendMessage $ ShrinkFrom R)
, ("M-M1-C-<Right>", sendMessage $ ExpandTowards R)
, ("M-M1-C-<Up>",    sendMessage $ ShrinkFrom D)
, ("M-M1-C-<Down>",  sendMessage $ ExpandTowards D)
, ("M-s",            sendMessage $ BSP.Swap)
, ("M-M1-s",         sendMessage $ Rotate) ]

If you have many windows open and the layout begins to look too hard to manage, you can Balance the layout, so that the current splittings are discarded and windows are tiled freshly in a way that the split depth is minimized. You can combine this with Equalize, which does not change your tree, but tunes the split ratios in a way that each window gets the same amount of space:

, ((myModMask,               xK_a),     sendMessage Balance)
, ((myModMask .|. shiftMask, xK_a),     sendMessage Equalize)

emptyBSP :: BinarySpacePartition a Source #

an empty BinarySpacePartition to use as a default for adding windows to.

data BinarySpacePartition a Source #

Instances
LayoutClass BinarySpacePartition Window Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

Eq (BinarySpacePartition a) Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

Read (BinarySpacePartition a) Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

Show (BinarySpacePartition a) Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data Rotate Source #

Message for rotating a split (horizontal/vertical) in the BSP

Constructors

Rotate 
Instances
Message Rotate Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data Swap Source #

Message for swapping the left child of a split with the right child of split

Constructors

Swap 
Instances
Message Swap Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data ResizeDirectional Source #

Message for resizing one of the cells in the BSP

data TreeRotate Source #

Message for rotating the binary tree around the parent node of the window to the left or right

Constructors

RotateL 
RotateR 
Instances
Message TreeRotate Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data TreeBalance Source #

Message to balance the tree in some way (Balance retiles the windows, Equalize changes ratios)

Constructors

Balance 
Equalize 
Instances
Message TreeBalance Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data FocusParent Source #

Message to cyclically select the parent node instead of the leaf

Constructors

FocusParent 
Instances
Message FocusParent Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data SelectMoveNode Source #

Message to move nodes inside the tree

Constructors

SelectNode 
MoveNode 
Instances
Message SelectMoveNode Source # 
Instance details

Defined in XMonad.Layout.BinarySpacePartition

data Direction2D Source #

Two-dimensional directions:

Constructors

U

Up

D

Down

R

Right

L

Left

Instances
Bounded Direction2D Source # 
Instance details

Defined in XMonad.Util.Types

Enum Direction2D Source # 
Instance details

Defined in XMonad.Util.Types

Eq Direction2D Source # 
Instance details

Defined in XMonad.Util.Types

Ord Direction2D Source # 
Instance details

Defined in XMonad.Util.Types

Read Direction2D Source # 
Instance details

Defined in XMonad.Util.Types

Show Direction2D Source # 
Instance details

Defined in XMonad.Util.Types