xmonad-contrib-0.13: Third party extensions for xmonad

Copyright | (c) Braden Shepherdson 2008
License | BSD-style (as xmonad)
Maintainer | Braden.Shepherdson@gmail.com
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Hooks.DynamicHooks

Contents

- Usage

Description

One-shot and permanent ManageHooks that can be updated at runtime.

Synopsis

- dynamicMasterHook :: ManageHook
- addDynamicHook :: ManageHook -> X ()
- updateDynamicHook :: (ManageHook -> ManageHook) -> X ()
- oneShotHook :: Query Bool -> ManageHook -> X ()

# Usage

Provides two new kinds of `ManageHooks` that can be defined at runtime.

- One-shot `ManageHooks` that are deleted after they execute.
- Permanent `ManageHooks` (unless you want to destroy them)

Note that you will lose all dynamically defined `ManageHook`s when you `mod+q`! If you want them to last, you should create them as normal in your `xmonad.hs`.

To use this module, add `dynamicMasterHook` to your `manageHook`:

    xmonad { manageHook = myManageHook <+> dynamicMasterHook }

You can then use the supplied functions in your keybindings:

    ((modMask,xK_a), oneShotHook (className =? "example") doFloat)

dynamicMasterHook :: ManageHook #

Master `ManageHook` that must be in your `xmonad.hs` `ManageHook`.

addDynamicHook :: ManageHook -> X () #

Appends the given `ManageHook` to the permanent dynamic `ManageHook`.

updateDynamicHook :: (ManageHook -> ManageHook) -> X () #

Modifies the permanent `ManageHook` with an arbitrary function.

oneShotHook :: Query Bool -> ManageHook -> X () #

Creates a one-shot `ManageHook`. Note that you have to specify the two parts of the `ManageHook` separately. Where you would usually write:

    className =? "example" --> doFloat

you must call `oneShotHook` as

    oneShotHook dynHooksRef (className =? "example) doFloat