XMonad.Layout.MessageControl

xmonad-contrib-0.12: Third party extensions for xmonad

Copyright | (c) 2008 Quentin Moser
License | BSD3
Maintainer | orphaned
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Layout.MessageControl

Contents

- Usage

Description

Provides message "escaping" and filtering facilities which help control complex nested layouts.

Synopsis

- data Ignore m l w
- ignore :: (Message m, LayoutClass l w) => m -> l w -> Ignore m l w
- data UnEscape w
- unEscape :: LayoutClass l w => l w -> ModifiedLayout UnEscape l w
- newtype EscapedMessage = Escape SomeMessage
- escape :: Message m => m -> EscapedMessage

# Usage

You can use this module by importing it into your `~/.xmonad/xmonad.hs` file:

    import XMonad.Layout.MessageEscape

Then, if you use a modified layout where the modifier would intercept a message, but you'd want to be able to send it to the inner layout only, add the `unEscape` modifier to the inner layout like so:

    import XMonad.Layout.Master (mastered)
    import XMonad.Layout.Tabbed (simpleTabbed)
    import XMonad.Layout.LayoutCombinators ((|||))

    myLayout = Tall ||| unEscape (mastered 0.01 0.5 $ Full ||| simpleTabbed)

you can now send a message to the inner layout with `sendMessage $ escape message`, e.g.

    -- Change the inner layout
    ((modm .|. controlMask, xK_space), sendMessage $ escape NextLayout)

If you want unescaped messages to be handled only by the enclosing layout, use the `ignore` modifier:

    myLayout = Tall ||| (ignore NextLayout $ ignore (JumpToLayout "") $
                          unEscape $ mastered 0.01 0.5
                            $ Full ||| simpleTabbed)

IMPORTANT NOTE: The standard '(|||)' operator from XMonad.Layout does not behave correctly with `ignore`. Make sure you use the one from XMonad.Layout.LayoutCombinators.

data Ignore m l w

the Ignore layout modifier. Prevents its inner layout from receiving messages of a certain type.

Instances

(Message m, LayoutClass l w) => LayoutClass (Ignore m l) w |
Read (l w) => Read (Ignore m l w) |
Show (l w) => Show (Ignore m l w) |

ignore :: (Message m, LayoutClass l w) => m -> l w -> Ignore m l w

Applies the Ignore layout modifier to a layout, blocking all messages of the same type as the one passed as its first argument.

data UnEscape w

the UnEscape layout modifier. Listens to `EscapedMessage`s and sends their nested message to the inner layout.

Instances

LayoutModifier UnEscape a |
Read (UnEscape w) |
Show (UnEscape w) |

unEscape :: LayoutClass l w => l w -> ModifiedLayout UnEscape l w

Applies the UnEscape layout modifier to a layout.

newtype EscapedMessage

Data type for an escaped message. Send with `escape`.

Constructors

Escape SomeMessage |

Instances

Message EscapedMessage |

escape :: Message m => m -> EscapedMessage

Creates an `EscapedMessage`.