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

Contents

- Usage:
- Standard decoration settings
- Decoration-related types
- Theme types
- Widget types
- Utility functions for themes
- Convinience re-exports
- Standard widgets

Description

This set of modules contains a set of type classes and their implementations which define a flexible and extensible mechanism of window decorations.

Click here for a larger version.

Within this mechanism, there are the following entities which define how decorations will look and work:

- Main object is `DecorationEx` layout modifier. It is from where everything starts. It creates, shows and hides decoration windows (rectangles) when needed. It is parameterized with decoration geometry, decoration engine and theme. It calls these components to do their parts of the work.
- `DecorationGeometry` defines where decoration rectangles should be placed. For example, standard horizontal bar above each window; or tab bar.
- `DecorationEngine` defines how decorations look and how they react on clicks. Different implementations of the decoration engine can use different APIs to draw decorations. Within this package, there is one implementation (`TextDecoration`), which uses plain Xlib calls, and displays decoration widgets with text fragments, like `[X]` or `[_]`. Other engines can, for example, use the Cairo library to draw nice gradients and image-based widgets.
- A Decoration widget is an element placed on a window decoration. It defines how it looks and how it responds to clicks. Examples include usual window buttons (minimize, maximize, close), window icon, window title.
- A Decoration theme defines colors and fonts for the decoration engine. It also contains a list of decoration widgets and says where to place them (at the left, at the right or in the center).

This mechanism makes major use of parameterized data types and type families, in order to make it possible to define different types of decorations, and easily combine different aspects of decorations. For example, each decoration engine can be combined with each decoration geometry.

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
- textDecoration :: Shrinker shrinker => shrinker -> Theme TextDecoration StandardWidget -> l Window -> ModifiedLayout (DecorationEx TextDecoration StandardWidget DefaultGeometry shrinker) l Window
- textTabbed :: Shrinker shrinker => shrinker -> ThemeEx StandardWidget -> l Window -> ModifiedLayout (DecorationEx TextDecoration StandardWidget TabbedGeometry shrinker) l Window
- dwmStyleDeco :: Shrinker shrinker => shrinker -> ThemeEx StandardWidget -> l Window -> ModifiedLayout (DecorationEx TextDecoration StandardWidget DwmGeometry shrinker) l Window
- data TextDecoration widget a = TextDecoration
- newtype DefaultGeometry a = DefaultGeometry {
  - gDecorationHeight :: Dimension
  }
- data TabbedGeometry a
  - = HorizontalTabs {
    - showIfSingleWindow :: !SingleTabMode
    - hTabPlacement :: !HorizontalTabPlacement
    - hTabAlignment :: !HorizontalTabsAlignment
    - hTabWidth :: !HorizontalTabWidth
    - hTabHeight :: !Dimension
    }
  - | VerticalTabs {
    - showIfSingleWindow :: !SingleTabMode
    - vTabPlacement :: !VerticalTabPlacement
    - vTabWidth :: !Dimension
    - vTabHeight :: !Dimension
    }
- data DwmGeometry a = DwmGeometry {
  - dwmShowForFocused :: !Bool
  - dwmHorizontalPosition :: !Rational
  - dwmDecoHeight :: !Dimension
  - dwmDecoWidth :: !Dimension
  }
- data DecorationEx engine widget geom shrinker a
- data BoxBorders a = BoxBorders {
  - bxTop :: !a
  - bxRight :: !a
  - bxBottom :: !a
  - bxLeft :: !a
  }
- type BorderColors = BoxBorders String
- data SimpleStyle = SimpleStyle {
  - sBgColor :: !String
  - sTextColor :: !String
  - sTextBgColor :: !String
  - sDecoBorderWidth :: !Dimension
  - sDecorationBorders :: !BorderColors
  }
- data GenericTheme style widget = GenericTheme {
  - exActive :: !style
  - exInactive :: !style
  - exUrgent :: !style
  - exPadding :: !(BoxBorders Dimension)
  - exFontName :: !String
  - exOnDecoClick :: !(Map Int (WidgetCommand widget))
  - exDragWindowButtons :: ![Int]
  - exWidgetsLeft :: ![widget]
  - exWidgetsCenter :: ![widget]
  - exWidgetsRight :: ![widget]
  }
