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

Copyright | (c) 2022 Martin Kozlovsky
License | BSD3-style (see LICENSE)
Maintainer | <kozlovsky.m7@gmail.com>
Stability | unstable
Portability | not portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Actions.RepeatAction

Contents

- Usage

Description

Ability to repeat the last action.

Synopsis

- rememberAction :: X () -> X ()
- rememberActions :: a -> [(a, X ())] -> [(a, X ())]
- repeatLast :: X ()

# Usage

You can use this module with the following in your `xmonad.hs`:

    import XMonad.Actions.RepeatAction

Then join a dedicated key to run the last action with the rest of your key bindings using the `rememberActions`:

    rememberActions (modm, xK_period) [((modm, xK_c), kill), …]

It can be also used in the same way for XMonad.Util.EZConfig:

    rememberActions "M-." [("M-c", kill), …]

For example, if you use `additionalKeysP`,

    main = xmonad $ … $ def
      {
        …
      }
     `additionalKeysP` myKeys

you would adjust the call to `additionalKeysP` like so:

    `additionalKeysP` (rememberActions "M-." myKeys)

For more detailed instructions on editing your key bindings, see the tutorial.

rememberAction :: X () -> X () #

Transforms an action into an action that can be remembered and repeated.

rememberActions :: a -> [(a, X ())] -> [(a, X ())] infixl 4 #

Maps `rememberAction` over a list of key bindings and adds a dedicated key to repeat the last action.

repeatLast :: X () #

Runs the last remembered action. Be careful not to include this action in the remembered actions!