xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | Jean-Charles Quillet
License | BSD-style (see LICENSE)
Maintainer | none
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.Columns

Contents

- Usage
- Messages
- Tools

Description

A layout which tiles the windows in columns. The windows can be moved and resized in every directions.

The first window appears in a single column in the center of the screen. Its width is configurable (See `coOneWindowWidth`).

The second window appears in a second column. Starting with two columns, they fill up the screen.

Subsequent windows appear on the bottom of the last columns.

Synopsis

- data ColumnsLayout a = Columns {
  - coOneWindowWidth :: Rational
  - coColumns :: Columns
  }
- data Focus
  - = FocusUp
  - | FocusDown
- data Move
  - = MoveLeft
  - | MoveRight
  - | MoveUp
  - | MoveDown
- data Resize
  - = VerticalShrink
  - | VerticalExpand
  - | HorizontalShrink
  - | HorizontalExpand
- focusDown :: X ()
- focusUp :: X ()

# Usage

Add `Columns` to your `layoutHook` with an initial empty state:

    myLayout = Full ||| Columns 1 []

Here is an example of keybindings:

    -- Focus up/down
    ((modm, xK_Tab), focusDown),
    ((modm .|. shiftMask, xK_Tab), focusUp),
    -- Move windows around
    ((modm .|. shiftMask, xK_l), sendMessage MoveRight),
    ((modm .|. shiftMask, xK_h), sendMessage MoveLeft),
    ((modm .|. shiftMask, xK_k), sendMessage MoveUp),
    ((modm .|. shiftMask, xK_j), sendMessage MoveDown),
    -- Resize them
    ((modm .|. controlMask, xK_l), sendMessage HorizontalExpand),
    ((modm .|. controlMask, xK_h), sendMessage HorizontalShrink),
    ((modm .|. controlMask, xK_k), sendMessage VerticalExpand),
    ((modm .|. controlMask, xK_j), sendMessage VerticalShrink),

This layout is known to work with:

- XMonad.Layout.WindowNavigation for changing focus with a direction using `Go` messages.
- `subTabbed` for docking windows together with tabs. Note that sometimes when undocking windows, the layout is reset. This is a minor annoyance caused by the difficulty to track windows in the sublayout.

data ColumnsLayout a Source #

Constructors

Columns |

Fields

- coOneWindowWidth :: Rational

  With of the first column when there is only one window. Usefull on wide screens.

- coColumns :: Columns

  The current state

#### Instances

Instances details

LayoutClass ColumnsLayout Window Source # |

Instance details

Defined in XMonad.Layout.Columns

Methods

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

doLayout :: ColumnsLayout Window -> Rectangle -> Stack Window -> X ([(Window, Rectangle)], Maybe (ColumnsLayout Window)) Source #

pureLayout :: ColumnsLayout Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] Source #

emptyLayout :: ColumnsLayout Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (ColumnsLayout Window)) Source #

handleMessage :: ColumnsLayout Window -> SomeMessage -> X (Maybe (ColumnsLayout Window)) Source #

pureMessage :: ColumnsLayout Window -> SomeMessage -> Maybe (ColumnsLayout Window) Source #

description :: ColumnsLayout Window -> String Source #

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

# Messages

data Focus Source #

The layout handles focus change messages.

Built-in focus cannot be used here because `XMonad` does not make it easy to change the order of windows in the focus list. See also `focusUp` and `focusDown` functions.

Constructors

FocusUp |
FocusDown |

#### Instances

Instances details

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

data Move Source #

The windows can be moved in every directions.

Horizontally, a window alone in its column cannot be moved before the first or after the last column. If not alone, moving the window outside those limits will create a new column. The windows can also be moved vertically in their column.

Constructors

MoveLeft |
MoveRight |
MoveUp |
MoveDown |

#### Instances

Instances details

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

data Resize Source #

The windows can be resized in every directions.

When resizing horizontally:

- if the window to be resized is not in the last column

  - then the right side of the window will be moved
  - the last column will compensate the size change

- if the window is in the last column

  - then the left side of the window will be moved
  - the column on the left of the current one will compensate the size change

The same applies when resizing vertically using the bottom side of the window unless it is the last window in the column in which case we use the top side.

Constructors

VerticalShrink |
VerticalExpand |
HorizontalShrink |
HorizontalExpand |

#### Instances

Instances details

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

# Tools

focusDown :: X () Source #

Change the keyboard focus to the next window

focusUp :: X () Source #

Change the keyboard focus to the previous window