| xmonad-contrib-0.8.1: Third party extensions for xmonad | Source code | Contents | Index

XMonad.Hooks.ManageDocks

Portability | unportable
Stability | unstable
Maintainer | Joachim Breitner <mail@joachim-breitner.de>

Contents

Usage

Description
This module provides tools to automatically manage dock type programs, such as gnome-panel, kicker, dzen, and xmobar.
Synopsis

manageDocks :: ManageHook
checkDock :: Query Bool
data AvoidStruts a
avoidStruts :: LayoutClass l a => l a -> ModifiedLayout AvoidStruts l a
avoidStrutsOn :: LayoutClass l a => [Direction] -> l a -> ModifiedLayout AvoidStruts l a

data ToggleStruts

= ToggleStruts
| ToggleStrut Direction

data Direction

= U
| D
| R
| L

Usage

To use this module, add the following import to `~/.xmonad/xmonad.hs`:

     import XMonad.Hooks.ManageDocks

The first component is a `ManageHook` which recognizes these windows and de-manages them, so that xmonad does not try to tile them. To enable it:

     manageHook = ... <+> manageDocks

The second component is a layout modifier that prevents windows from overlapping these dock windows. It is intended to replace xmonad's so-called "gap" support. First, you must add it to your list of layouts:

     layoutHook = avoidStruts (tall ||| mirror tall ||| ...)
                       where  tall = Tall 1 (3/100) (1/2)

`AvoidStruts` also supports toggling the dock gaps; add a keybinding similar to:

     ,((modMask x, xK_b     ), sendMessage ToggleStruts)

If you have multiple docks, you can toggle their gaps individually. For example, to toggle only the top gap:

     ,((modMask x .|. controlMask, xK_t), sendMessage $ ToggleStrut U)

Similarly, you can use `D`, `L`, and `R` to individually toggle gaps on the bottom, left, or right.

If you want certain docks to be avoided but others to be covered by default, you can manually specify the sides of the screen on which docks should be avoided, using `avoidStrutsOn`. For example:

     layoutHook = avoidStrutsOn [U,L] (tall ||| mirror tall ||| ...)

Important note: if you are switching from manual gaps (defaultGaps in your config) to avoidStruts (recommended, since manual gaps will probably be phased out soon), be sure to switch off all your gaps (with mod-b) before reloading your config with avoidStruts! Toggling struts with a `ToggleStruts` message will not work unless your gaps are set to zero.

For detailed instructions on editing your key bindings, see XMonad.Doc.Extending.

manageDocks :: ManageHook | Source

Detects if the given window is of type DOCK and if so, reveals it, but does not manage it. If the window has the STRUT property set, adjust the gap accordingly.

checkDock :: Query Bool | Source

Checks if a window is a DOCK or DESKTOP window

data AvoidStruts a | Source

Instances

LayoutModifier AvoidStruts a
Read (AvoidStruts a)
Show (AvoidStruts a)

avoidStruts :: LayoutClass l a => l a -> ModifiedLayout AvoidStruts l a | Source

Adjust layout automagically: don't cover up any docks, status bars, etc.

avoidStrutsOn :: LayoutClass l a => [Direction] -> l a -> ModifiedLayout AvoidStruts l a | Source

Adjust layout automagically: don't cover up docks, status bars, etc. on the indicated sides of the screen. Valid sides are U (top), D (bottom), R (right), or L (left).

data ToggleStruts | Source

Message type which can be sent to an `AvoidStruts` layout modifier to alter its behavior.
Constructors

ToggleStruts |
ToggleStrut Direction |

Instances

Read ToggleStruts
Show ToggleStruts
Typeable ToggleStruts
Message ToggleStruts

data Direction | Source

An enumeration of the four cardinal directions/sides of the screen. Ideally this would go in its own separate module in Util, but ManageDocks is angling for inclusion into the xmonad core, so keep the dependencies to a minimum.
Constructors

U | Up/top
D | Down/bottom
R | Right
L | Left

Instances

Bounded Direction
Enum Direction
Eq Direction
Ord Direction
Read Direction
Show Direction

Produced by Haddock version 2.4.2