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

Copyright | (c) 2007 David Roundy <droundy@darcs.net> Devin Mullins <me@twifkak.com>
License | BSD3-style (see LICENSE)
Maintainer | Devin Mullins <me@twifkak.com>
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Actions.WindowNavigation

Contents

- Usage

Description

This is a rewrite of XMonad.Layout.WindowNavigation. WindowNavigation lets you assign keys to move up/down/left/right, based on actual cartesian window coordinates, rather than just going j/k on the stack.

This module is experimental. You'll have better luck with the original.

This module differs from the other in a few ways:

1. You can go up/down/left/right across multiple screens.
2. It doesn't provide little border colors for your neighboring windows.
3. It doesn't provide the 'Move' action, which seems to be related to the XMonad.Layout.Combo extension.
4. It tries to be slightly smarter about tracking your current position.
5. Configuration is different.

Synopsis

- withWindowNavigation :: (KeySym, KeySym, KeySym, KeySym) -> XConfig l -> IO (XConfig l)
- withWindowNavigationKeys :: [((KeyMask, KeySym), WNAction)] -> XConfig l -> IO (XConfig l)
- data WNAction
  - = WNGo Direction2D
  - | WNSwap Direction2D
- go :: IORef WNState -> Direction2D -> X ()
- swap :: IORef WNState -> Direction2D -> X ()
- data Direction2D
  - = U
  - | D
  - | R
  - | L
- type WNState = Map WorkspaceId Point

# Usage

To use it, you're going to apply the `withWindowNavigation` function. `withWindowNavigation` performs some IO operations, so the syntax you'll use is the same as the spawnPipe example in XMonad.Hooks.DynamicLog. In particular:

    main = do
        config <- withWindowNavigation (xK_w, xK_a, xK_s, xK_d)
                $ def { ... }
        xmonad config

Or, for the brave souls:

    main = xmonad =<< withWindowNavigation (xK_w, xK_a, xK_s, xK_d)
                $ def { ... }

Here, we pass in the keys for navigation in counter-clockwise order from up. It creates keybindings for `modMask` to move to window, and `modMask .|. shiftMask` to swap windows.

If you want more flexibility over your keybindings, you can use `withWindowNavigationKeys`, which takes a list of `keys`-esque entries rather than a tuple of the four directional keys. See the source code of `withWindowNavigation` for an example.

withWindowNavigation :: (KeySym, KeySym, KeySym, KeySym) -> XConfig l -> IO (XConfig l) Source #

withWindowNavigationKeys :: [((KeyMask, KeySym), WNAction)] -> XConfig l -> IO (XConfig l) Source #

data WNAction Source #

Constructors

WNGo Direction2D |
WNSwap Direction2D |

go :: IORef WNState -> Direction2D -> X () Source #

swap :: IORef WNState -> Direction2D -> X () Source #

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 Source # maxBound :: Direction2D Source #
Enum Direction2D Source # |

Instance details

Defined in XMonad.Util.Types

Methods

succ :: Direction2D -> Direction2D Source #

pred :: Direction2D -> Direction2D Source #

toEnum :: Int -> Direction2D Source #

fromEnum :: Direction2D -> Int Source #

enumFrom :: Direction2D -> [Direction2D] Source #

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

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

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

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

Instance details

Defined in XMonad.Util.Types

Methods

compare :: Direction2D -> Direction2D -> Ordering Source #

(<) :: Direction2D -> Direction2D -> Bool Source #

(<=) :: Direction2D -> Direction2D -> Bool Source #

(>) :: Direction2D -> Direction2D -> Bool Source #

(>=) :: Direction2D -> Direction2D -> Bool Source #

max :: Direction2D -> Direction2D -> Direction2D Source #

min :: Direction2D -> Direction2D -> Direction2D Source #

type WNState = Map WorkspaceId Point Source #