- type ThemeEx widget = GenericTheme SimpleStyle widget
- data StandardCommand
  - = FocusWindow
  - | FocusUp
  - | FocusDown
  - | MoveToNextGroup
  - | MoveToPrevGroup
  - | DwmPromote
  - | ToggleSticky
  - | ToggleMaximize
  - | Minimize
  - | CloseWindow
  - | GridWindowMenu
- data GenericWidget cmd
  - = TitleWidget
  - | WindowIcon {
    - swCommand :: !cmd
    }
  - | GenericWidget {
    - swCheckedText :: !String
    - swUncheckedText :: !String
    - swCommand :: !cmd
    }
- type StandardWidget = GenericWidget StandardCommand
- themeEx :: Default (WidgetCommand widget) => Theme -> ThemeEx widget
- borderColor :: String -> BorderColors
- shadowBorder :: String -> String -> BorderColors
- class (Read s, Show s) => Shrinker s where
  - shrinkIt :: s -> String -> [String]
- shrinkText :: DefaultShrinker
- titleW :: StandardWidget
- toggleStickyW :: StandardWidget
- minimizeW :: StandardWidget
- maximizeW :: StandardWidget
- closeW :: StandardWidget
- dwmpromoteW :: StandardWidget
- moveToNextGroupW :: StandardWidget
- moveToPrevGroupW :: StandardWidget

# Usage:

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

    import XMonad.Layout.DecorationEx

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

    myTheme = ThemeEx {...}
    myL = textDecoration shrinkText myTheme (layoutHook def)
    main = xmonad def { layoutHook = myL }

For more detailed instructions on editing the layoutHook see:

XMonad.Doc.Extending

This module exports only some definitions from it's submodules, most likely to be used from user configurations. To define your own decoration types you will likely have to import specific submodules.

# Standard decoration settings

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

textDecoration Source #

Arguments

:: Shrinker shrinker |
=> shrinker | String shrinker, for example `shrinkText`
-> Theme TextDecoration StandardWidget | Decoration theme (font, colors, widgets, etc)
-> l Window | Layout to be decorated
-> ModifiedLayout (DecorationEx TextDecoration StandardWidget DefaultGeometry shrinker) l Window |

Add decoration to existing layout. Widgets are indicated by text fragments, like `"[+]"`. Geometry is simple: a horizontal panel at the top of each window, going for the full width of the window.

textTabbed Source #

Arguments

:: Shrinker shrinker |
=> shrinker | Strings shrinker, e.g. `shrinkText`
-> ThemeEx StandardWidget | Decoration theme
-> l Window | Layout to be decorated
-> ModifiedLayout (DecorationEx TextDecoration StandardWidget TabbedGeometry shrinker) l Window |

Add tabbed decorations (with default settings) with text-based widgets to a layout.

dwmStyleDeco Source #

Arguments

:: Shrinker shrinker |
=> shrinker | Strings shrinker, for example `shrinkText`
-> ThemeEx StandardWidget | Decoration theme (font, colors, widgets, etc)
-> l Window | Layout to be decorated
-> ModifiedLayout (DecorationEx TextDecoration StandardWidget DwmGeometry shrinker) l Window |

Add a decoration to window layout. Widgets are indicated with text fragments using TextDecoration; decoration placement is similar to DWM.

# Decoration-related types

data TextDecoration widget a Source #

Decoration engine data type

Constructors

TextDecoration |

#### Instances

Instances details

(TextWidget widget, ClickHandler (GenericTheme SimpleStyle) widget) => DecorationEngine TextDecoration widget Window Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.TextEngine

Associated Types

type Theme TextDecoration :: Type -> Type Source #

type DecorationPaintingContext TextDecoration Source #

type DecorationEngineState TextDecoration Source #

Methods

describeEngine :: TextDecoration widget Window -> String Source #

initializeState :: TextDecoration widget Window -> geom Window -> Theme TextDecoration widget -> X (DecorationEngineState TextDecoration) Source #

releaseStateResources :: TextDecoration widget Window -> DecorationEngineState TextDecoration -> X () Source #

calcWidgetPlace :: TextDecoration widget Window -> DrawData TextDecoration widget -> widget -> X WidgetPlace Source #

placeWidgets :: Shrinker shrinker => TextDecoration widget Window -> Theme TextDecoration widget -> shrinker -> DecorationEngineState TextDecoration -> Rectangle -> Window -> WidgetLayout widget -> X (WidgetLayout WidgetPlace) Source #

