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

Copyright | (c) 2021 Xiaokui Shu
License | BSD-style (see LICENSE)
Maintainer | subbyte@gmail.com
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Util.ActionQueue

Contents

- Usage

Description

Put XMonad actions in the queue to be executed in either the `logHook` or another hook of your choice.

Synopsis

- data ActionQueue
- actionQueue :: forall (l :: Type -> Type). XConfig l -> XConfig l
- enqueue :: X () -> X ()
- exequeue :: X ()

# Usage

This module provides a queue that, by default, gets executed every time the `logHook` runs. To use this module

1. Enqueue `X ()` actions at the place you need; e.g.:

    enqueue myAction

1. Add the `actionQueue` combinator to your configuration:

    main = xmonad $ actionQueue $ def
        { ... }

This will execute all of the actions in the queue (if any) every time the `logHook` runs. Developers of other extensions using this module should re-export `actionQueue`.

Alternatively, you can directly add `exequeue` to a hook of your choice. This is discouraged when writing user-facing modules, as (accidentally) adding `exequeue` to two different hooks might lead to undesirable behaviour. `actionQueue` uses the XMonad.Util.ExtensibleConf interface to circumvent this.

data ActionQueue #

#### Instances

Instances details

ExtensionClass ActionQueue # |
Instance details Defined in XMonad.Util.ActionQueue Methods initialValue :: ActionQueue # extensionType :: ActionQueue -> StateExtension #

actionQueue :: forall (l :: Type -> Type). XConfig l -> XConfig l #

Every time the `logHook` runs, execute all actions in the queue.

enqueue :: X () -> X () #

Enqueue an action.

exequeue :: X () #

Execute every action in the queue.