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

Copyright | (c) 2022 L. S. Leary
License | BSD3-style (see LICENSE)
Maintainer | @LSLeary (on github)
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Actions.MostRecentlyUsed

Contents

- Usage
- Interface

Description

Based on the Alt+Tab behaviour common outside of xmonad.

Synopsis

- configureMRU :: XConfig l -> XConfig l
- mostRecentlyUsed :: [KeySym] -> KeySym -> X ()
- withMostRecentlyUsed :: [KeySym] -> KeySym -> (Window -> Location -> X ()) -> X ()
- data Location = Location {
  - workspace :: !WorkspaceId
  - screen :: !ScreenId
  }

# Usage

`configureMRU` must be applied to your config in order for `mostRecentlyUsed` to work.

    main :: IO ()
    main = xmonad . configureMRU . ... $ def
      { ...
      }

Once that's done, it can be used normally in keybinds:

    , ((mod1Mask, xK_Tab), mostRecentlyUsed [xK_Alt_L, xK_Alt_R] xK_Tab)

N.B.: This example assumes that `mod1Mask` corresponds to alt, which is not always the case, depending on how your system is configured.

# Interface

configureMRU :: XConfig l -> XConfig l Source #

Configure xmonad to support `mostRecentlyUsed`.

mostRecentlyUsed Source #

Arguments

:: [KeySym] | The `KeySym`s corresponding to the modifier to which the action is bound.
-> KeySym | The `KeySym` corresponding to the key to which the action is bound.
-> X () |

An action to browse through the history of focused windows, taking another step back with each tap of the key.

withMostRecentlyUsed Source #

Arguments

:: [KeySym] | The `KeySym`s corresponding to the modifier to which the action is bound.
-> KeySym | The `KeySym` corresponding to the key to which the action is bound.
-> (Window -> Location -> X ()) | The function applied to each window.
-> X () |

A version of `mostRecentlyUsed` that allows you to customise exactly what is done with each window you tab through (the default being to visit its previous `Location` and give it focus).

data Location Source #

Constructors

Location |

Fields

- workspace :: !WorkspaceId
- screen :: !ScreenId

#### Instances

Instances details

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