xmonad-contrib-0.11: Third party extensions for xmonad

Portability | unportable
Stability | unstable
Maintainer | nzeh@cs.dal.ca
Safe Haskell | None

XMonad.Layout.GridVariants

Contents

- Usage

Description

Two layouts: one is a variant of the Grid layout that allows the desired aspect ratio of windows to be specified. The other is like Tall but places a grid with fixed number of rows and columns in the master area and uses an aspect-ratio-specified layout for the slaves.

Synopsis

- data ChangeMasterGridGeom
  - = IncMasterRows !Int
  - | IncMasterCols !Int
  - | SetMasterRows !Int
  - | SetMasterCols !Int
  - | SetMasterFraction !Rational
- data ChangeGridGeom
  - = SetGridAspect !Rational
  - | ChangeGridAspect !Rational
- data Grid a = Grid !Rational
- data TallGrid a = TallGrid !Int !Int !Rational !Rational !Rational
- data SplitGrid a = SplitGrid Orientation !Int !Int !Rational !Rational !Rational
- data Orientation
  - = T
  - | B
  - | L
  - | R

# Usage

This module can be used as follows:

     import XMonad.Layout.GridVariants

Then add something like this to your layouts:

     Grid (16/10)

for a 16:10 aspect ratio grid, or

     SplitGrid L 2 3 (2/3) (16/10) (5/100)

for a layout with a 2x3 master grid that uses 2/3 of the screen, and a 16:10 aspect ratio slave grid to its right. The last parameter is again the percentage by which the split between master and slave area changes in response to Expand/Shrink messages.

To be able to change the geometry of the master grid, add something like this to your keybindings:

     ((modm .|. shiftMask, xK_equal), sendMessage $ IncMasterCols 1),
     ((modm .|. shiftMask, xK_minus), sendMessage $ IncMasterCols (-1)),
     ((modm .|. controlMask,  xK_equal), sendMessage $ IncMasterRows 1),
     ((modm .|. controlMask,  xK_minus), sendMessage $ IncMasterRows (-1))

data ChangeMasterGridGeom

The geometry change message understood by the master grid

Constructors

IncMasterRows !Int | Change the number of master rows
IncMasterCols !Int | Change the number of master columns
SetMasterRows !Int | Set the number of master rows to absolute value
SetMasterCols !Int | Set the number of master columns to absolute value
SetMasterFraction !Rational | Set the fraction of the screen used by the master grid

Instances

Typeable ChangeMasterGridGeom |
Message ChangeMasterGridGeom |

data ChangeGridGeom

Geometry change messages understood by Grid and SplitGrid

Constructors

SetGridAspect !Rational |
ChangeGridAspect !Rational |

Instances

Typeable ChangeGridGeom |
Message ChangeGridGeom |

data Grid a

Grid layout. The parameter is the desired x:y aspect ratio of windows

Constructors

Grid !Rational |

Instances

LayoutClass Grid a |
Read (Grid a) |
Show (Grid a) |

data TallGrid a

TallGrid layout. Parameters are

- number of master rows - number of master columns - portion of screen used for master grid - x:y aspect ratio of slave windows - increment for resize messages

This exists mostly because it was introduced in an earlier version. It's a fairly thin wrapper around SplitGrid L.

Constructors

TallGrid !Int !Int !Rational !Rational !Rational |

Instances

LayoutClass TallGrid a |
Read (TallGrid a) |
Show (TallGrid a) |

data SplitGrid a

SplitGrid layout. Parameters are

- side where the master is - number of master rows - number of master columns - portion of screen used for master grid - x:y aspect ratio of slave windows - increment for resize messages

Constructors

SplitGrid Orientation !Int !Int !Rational !Rational !Rational |

Instances

LayoutClass SplitGrid a |
Read (SplitGrid a) |
Show (SplitGrid a) |

data Orientation

Type to specify the side of the screen that holds the master area of a SplitGrid.

Constructors

T |
B |
L |
R |

Instances

Eq Orientation |
Read Orientation |
Show Orientation |