xmonad-contrib-0.8: Third party extensions for xmonadSource codeContentsIndex
XMonad.Actions.WindowNavigation
MaintainerDevin Mullins <me@twifkak.com>
Contents
Usage
Description

License : BSD3-style (see LICENSE)

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 Direction
| WNSwap Direction
go :: IORef WNState -> Direction -> X ()
swap :: IORef WNState -> Direction -> X ()
data Direction
= U
| D
| R
| L
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)
             $ defaultConfig { ... }
     xmonad config

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 Direction
WNSwap Direction
go :: IORef WNState -> Direction -> X ()Source
swap :: IORef WNState -> Direction -> X ()Source
data Direction Source

An enumeration of the four cardinal directions/sides of the screen.

Ideally this would go in its own separate module in Util, but ManageDocks is angling for inclusion into the xmonad core, so keep the dependencies to a minimum.

Constructors
UUp/top
DDown/bottom
RRight
LLeft
show/hide Instances
Produced by Haddock version 2.3.0