xmonad-contrib-0.16: Third party extensions for xmonad

Copyright | (c) Norbert Zeh
License | BSD-style (see LICENSE)
Maintainer | nzeh@cs.dal.ca
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

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 Source #

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

Instances details

Message ChangeMasterGridGeom Source # |
Instance details Defined in XMonad.Layout.GridVariants

data ChangeGridGeom Source #

Geometry change messages understood by Grid and SplitGrid

Constructors

SetGridAspect !Rational |
ChangeGridAspect !Rational |

#### Instances

Instances details

Message ChangeGridGeom Source # |
Instance details Defined in XMonad.Layout.GridVariants

data Grid a Source #

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

Constructors

Grid !Rational |

#### Instances

Instances details

LayoutClass Grid a Source # |

Instance details

Defined in XMonad.Layout.GridVariants

Methods

runLayout :: Workspace WorkspaceId (Grid a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (Grid a)) Source #

doLayout :: Grid a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (Grid a)) Source #

pureLayout :: Grid a -> Rectangle -> Stack a -> [(a, Rectangle)] Source #

emptyLayout :: Grid a -> Rectangle -> X ([(a, Rectangle)], Maybe (Grid a)) Source #

handleMessage :: Grid a -> SomeMessage -> X (Maybe (Grid a)) Source #

pureMessage :: Grid a -> SomeMessage -> Maybe (Grid a) Source #

description :: Grid a -> String Source #

Read (Grid a) Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods readsPrec :: Int -> ReadS (Grid a) # readList :: ReadS [Grid a] # readPrec :: ReadPrec (Grid a) readListPrec :: ReadPrec [Grid a]
Show (Grid a) Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods showsPrec :: Int -> Grid a -> ShowS # show :: Grid a -> String # showList :: [Grid a] -> ShowS #

data TallGrid a Source #

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

Instances details

LayoutClass TallGrid a Source # |

Instance details

Defined in XMonad.Layout.GridVariants

Methods

runLayout :: Workspace WorkspaceId (TallGrid a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (TallGrid a)) Source #

doLayout :: TallGrid a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (TallGrid a)) Source #

pureLayout :: TallGrid a -> Rectangle -> Stack a -> [(a, Rectangle)] Source #

emptyLayout :: TallGrid a -> Rectangle -> X ([(a, Rectangle)], Maybe (TallGrid a)) Source #

handleMessage :: TallGrid a -> SomeMessage -> X (Maybe (TallGrid a)) Source #

pureMessage :: TallGrid a -> SomeMessage -> Maybe (TallGrid a) Source #

description :: TallGrid a -> String Source #

Read (TallGrid a) Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods readsPrec :: Int -> ReadS (TallGrid a) # readList :: ReadS [TallGrid a] # readPrec :: ReadPrec (TallGrid a) readListPrec :: ReadPrec [TallGrid a]
Show (TallGrid a) Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods showsPrec :: Int -> TallGrid a -> ShowS # show :: TallGrid a -> String # showList :: [TallGrid a] -> ShowS #

data SplitGrid a Source #

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

Instances details

LayoutClass SplitGrid a Source # |

Instance details

Defined in XMonad.Layout.GridVariants

Methods

runLayout :: Workspace WorkspaceId (SplitGrid a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (SplitGrid a)) Source #

doLayout :: SplitGrid a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (SplitGrid a)) Source #

pureLayout :: SplitGrid a -> Rectangle -> Stack a -> [(a, Rectangle)] Source #

emptyLayout :: SplitGrid a -> Rectangle -> X ([(a, Rectangle)], Maybe (SplitGrid a)) Source #

handleMessage :: SplitGrid a -> SomeMessage -> X (Maybe (SplitGrid a)) Source #

pureMessage :: SplitGrid a -> SomeMessage -> Maybe (SplitGrid a) Source #

description :: SplitGrid a -> String Source #

Read (SplitGrid a) Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods readsPrec :: Int -> ReadS (SplitGrid a) # readList :: ReadS [SplitGrid a] # readPrec :: ReadPrec (SplitGrid a) readListPrec :: ReadPrec [SplitGrid a]
Show (SplitGrid a) Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods showsPrec :: Int -> SplitGrid a -> ShowS # show :: SplitGrid a -> String # showList :: [SplitGrid a] -> ShowS #

data Orientation Source #

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

Constructors

T |
B |
L |
R |

#### Instances

Instances details

Eq Orientation Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods (==) :: Orientation -> Orientation -> Bool # (/=) :: Orientation -> Orientation -> Bool #
Read Orientation Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods readsPrec :: Int -> ReadS Orientation # readList :: ReadS [Orientation] # readPrec :: ReadPrec Orientation readListPrec :: ReadPrec [Orientation]
Show Orientation Source # |
Instance details Defined in XMonad.Layout.GridVariants Methods showsPrec :: Int -> Orientation -> ShowS # show :: Orientation -> String # showList :: [Orientation] -> ShowS #