getShrinkedWindowName :: Shrinker shrinker => TextDecoration widget Window -> shrinker -> DecorationEngineState TextDecoration -> String -> Dimension -> Dimension -> X String Source #

decorationXEventMask :: TextDecoration widget Window -> EventMask Source #

propsToRepaintDecoration :: TextDecoration widget Window -> X [Atom] Source #

decorationEventHookEx :: Shrinker shrinker => TextDecoration widget Window -> Theme TextDecoration widget -> DecorationLayoutState TextDecoration -> shrinker -> Event -> X () Source #

handleDecorationClick :: TextDecoration widget Window -> Theme TextDecoration widget -> Rectangle -> [Rectangle] -> Window -> Int -> Int -> Int -> X Bool Source #

decorationWhileDraggingHook :: TextDecoration widget Window -> CInt -> CInt -> (Window, Rectangle) -> Position -> Position -> X () Source #

decorationAfterDraggingHook :: TextDecoration widget Window -> (Window, Rectangle) -> Window -> X () Source #

paintDecoration :: Shrinker shrinker => TextDecoration widget Window -> Window -> Dimension -> Dimension -> shrinker -> DrawData TextDecoration widget -> Bool -> X () Source #

paintWidget :: Shrinker shrinker => TextDecoration widget Window -> DecorationPaintingContext TextDecoration -> WidgetPlace -> shrinker -> DrawData TextDecoration widget -> widget -> Bool -> X () Source #

