xmonad-contrib-0.11.2: Third party extensions for xmonad

Portability | not portable
Stability | unstable
Maintainer | jan.vornberger@informatik.uni-oldenburg.de
Safe Haskell | None

XMonad.Hooks.PositionStoreHooks

Contents

- Usage

Description

This module contains two hooks for the PositionStore (see XMonad.Util.PositionStore) - a ManageHook and an EventHook.

The ManageHook can be used to fill the PositionStore with position and size information about new windows. The advantage of using this hook is, that the information is recorded independent of the currently active layout. So the floating shape of the window can later be restored even if it was opened in a tiled layout initially.

For windows, that do not request a particular position, a random position will be assigned. This prevents windows from piling up exactly on top of each other.

The EventHook makes sure that windows are deleted from the PositionStore when they are closed.

Synopsis

- positionStoreManageHook :: Maybe Theme -> ManageHook
- positionStoreEventHook :: Event -> X All

# Usage

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

     import XMonad.Hooks.PositionStoreHooks

and adding `positionStoreManageHook` to your `ManageHook` as well as `positionStoreEventHook` to your event hooks. To be accurate about window sizes, the module needs to know if any decoration is in effect. This is specified with the first argument: Supply `Nothing` for no decoration, otherwise use 'Just defaultTheme' or similar to inform the module about the decoration theme used.

     myManageHook = positionStoreManageHook Nothing <+> manageHook defaultConfig
     myHandleEventHook = positionStoreEventHook

     main = xmonad defaultConfig { manageHook = myManageHook
                                 , handleEventHook = myHandleEventHook
                                 }

positionStoreManageHook :: Maybe Theme -> ManageHook Source

positionStoreEventHook :: Event -> X All Source