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 |
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:
:: (DecorationEngine engine widget a, DecorationGeometry geom a, Shrinker shrinker) | |
=> shrinker | Strings shrinker, for example |
-> 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 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
(DecorationEngine engine widget Window, DecorationGeometry geom Window, Shrinker shrinker) => LayoutModifier (DecorationEx engine widget geom shrinker) Window Source # | The long In The state is 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 |
Defined in XMonad.Layout.DecorationEx.LayoutModifier 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 # | |
Defined in XMonad.Layout.DecorationEx.LayoutModifier 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) Source # | |
Defined in XMonad.Layout.DecorationEx.LayoutModifier 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 # |