xmonad-contrib-0.16: Third party extensions for xmonad

Copyright | (c) Norbert Zeh <norbert.zeh@gmail.com>
License | BSD3
Maintainer | Norbert Zeh <norbert.zeh@gmail.com>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

XMonad.Layout.Dwindle

Contents

- Usage

Description

Three layouts: The first, `Spiral`, is a reimplementation of `spiral` with, at least to me, more intuitive semantics. The second, `Dwindle`, is inspired by a similar layout in awesome and produces the same sequence of decreasing window sizes as Spiral but pushes the smallest windows into a screen corner rather than the centre. The third, `Squeeze` arranges all windows in one row or in one column, with geometrically decreasing sizes.

Synopsis

- data Dwindle a
  - = Dwindle !Direction2D !Chirality !Rational !Rational
  - | Spiral !Direction2D !Chirality !Rational !Rational
  - | Squeeze !Direction2D !Rational !Rational
- data Direction2D
  - = U
  - | D
  - | R
  - | L
- data Chirality
  - = CW
  - | CCW

# Usage

This module can be used as follows:

    import XMonad.Layout.Dwindle

Then add something like this to your layouts:

    Dwindle R CW 1.5 1.1

or

    Spiral L CW 1.5 1.1

or

^ Squeeze D 1.5 1.1

The first produces a layout that places the second window to the right of the first, the third below the second, the fourth to the right of the third, and so on. The first window is 1.5 times as wide as the second one, the second is 1.5 times as tall as the third one, and so on. Thus, the further down the window stack a window is, the smaller it is and the more it is pushed into the bottom-right corner.

The second produces a layout with the same window sizes but places the second window to the left of the first one, the third above the second one, the fourth to the right of the third one, and so on.

The third produces a layout that stacks windows vertically top-down with each window being 1.5 times as tall as the next.

In all three cases, the fourth (third, in the case of `Squeeze`) parameter, 1.1, is the factor by which the third parameter increases or decreases in response to Expand or Shrink messages.

For more detailed instructions on editing the layoutHook see:

XMonad.Doc.Extending

data Dwindle a Source #

Layouts with geometrically decreasing window sizes. `Spiral` and `Dwindle` split the screen into a rectangle for the first window and a rectangle for the remaining windows, which is split recursively to lay out these windows. Both layouts alternate between horizontal and vertical splits.

In each recursive step, the split `Direction2D` determines the placement of the remaining windows relative to the current window: to the left, to the right, above or below. The split direction of the first split is determined by the first layout parameter. The split direction of the second step is rotated 90 degrees relative to the first split direction according to the second layout parameter of type `Chirality`. So, if the first split is `R` and the second layout parameter is `CW`, then the second split is `D`.

For the `Spiral` layout, the same `Chirality` is used for computing the split direction of each step from the split direction of the previous step. For example, parameters `R` and `CW` produces the direction sequence `R`, `D`, `L`, `U`, `R`, `D`, `L`, `U`, ...

For the `Dwindle` layout, the `Chirality` alternates between `CW` and `CCW` in each step. For example, parameters `U` and `CCW` produce the direction sequence `U`, `L`, `U`, `L`, ... because `L` is the `CCW` rotation of `U` and `U` is the `CW` rotation of `L`.

In each split, the current rectangle is split so that the ratio between the size of the rectangle allocated to the current window and the size of the rectangle allocated to the remaining windows is the third layout parameter. This ratio can be altered using `Expand` and `Shrink` messages. The former multiplies the ratio by the fourth layout parameter. The latter divides the ratio by this parameter.

`Squeeze` does not alternate between horizontal and vertical splits and simply splits in the direction given as its first argument.

Parameters for both `Dwindle` and `Spiral`:

- First split direction
- First split chirality
- Size ratio between rectangle allocated to current window and rectangle allocated to remaining windows
- Factor by which the size ratio is changed in response to `Expand` or `Shrink` messages

The parameters for `Squeeze` are the same, except that there is no `Chirality` parameter.

Constructors

Dwindle !Direction2D !Chirality !Rational !Rational |
Spiral !Direction2D !Chirality !Rational !Rational |
Squeeze !Direction2D !Rational !Rational |

#### Instances

Instances details

LayoutClass Dwindle a Source # |

Instance details

Defined in XMonad.Layout.Dwindle

Methods

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

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

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

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

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

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

description :: Dwindle a -> String Source #

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

data Direction2D Source #

Two-dimensional directions:

Constructors

U | Up
D | Down
R | Right
L | Left

#### Instances

Instances details

Bounded Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods minBound :: Direction2D # maxBound :: Direction2D #
Enum Direction2D Source # |

Instance details

Defined in XMonad.Util.Types

Methods

succ :: Direction2D -> Direction2D #

pred :: Direction2D -> Direction2D #

toEnum :: Int -> Direction2D #

fromEnum :: Direction2D -> Int #

enumFrom :: Direction2D -> [Direction2D] #

enumFromThen :: Direction2D -> Direction2D -> [Direction2D] #

enumFromTo :: Direction2D -> Direction2D -> [Direction2D] #

enumFromThenTo :: Direction2D -> Direction2D -> Direction2D -> [Direction2D] #

Eq Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods (==) :: Direction2D -> Direction2D -> Bool # (/=) :: Direction2D -> Direction2D -> Bool #
Ord Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods compare :: Direction2D -> Direction2D -> Ordering # (<) :: Direction2D -> Direction2D -> Bool # (<=) :: Direction2D -> Direction2D -> Bool # (>) :: Direction2D -> Direction2D -> Bool # (>=) :: Direction2D -> Direction2D -> Bool # max :: Direction2D -> Direction2D -> Direction2D # min :: Direction2D -> Direction2D -> Direction2D #
Read Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods readsPrec :: Int -> ReadS Direction2D # readList :: ReadS [Direction2D] # readPrec :: ReadPrec Direction2D readListPrec :: ReadPrec [Direction2D]
Show Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods showsPrec :: Int -> Direction2D -> ShowS # show :: Direction2D -> String # showList :: [Direction2D] -> ShowS #

data Chirality Source #

Rotation between consecutive split directions

Constructors

CW |
CCW |

#### Instances

Instances details

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