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 #

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 # |
Instance details Defined in XMonad.Layout.Columns Methods runLayout :: Workspace WorkspaceId (ColumnsLayout Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (ColumnsLayout Window)) # doLayout :: ColumnsLayout Window -> Rectangle -> Stack Window -> X ([(Window, Rectangle)], Maybe (ColumnsLayout Window)) # pureLayout :: ColumnsLayout Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] # emptyLayout :: ColumnsLayout Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (ColumnsLayout Window)) # handleMessage :: ColumnsLayout Window -> SomeMessage -> X (Maybe (ColumnsLayout Window)) # pureMessage :: ColumnsLayout Window -> SomeMessage -> Maybe (ColumnsLayout Window) # description :: ColumnsLayout Window -> String #
Read (ColumnsLayout a) # |
Instance details Defined in XMonad.Layout.Columns Methods readsPrec :: Int -> ReadS (ColumnsLayout a) # readList :: ReadS [ColumnsLayout a] # readPrec :: ReadPrec (ColumnsLayout a) # readListPrec :: ReadPrec [ColumnsLayout a] #
Show (ColumnsLayout a) # |
Instance details Defined in XMonad.Layout.Columns Methods showsPrec :: Int -> ColumnsLayout a -> ShowS # show :: ColumnsLayout a -> String # showList :: [ColumnsLayout a] -> ShowS #

# Messages

data Focus #

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

data Move #

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

data Resize #

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

# Tools

focusDown :: X () #

Change the keyboard focus to the next window

focusUp :: X () #

Change the keyboard focus to the previous window