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

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

XMonad.Layout.MessageControl

Contents

- Usage

Description

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

Synopsis

- data Ignore m (l :: Type -> Type) 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.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)

    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)

data Ignore m (l :: Type -> Type) w Source #

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

#### Instances

Instances details

(Message m, LayoutClass l w) => LayoutClass (Ignore m l) w Source # |

Instance details

Defined in XMonad.Layout.MessageControl

Methods

runLayout :: Workspace WorkspaceId (Ignore m l w) w -> Rectangle -> X ([(w, Rectangle)], Maybe (Ignore m l w)) Source #

doLayout :: Ignore m l w -> Rectangle -> Stack w -> X ([(w, Rectangle)], Maybe (Ignore m l w)) Source #

pureLayout :: Ignore m l w -> Rectangle -> Stack w -> [(w, Rectangle)] Source #

emptyLayout :: Ignore m l w -> Rectangle -> X ([(w, Rectangle)], Maybe (Ignore m l w)) Source #

handleMessage :: Ignore m l w -> SomeMessage -> X (Maybe (Ignore m l w)) Source #

pureMessage :: Ignore m l w -> SomeMessage -> Maybe (Ignore m l w) Source #

description :: Ignore m l w -> String Source #

Read (l w) => Read (Ignore m l w) Source # |
Instance details Defined in XMonad.Layout.MessageControl Methods readsPrec :: Int -> ReadS (Ignore m l w) Source # readList :: ReadS [Ignore m l w] Source # readPrec :: ReadPrec (Ignore m l w) Source # readListPrec :: ReadPrec [Ignore m l w] Source #
Show (l w) => Show (Ignore m l w) Source # |
Instance details Defined in XMonad.Layout.MessageControl Methods showsPrec :: Int -> Ignore m l w -> ShowS Source # show :: Ignore m l w -> String Source # showList :: [Ignore m l w] -> ShowS Source #

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

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 Source #

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

#### Instances

Instances details

LayoutModifier UnEscape a Source # |

Instance details

Defined in XMonad.Layout.MessageControl

Methods

modifyLayout :: LayoutClass l a => UnEscape a -> Workspace WorkspaceId (l a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (l a)) Source #

modifyLayoutWithUpdate :: LayoutClass l a => UnEscape a -> Workspace WorkspaceId (l a) a -> Rectangle -> X (([(a, Rectangle)], Maybe (l a)), Maybe (UnEscape a)) Source #

handleMess :: UnEscape a -> SomeMessage -> X (Maybe (UnEscape a)) Source #

handleMessOrMaybeModifyIt :: UnEscape a -> SomeMessage -> X (Maybe (Either (UnEscape a) SomeMessage)) Source #

pureMess :: UnEscape a -> SomeMessage -> Maybe (UnEscape a) Source #

redoLayout :: UnEscape a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (UnEscape a)) Source #

pureModifier :: UnEscape a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> ([(a, Rectangle)], Maybe (UnEscape a)) Source #

hook :: UnEscape a -> X () Source #

unhook :: UnEscape a -> X () Source #

modifierDescription :: UnEscape a -> String Source #

modifyDescription :: LayoutClass l a => UnEscape a -> l a -> String Source #

Read (UnEscape w) Source # |
Instance details Defined in XMonad.Layout.MessageControl Methods readsPrec :: Int -> ReadS (UnEscape w) Source # readList :: ReadS [UnEscape w] Source # readPrec :: ReadPrec (UnEscape w) Source # readListPrec :: ReadPrec [UnEscape w] Source #
Show (UnEscape w) Source # |
Instance details Defined in XMonad.Layout.MessageControl Methods showsPrec :: Int -> UnEscape w -> ShowS Source # show :: UnEscape w -> String Source # showList :: [UnEscape w] -> ShowS Source #

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

Applies the UnEscape layout modifier to a layout.

newtype EscapedMessage Source #

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

Constructors

Escape SomeMessage |

#### Instances

Instances details

Message EscapedMessage Source # |
Instance details Defined in XMonad.Layout.MessageControl

escape :: Message m => m -> EscapedMessage Source #

Creates an `EscapedMessage`.