XMonad.Layout.DecorationEx.LayoutModifier

xmonad-contrib-0.18.1: 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 | None
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 :: Type -> Type -> Type) widget (geom :: Type -> Type) 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 #

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 :: Type -> Type -> Type) widget (geom :: Type -> Type) shrinker a #

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 # | 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)) # 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)) # handleMess :: DecorationEx engine widget geom shrinker Window -> SomeMessage -> X (Maybe (DecorationEx engine widget geom shrinker Window)) # handleMessOrMaybeModifyIt :: DecorationEx engine widget geom shrinker Window -> SomeMessage -> X (Maybe (Either (DecorationEx engine widget geom shrinker Window) SomeMessage)) # pureMess :: DecorationEx engine widget geom shrinker Window -> SomeMessage -> Maybe (DecorationEx engine widget geom shrinker Window) # redoLayout :: DecorationEx engine widget geom shrinker Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (DecorationEx engine widget geom shrinker Window)) # pureModifier :: DecorationEx engine widget geom shrinker Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (DecorationEx engine widget geom shrinker Window)) # hook :: DecorationEx engine widget geom shrinker Window -> X () # unhook :: DecorationEx engine widget geom shrinker Window -> X () # modifierDescription :: DecorationEx engine widget geom shrinker Window -> String # modifyDescription :: LayoutClass l Window => DecorationEx engine widget geom shrinker Window -> l Window -> String #
(Read (Theme engine widget), Read shrinker, Read (engine widget a), Read (geom a)) => Read (DecorationEx engine widget geom shrinker a) # |
Instance details Defined in XMonad.Layout.DecorationEx.LayoutModifier Methods readsPrec :: Int -> ReadS (DecorationEx engine widget geom shrinker a) # readList :: ReadS [DecorationEx engine widget geom shrinker a] # readPrec :: ReadPrec (DecorationEx engine widget geom shrinker a) # readListPrec :: ReadPrec [DecorationEx engine widget geom shrinker a] #
(Show (Theme engine widget), Show shrinker, Show (engine widget a), Show (geom a)) => Show (DecorationEx engine widget geom shrinker a) # |
Instance details Defined in XMonad.Layout.DecorationEx.LayoutModifier Methods showsPrec :: Int -> DecorationEx engine widget geom shrinker a -> ShowS # show :: DecorationEx engine widget geom shrinker a -> String # showList :: [DecorationEx engine widget geom shrinker a] -> ShowS #