Read (TextDecoration widget a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.TextEngine Methods readsPrec :: Int -> ReadS (TextDecoration widget a) Source # readList :: ReadS [TextDecoration widget a] Source # readPrec :: ReadPrec (TextDecoration widget a) Source # readListPrec :: ReadPrec [TextDecoration widget a] Source #
Show (TextDecoration widget a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.TextEngine Methods showsPrec :: Int -> TextDecoration widget a -> ShowS Source # show :: TextDecoration widget a -> String Source # showList :: [TextDecoration widget a] -> ShowS Source #
type DecorationEngineState TextDecoration Source # |
Instance details Defined in XMonad.Layout.DecorationEx.TextEngine type DecorationEngineState TextDecoration = XMonadFont
type DecorationPaintingContext TextDecoration Source # |
Instance details Defined in XMonad.Layout.DecorationEx.TextEngine type DecorationPaintingContext TextDecoration = XPaintingContext
type Theme TextDecoration Source # |
Instance details Defined in XMonad.Layout.DecorationEx.TextEngine type Theme TextDecoration = GenericTheme SimpleStyle

newtype DefaultGeometry a Source #

Data type for default implementation of `DecorationGeometry`. This defines simple decorations: a horizontal bar at the top of each window, running for full width of the window.

Constructors

DefaultGeometry |

Fields

- gDecorationHeight :: Dimension

#### Instances

Instances details

Eq a => DecorationGeometry DefaultGeometry a Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.Geometry

Methods

describeGeometry :: DefaultGeometry a -> String Source #

shrinkWindow :: DefaultGeometry a -> Rectangle -> Rectangle -> Rectangle Source #

pureDecoration :: DefaultGeometry a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe Rectangle Source #

decorateWindow :: DefaultGeometry a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle) Source #

Read (DefaultGeometry a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Geometry Methods readsPrec :: Int -> ReadS (DefaultGeometry a) Source # readList :: ReadS [DefaultGeometry a] Source # readPrec :: ReadPrec (DefaultGeometry a) Source # readListPrec :: ReadPrec [DefaultGeometry a] Source #
Show (DefaultGeometry a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Geometry Methods showsPrec :: Int -> DefaultGeometry a -> ShowS Source # show :: DefaultGeometry a -> String Source # showList :: [DefaultGeometry a] -> ShowS Source #
Default (DefaultGeometry a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Geometry Methods def :: DefaultGeometry a #

data TabbedGeometry a Source #

Constructors

HorizontalTabs |

Fields

- showIfSingleWindow :: !SingleTabMode

  What to do if there is only one tab

- hTabPlacement :: !HorizontalTabPlacement

  Where to place horizontal tabs

- hTabAlignment :: !HorizontalTabsAlignment

  How to align horizontal tabs (makes sense with fixed width of tabs).

- hTabWidth :: !HorizontalTabWidth

  Width of horizontal tabs

- hTabHeight :: !Dimension

  Height of horizontal tabs

VerticalTabs |

Fields

- showIfSingleWindow :: !SingleTabMode

  What to do if there is only one tab

- vTabPlacement :: !VerticalTabPlacement

  Where to place vertical tabs

- vTabWidth :: !Dimension

  Width of vertical tabs

- vTabHeight :: !Dimension

  Height of vertical tabs

#### Instances

Instances details

DecorationGeometry TabbedGeometry Window Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.TabbedGeometry

Methods

describeGeometry :: TabbedGeometry Window -> String Source #

shrinkWindow :: TabbedGeometry Window -> Rectangle -> Rectangle -> Rectangle Source #

pureDecoration :: TabbedGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> Maybe Rectangle Source #

decorateWindow :: TabbedGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> X (Maybe Rectangle) Source #

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

data DwmGeometry a Source #

Decoration geometry data type

Constructors

DwmGeometry |

Fields

- dwmShowForFocused :: !Bool

  Whether to show decorations on focused windows

- dwmHorizontalPosition :: !Rational

  Horizontal position of decoration rectangle. 0 means place it at left corner, 1 - place it at right corner, `1%2` - place it at center.

- dwmDecoHeight :: !Dimension

  Height of decoration rectangle

- dwmDecoWidth :: !Dimension

  Width of decoration rectangle

#### Instances

Instances details

DecorationGeometry DwmGeometry Window Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.DwmGeometry

Methods

describeGeometry :: DwmGeometry Window -> String Source #

shrinkWindow :: DwmGeometry Window -> Rectangle -> Rectangle -> Rectangle Source #

pureDecoration :: DwmGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> Maybe Rectangle Source #

decorateWindow :: DwmGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> X (Maybe Rectangle) Source #

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

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 #

# Theme types

data BoxBorders a Source #

Generic data type which is used to describe characteristics of rectangle borders.

Constructors

BoxBorders |

Fields

- bxTop :: !a
- bxRight :: !a
- bxBottom :: !a
- bxLeft :: !a

#### Instances

Instances details

Read a => Read (BoxBorders a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods readsPrec :: Int -> ReadS (BoxBorders a) Source # readList :: ReadS [BoxBorders a] Source # readPrec :: ReadPrec (BoxBorders a) Source # readListPrec :: ReadPrec [BoxBorders a] Source #
Show a => Show (BoxBorders a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods showsPrec :: Int -> BoxBorders a -> ShowS Source # show :: BoxBorders a -> String Source # showList :: [BoxBorders a] -> ShowS Source #
Eq a => Eq (BoxBorders a) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods (==) :: BoxBorders a -> BoxBorders a -> Bool Source # (/=) :: BoxBorders a -> BoxBorders a -> Bool Source #

type BorderColors = BoxBorders String Source #

Convinience data type describing colors of decoration rectangle borders.

data SimpleStyle Source #

Data type describing look of window decoration in particular state (active or inactive)

Constructors

SimpleStyle |

Fields

- sBgColor :: !String

  Decoration background color

- sTextColor :: !String

  Text (foreground) color

- sTextBgColor :: !String

  Text background color

- sDecoBorderWidth :: !Dimension

  Width of border of decoration rectangle. Set to 0 to disable the border.

- sDecorationBorders :: !BorderColors

  Colors of borders of decoration rectangle.

#### Instances

Instances details

Read SimpleStyle Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods readsPrec :: Int -> ReadS SimpleStyle Source # readList :: ReadS [SimpleStyle] Source # readPrec :: ReadPrec SimpleStyle Source # readListPrec :: ReadPrec [SimpleStyle] Source #
Show SimpleStyle Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods showsPrec :: Int -> SimpleStyle -> ShowS Source # show :: SimpleStyle -> String Source # showList :: [SimpleStyle] -> ShowS Source #
Default (WidgetCommand widget) => Default (ThemeEx widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods def :: ThemeEx widget #
(Show widget, Read widget, Read (WidgetCommand widget), Show (WidgetCommand widget)) => ThemeAttributes (ThemeEx widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Associated Types type Style (ThemeEx widget) Source # Methods selectWindowStyle :: ThemeEx widget -> Window -> X (Style (ThemeEx widget)) Source # widgetsPadding :: ThemeEx widget -> BoxBorders Dimension Source # defaultBgColor :: ThemeEx widget -> String Source # themeFontName :: ThemeEx widget -> String Source #
ClickHandler (GenericTheme SimpleStyle) widget Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods onDecorationClick :: GenericTheme SimpleStyle widget -> Int -> Maybe (WidgetCommand widget) Source # isDraggingEnabled :: GenericTheme SimpleStyle widget -> Int -> Bool Source #
type Style (ThemeEx widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common type Style (ThemeEx widget) = SimpleStyle

data GenericTheme style widget Source #

Generic Theme data type. This is used by `TextEngine` and can be used by other relatively simple decoration engines.

Constructors

GenericTheme |

Fields

- exActive :: !style

  Decoration style for active (focused) windows

- exInactive :: !style

  Decoration style for inactive (unfocused) windows

- exUrgent :: !style

  Decoration style for urgent windows

- exPadding :: !(BoxBorders Dimension)

  Padding between decoration rectangle and widgets

- exFontName :: !String

  Font name

- exOnDecoClick :: !(Map Int (WidgetCommand widget))

  Correspondence between mouse button number and window command.

- exDragWindowButtons :: ![Int]

  For which mouse buttons dragging is enabled

- exWidgetsLeft :: ![widget]

  Widgets that should appear at the left of decoration rectangle (listed left to right)

- exWidgetsCenter :: ![widget]

  Widgets that should appear in the center of decoration rectangle (listed left to right)

- exWidgetsRight :: ![widget]

  Widgets that should appear at the right of decoration rectangle (listed left to right)

#### Instances

Instances details

Default (WidgetCommand widget) => Default (ThemeEx widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods def :: ThemeEx widget #
(Show widget, Read widget, Read (WidgetCommand widget), Show (WidgetCommand widget)) => ThemeAttributes (ThemeEx widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Associated Types type Style (ThemeEx widget) Source # Methods selectWindowStyle :: ThemeEx widget -> Window -> X (Style (ThemeEx widget)) Source # widgetsPadding :: ThemeEx widget -> BoxBorders Dimension Source # defaultBgColor :: ThemeEx widget -> String Source # themeFontName :: ThemeEx widget -> String Source #
ClickHandler (GenericTheme SimpleStyle) widget Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods onDecorationClick :: GenericTheme SimpleStyle widget -> Int -> Maybe (WidgetCommand widget) Source # isDraggingEnabled :: GenericTheme SimpleStyle widget -> Int -> Bool Source #
HasWidgets (GenericTheme style) widget Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods themeWidgets :: GenericTheme style widget -> WidgetLayout widget Source #
(Read widget, Read (WidgetCommand widget), Read style) => Read (GenericTheme style widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods readsPrec :: Int -> ReadS (GenericTheme style widget) Source # readList :: ReadS [GenericTheme style widget] Source # readPrec :: ReadPrec (GenericTheme style widget) Source # readListPrec :: ReadPrec [GenericTheme style widget] Source #
(Show widget, Show (WidgetCommand widget), Show style) => Show (GenericTheme style widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common Methods showsPrec :: Int -> GenericTheme style widget -> ShowS Source # show :: GenericTheme style widget -> String Source # showList :: [GenericTheme style widget] -> ShowS Source #
type Style (ThemeEx widget) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Common type Style (ThemeEx widget) = SimpleStyle

type ThemeEx widget = GenericTheme SimpleStyle widget Source #

Convience type for themes used by `TextDecoration`.

# Widget types

data StandardCommand Source #

Standard window commands.

One can extend this list by simply doing

    data MyWindowCommand =
        Std StandardCommand
      | SomeFancyCommand

    instance WindowCommand MyWindowCommand where ...

    type MyWidget = GenericWidget MyWindowCommand

Constructors

FocusWindow | Focus the window
FocusUp | Move focus to previous window
FocusDown | Move focus to following window
MoveToNextGroup | Move the window to the next group (see XMonad.Layout.Groups)
MoveToPrevGroup | Move the window to the previous group
DwmPromote | Execute `dwmpromote` (see XMonad.Actions.DwmPromote)
ToggleSticky | Make window sticky or unstick it (see XMonad.Actions.CopyWindow)
ToggleMaximize | Maximize or restore window (see XMonad.Layout.Maximize)
Minimize | Minimize window (see XMonad.Actions.Minimize)
CloseWindow | Close the window
GridWindowMenu | Show window menu via XMonad.Actions.GridSelect (see XMonad.Actions.WindowMenu)

#### Instances

Instances details

Read StandardCommand Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods readsPrec :: Int -> ReadS StandardCommand Source # readList :: ReadS [StandardCommand] Source # readPrec :: ReadPrec StandardCommand Source # readListPrec :: ReadPrec [StandardCommand] Source #
Show StandardCommand Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods showsPrec :: Int -> StandardCommand -> ShowS Source # show :: StandardCommand -> String Source # showList :: [StandardCommand] -> ShowS Source #
Default StandardCommand Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods def :: StandardCommand #
Eq StandardCommand Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods (==) :: StandardCommand -> StandardCommand -> Bool Source # (/=) :: StandardCommand -> StandardCommand -> Bool Source #
WindowCommand StandardCommand Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods executeWindowCommand :: StandardCommand -> Window -> X Bool Source # isCommandChecked :: StandardCommand -> Window -> X Bool Source #
TextWidget StandardWidget Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods widgetString :: forall (engine :: Type -> Type -> Type). DrawData engine StandardWidget -> StandardWidget -> X String Source #

data GenericWidget cmd Source #

Generic data type for decoration widgets.

Constructors

TitleWidget | Window title (just text label)
WindowIcon | Window icon with some associated command | Other widgets

Fields

- swCommand :: !cmd

  Window command

GenericWidget |

Fields

- swCheckedText :: !String

  Text for checked widget state

- swUncheckedText :: !String

  Text for unchecked widget state

- swCommand :: !cmd

  Window command

#### Instances

Instances details

TextWidget StandardWidget Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods widgetString :: forall (engine :: Type -> Type -> Type). DrawData engine StandardWidget -> StandardWidget -> X String Source #
Read cmd => Read (GenericWidget cmd) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods readsPrec :: Int -> ReadS (GenericWidget cmd) Source # readList :: ReadS [GenericWidget cmd] Source # readPrec :: ReadPrec (GenericWidget cmd) Source # readListPrec :: ReadPrec [GenericWidget cmd] Source #
Show cmd => Show (GenericWidget cmd) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Methods showsPrec :: Int -> GenericWidget cmd -> ShowS Source # show :: GenericWidget cmd -> String Source # showList :: [GenericWidget cmd] -> ShowS Source #
(Default cmd, Read cmd, Show cmd, WindowCommand cmd) => DecorationWidget (GenericWidget cmd) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets Associated Types type WidgetCommand (GenericWidget cmd) Source # Methods widgetCommand :: GenericWidget cmd -> Int -> WidgetCommand (GenericWidget cmd) Source # isShrinkable :: GenericWidget cmd -> Bool Source #
type WidgetCommand (GenericWidget cmd) Source # |
Instance details Defined in XMonad.Layout.DecorationEx.Widgets type WidgetCommand (GenericWidget cmd) = cmd

type StandardWidget = GenericWidget StandardCommand Source #

Generic widget type specialized for `StandardCommand`

# Utility functions for themes

themeEx :: Default (WidgetCommand widget) => Theme -> ThemeEx widget Source #

Convert Theme type from XMonad.Layout.Decoration to theme type used by XMonad.Layout.DecorationEx.TextEngine.

borderColor :: String -> BorderColors Source #

shadowBorder :: String -> String -> BorderColors Source #

# Convinience re-exports

class (Read s, Show s) => Shrinker s where Source #

Methods

shrinkIt :: s -> String -> [String] Source #

#### Instances

Instances details

Shrinker CustomShrink Source # |
Instance details Defined in XMonad.Config.Droundy Methods shrinkIt :: CustomShrink -> String -> [String] Source #
Shrinker DefaultShrinker Source # |
Instance details Defined in XMonad.Layout.Decoration Methods shrinkIt :: DefaultShrinker -> String -> [String] Source #

shrinkText :: DefaultShrinker Source #

# Standard widgets

titleW :: StandardWidget Source #

Widget for window title

toggleStickyW :: StandardWidget Source #

Widget for ToggleSticky command.

minimizeW :: StandardWidget Source #

Widget for Minimize command

maximizeW :: StandardWidget Source #

Widget for ToggleMaximize command

closeW :: StandardWidget Source #

Widget for CloseWindow command

dwmpromoteW :: StandardWidget Source #

moveToNextGroupW :: StandardWidget Source #

moveToPrevGroupW :: StandardWidget Source #