xmonad-0.18.0: A tiling window manager

Copyright | (c) Spencer Janssen 2007
License | BSD3-style (see LICENSE)
Maintainer | spencerjanssen@gmail.com
Stability | unstable
Portability | not portable, mtl, posix
Safe Haskell | None
Language | Haskell2010

XMonad.Layout

Description

The collection of core layouts.

Synopsis

- data Full a = Full
- data Tall a = Tall {
  - tallNMaster :: !Int
  - tallRatioIncrement :: !Rational
  - tallRatio :: !Rational
  }
- newtype Mirror (l :: Type -> Type) a = Mirror (l a)
- data Resize
  - = Shrink
  - | Expand
- newtype IncMasterN = IncMasterN Int
- data Choose (l :: Type -> Type) (r :: Type -> Type) a = Choose CLR (l a) (r a)
- (|||) :: l a -> r a -> Choose l r a
- data CLR
  - = CL
  - | CR
- data ChangeLayout
  - = FirstLayout
  - | NextLayout
- newtype JumpToLayout = JumpToLayout String
- mirrorRect :: Rectangle -> Rectangle
- splitVertically :: Int -> Rectangle -> [Rectangle]
- splitHorizontally :: Int -> Rectangle -> [Rectangle]
- splitHorizontallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle)
- splitVerticallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle)
- tile :: Rational -> Rectangle -> Int -> Int -> [Rectangle]

# Documentation

data Full a #

Simple fullscreen mode. Renders the focused window fullscreen.

Constructors

Full |

#### Instances

Instances details

LayoutClass Full a # |

Instance details

Defined in XMonad.Layout

Methods

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

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

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

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

handleMessage :: Full a -> SomeMessage -> X (Maybe (Full a)) #

pureMessage :: Full a -> SomeMessage -> Maybe (Full a) #

description :: Full a -> String #

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

data Tall a #

The builtin tiling mode of xmonad. Supports `Shrink`, `Expand` and `IncMasterN`.

Constructors

Tall |

Fields

- tallNMaster :: !Int

  The default number of windows in the master pane (default: 1)

- tallRatioIncrement :: !Rational

  Percent of screen to increment by when resizing panes (default: 3/100)

- tallRatio :: !Rational

  Default proportion of screen occupied by master pane (default: 1/2)

#### Instances

Instances details

LayoutClass Tall a # |

Instance details

Defined in XMonad.Layout

Methods

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

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

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

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

handleMessage :: Tall a -> SomeMessage -> X (Maybe (Tall a)) #

pureMessage :: Tall a -> SomeMessage -> Maybe (Tall a) #

description :: Tall a -> String #

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

newtype Mirror (l :: Type -> Type) a #

Mirror a layout, compute its 90 degree rotated form.

Constructors

Mirror (l a) |

#### Instances

Instances details

LayoutClass l a => LayoutClass (Mirror l) a # |

Instance details

Defined in XMonad.Layout

Methods

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

doLayout :: Mirror l a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (Mirror l a)) #

pureLayout :: Mirror l a -> Rectangle -> Stack a -> [(a, Rectangle)] #

emptyLayout :: Mirror l a -> Rectangle -> X ([(a, Rectangle)], Maybe (Mirror l a)) #

handleMessage :: Mirror l a -> SomeMessage -> X (Maybe (Mirror l a)) #

pureMessage :: Mirror l a -> SomeMessage -> Maybe (Mirror l a) #

description :: Mirror l a -> String #

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

data Resize #

Change the size of the master pane.

Constructors

Shrink |
Expand |

#### Instances

Instances details

Message Resize # |
Instance details Defined in XMonad.Layout

newtype IncMasterN #

Increase the number of clients in the master pane.

Constructors

IncMasterN Int |

#### Instances

Instances details

Message IncMasterN # |
Instance details Defined in XMonad.Layout

data Choose (l :: Type -> Type) (r :: Type -> Type) a #

A layout that allows users to switch between various layout options.

Constructors

Choose CLR (l a) (r a) |

#### Instances

Instances details

(LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a # |

Instance details

Defined in XMonad.Layout

Methods

runLayout :: Workspace WorkspaceId (Choose l r a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (Choose l r a)) #

doLayout :: Choose l r a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (Choose l r a)) #

pureLayout :: Choose l r a -> Rectangle -> Stack a -> [(a, Rectangle)] #

emptyLayout :: Choose l r a -> Rectangle -> X ([(a, Rectangle)], Maybe (Choose l r a)) #

handleMessage :: Choose l r a -> SomeMessage -> X (Maybe (Choose l r a)) #

pureMessage :: Choose l r a -> SomeMessage -> Maybe (Choose l r a) #

description :: Choose l r a -> String #

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

(|||) :: l a -> r a -> Choose l r a infixr 5 #

The layout choice combinator

data CLR #

Choose the current sub-layout (left or right) in `Choose`.

Constructors

CL |
CR |

#### Instances

Instances details

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

data ChangeLayout #

Messages to change the current layout. Also see `JumpToLayout`.

Constructors

FirstLayout |
NextLayout |

#### Instances

Instances details

Show ChangeLayout # |
Instance details Defined in XMonad.Layout Methods showsPrec :: Int -> ChangeLayout -> ShowS # show :: ChangeLayout -> String # showList :: [ChangeLayout] -> ShowS #
Eq ChangeLayout # |
Instance details Defined in XMonad.Layout Methods (==) :: ChangeLayout -> ChangeLayout -> Bool # (/=) :: ChangeLayout -> ChangeLayout -> Bool #
Message ChangeLayout # |
Instance details Defined in XMonad.Layout

newtype JumpToLayout #

A message to jump to a particular layout, specified by its description string.

The argument given to a `JumpToLayout` message should be the `description` of the layout to be selected. If you use XMonad.Hooks.DynamicLog from `xmonad-contrib`, this is the name of the layout displayed in your status bar. Alternatively, you can use GHCi to determine the proper name to use. For example:

    $ ghci
    GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
    Loading package base ... linking ... done.
    :set prompt "> "    -- don't show loaded module names
    > :m +XMonad.Core   -- load the xmonad core
    > :m +XMonad.Layout.Grid  -- load whatever module you want to use
    > description Grid  -- find out what it's called
    "Grid"

As yet another (possibly easier) alternative, you can use the XMonad.Layout.Renamed module (also in `xmonad-contrib`) to give custom names to your layouts, and use those.

For example, if you want to jump directly to the `Full` layout you can do

    , ((modm .|. controlMask, xK_f), sendMessage $ JumpToLayout "Full")

Constructors

JumpToLayout String |

#### Instances

Instances details

Message JumpToLayout # |
Instance details Defined in XMonad.Layout

mirrorRect :: Rectangle -> Rectangle #

Mirror a rectangle.

splitVertically :: Int -> Rectangle -> [Rectangle] #

splitHorizontally :: Int -> Rectangle -> [Rectangle] #

splitHorizontallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle) #

splitVerticallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle) #

tile #

Arguments

:: Rational | `frac`, what proportion of the screen to devote to the master area
-> Rectangle | `r`, the rectangle representing the screen
-> Int | `nmaster`, the number of windows in the master pane
-> Int | `n`, the total number of windows to tile
-> [Rectangle] |

Compute the positions for windows using the default two-pane tiling algorithm.

The screen is divided into two panes. All clients are then partitioned between these two panes. One pane, the master, by convention has the least number of windows in it.