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

Copyright | (c) 2007 Andrea Rossato 2009 Jan Vornberger 2023 Ilya Portnov
License | BSD-style (see xmonad/LICENSE)
Maintainer | portnov84@rambler.ru
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Layout.DecorationEx.LayoutModifier

Contents

- Usage

Description

Layout modifier, which is responsible for creation of decoration rectangles (windows), updating and removing them when needed. It is parameterized by `DecorationGeometry`, which says where decorations should be placed, and by `DecorationEngine`, which says how decorations should look.

Synopsis

- decorationEx :: (DecorationEngine engine widget a, DecorationGeometry geom a, Shrinker shrinker) => shrinker -> Theme engine widget -> engine widget a -> geom a -> l a -> ModifiedLayout (DecorationEx engine widget geom shrinker) l a
- data DecorationEx engine widget geom shrinker a

# Usage

This module exports `decorationEx` function, which is a generic function for adding decorations to your layouts. It can be used to use different decoration geometries and engines in any combination. For most used combinations, there are convenience functions in XMonad.Layout.DecorationEx.TextEngine, XMonad.Layout.DecorationEx.TabbedGeometry, and XMonad.Layout.DecorationEx.DwmGeometry.

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

    import XMonad.Layout.DecorationEx.LayoutModifier

Then edit your `layoutHook` by adding the DwmStyle decoration to your layout:

    myL = decorationEx shrinkText myTheme myEngine myGeometry (layoutHook def)
            where
              myGeometry = DefaultGeometry -- or another geometry type
              myEngine = TextDecoration    -- or another decoration engine
              myTheme = GenericTheme {...} -- theme type should correspond to selected engine type

    main = xmonad def { layoutHook = myL }

For more detailed instructions on editing the layoutHook see:

XMonad.Doc.Extending

decorationEx Source #

Arguments

:: (DecorationEngine engine widget a, DecorationGeometry geom a, Shrinker shrinker) |
=> shrinker | Strings shrinker, for example `shrinkText`
-> Theme engine widget | Decoration theme
-> engine widget a | Decoration engine instance
-> geom a | Decoration geometry instance
-> l a | Underlying layout to be decorated
-> ModifiedLayout (DecorationEx engine widget geom shrinker) l a |

Apply a DecorationEx modifier to an underlying layout

data DecorationEx engine widget geom shrinker a Source #

The `DecorationEx` `LayoutModifier`. This data type is an instance of the `LayoutModifier` class. This data type will be passed, together with a layout, to the `ModifiedLayout` type constructor to modify the layout by adding decorations according to a `DecorationEngine`.

#### Instances

Instances details

(DecorationEngine engine widget Window, DecorationGeometry geom Window, Shrinker shrinker) => LayoutModifier (DecorationEx engine widget geom shrinker) Window Source #

The long `LayoutModifier` instance for the `DecorationEx` type.

In `redoLayout` we check the state: if there is no state we initialize it.

The state is `diff`ed against the list of windows produced by the underlying layout: removed windows get deleted and new ones decorated by `createDecos`, which will call `decorate` to decide if a window must be given a `Rectangle`, in which case a decoration window will be created.

After that we resync the updated state with the windows' list and then we process the resynced stated (as we do with a new state).

First we map the decoration windows, we update each decoration to reflect any decorated window's change, and we insert, in the list of windows and rectangles returned by the underlying layout, the decoration for each window. This way xmonad will restack the decorations and their windows accordingly. At the end we remove invisible/stacked windows.

Message handling is quite simple: when needed we release the state component of the `DecorationEx` `LayoutModifier`. Otherwise we call `handleEvent`, which will call the appropriate `DecorationEngine` methods to perform its tasks.

Instance details

Defined in XMonad.Layout.DecorationEx.LayoutModifier

Methods

modifyLayout :: LayoutClass l Window => DecorationEx engine widget geom shrinker Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) Source #

modifyLayoutWithUpdate :: LayoutClass l Window => DecorationEx engine widget geom shrinker Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (DecorationEx engine widget geom shrinker Window)) Source #

handleMess :: DecorationEx engine widget geom shrinker Window -> SomeMessage -> X (Maybe (DecorationEx engine widget geom shrinker Window)) Source #

handleMessOrMaybeModifyIt :: DecorationEx engine widget geom shrinker Window -> SomeMessage -> X (Maybe (Either (DecorationEx engine widget geom shrinker Window) SomeMessage)) Source #

pureMess :: DecorationEx engine widget geom shrinker Window -> SomeMessage -> Maybe (DecorationEx engine widget geom shrinker Window) Source #

redoLayout :: DecorationEx engine widget geom shrinker Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (DecorationEx engine widget geom shrinker Window)) Source #

pureModifier :: DecorationEx engine widget geom shrinker Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (DecorationEx engine widget geom shrinker Window)) Source #

hook :: DecorationEx engine widget geom shrinker Window -> X () Source #

unhook :: DecorationEx engine widget geom shrinker Window -> X () Source #

modifierDescription :: DecorationEx engine widget geom shrinker Window -> String Source #

modifyDescription :: LayoutClass l Window => DecorationEx engine widget geom shrinker Window -> l Window -> String Source #

(Read (Theme engine widget), Read shrinker, Read (engine widget a), Read (geom a)) => Read (DecorationEx engine widget geom shrinker a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.LayoutModifier Methods readsPrec :: Int -> ReadS (DecorationEx engine widget geom shrinker a) Source # readList :: ReadS [DecorationEx engine widget geom shrinker a] Source # readPrec :: ReadPrec (DecorationEx engine widget geom shrinker a) Source # readListPrec :: ReadPrec [DecorationEx engine widget geom shrinker a] Source #
(Show (Theme engine widget), Show shrinker, Show (engine widget a), Show (geom a)) => Show (DecorationEx engine widget geom shrinker a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.LayoutModifier Methods showsPrec :: Int -> DecorationEx engine widget geom shrinker a -> ShowS Source # show :: DecorationEx engine widget geom shrinker a -> String Source # showList :: [DecorationEx engine widget geom shrinker a] -> ShowS Source #