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

Copyright | (c) 2007 Andrea Rossato
License | BSD-style (see xmonad/LICENSE)
Maintainer | andrea.rossato@unibz.it
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.SimpleDecoration

Contents

- Usage:

Description

A layout modifier for adding simple decorations to the windows of a given layout. The decorations are in the form of ion-like tabs for window titles.

Synopsis

- simpleDeco :: (Eq a, Shrinker s) => s -> Theme -> l a -> ModifiedLayout (Decoration SimpleDecoration s) l a
- data Theme = Theme {
  - activeColor :: String
  - inactiveColor :: String
  - urgentColor :: String
  - activeBorderColor :: String
  - inactiveBorderColor :: String
  - urgentBorderColor :: String
  - activeBorderWidth :: Dimension
  - inactiveBorderWidth :: Dimension
  - urgentBorderWidth :: Dimension
  - activeTextColor :: String
  - inactiveTextColor :: String
  - urgentTextColor :: String
  - fontName :: String
  - decoWidth :: Dimension
  - decoHeight :: Dimension
  - windowTitleAddons :: [(String, Align)]
  - windowTitleIcons :: [([[Bool]], Placement)]
  }
- def :: Default a => a
- newtype SimpleDecoration a = Simple Bool
- shrinkText :: DefaultShrinker
- data CustomShrink = CustomShrink
- class (Read s, Show s) => Shrinker s where
  - shrinkIt :: s -> String -> [String]

# Usage:

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

    import XMonad.Layout.SimpleDecoration

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

    myL = simpleDeco shrinkText def (layoutHook def)
    main = xmonad def { layoutHook = myL }

For more detailed instructions on editing the layoutHook see the tutorial and XMonad.Doc.Extending.

You can also edit the default configuration options.

    mySDConfig = def { inactiveBorderColor = "red"
                     , inactiveTextColor   = "red"}

and

    myL = simpleDeco shrinkText mySDConfig (layoutHook def)

simpleDeco :: (Eq a, Shrinker s) => s -> Theme -> l a -> ModifiedLayout (Decoration SimpleDecoration s) l a Source #

Add simple decorations to windows of a layout.

data Theme Source #

A `Theme` is a record of colors, font etc., to customize a `DecorationStyle`.

For a collection of `Theme`s see XMonad.Util.Themes

Constructors

Theme |

Fields

- activeColor :: String

  Color of the active window

- inactiveColor :: String

  Color of the inactive window

- urgentColor :: String

  Color of the urgent window

- activeBorderColor :: String

  Color of the border of the active window

- inactiveBorderColor :: String

  Color of the border of the inactive window

- urgentBorderColor :: String

  Color of the border of the urgent window

- activeBorderWidth :: Dimension

  Width of the border of the active window

- inactiveBorderWidth :: Dimension

  Width of the border of the inactive window

- urgentBorderWidth :: Dimension

  Width of the border of the urgent window

- activeTextColor :: String

  Color of the text of the active window

- inactiveTextColor :: String

  Color of the text of the inactive window

- urgentTextColor :: String

  Color of the text of the urgent window

- fontName :: String

  Font name

- decoWidth :: Dimension

  Maximum width of the decorations (if supported by the `DecorationStyle`)

- decoHeight :: Dimension

  Height of the decorations

- windowTitleAddons :: [(String, Align)]

  Extra text to appear in a window's title bar. Refer to for a use XMonad.Layout.ImageButtonDecoration

- windowTitleIcons :: [([[Bool]], Placement)]

  Extra icons to appear in a window's title bar. Inner `[Bool]` is a row in a icon bitmap.

#### Instances

Instances details

Default Theme Source # | The default xmonad `Theme`.
Instance details Defined in XMonad.Layout.Decoration Methods def :: Theme #
Read Theme Source # |
Instance details Defined in XMonad.Layout.Decoration Methods readsPrec :: Int -> ReadS Theme Source # readList :: ReadS [Theme] Source # readPrec :: ReadPrec Theme Source # readListPrec :: ReadPrec [Theme] Source #
Show Theme Source # |
Instance details Defined in XMonad.Layout.Decoration Methods showsPrec :: Int -> Theme -> ShowS Source # show :: Theme -> String Source # showList :: [Theme] -> ShowS Source #

def :: Default a => a #

newtype SimpleDecoration a Source #

Constructors

Simple Bool |

#### Instances

Instances details

Eq a => DecorationStyle SimpleDecoration a Source # |

Instance details

Defined in XMonad.Layout.SimpleDecoration

Methods

describeDeco :: SimpleDecoration a -> String Source #

shrink :: SimpleDecoration a -> Rectangle -> Rectangle -> Rectangle Source #

decorationEventHook :: SimpleDecoration a -> DecorationState -> Event -> X () Source #

decorationCatchClicksHook :: SimpleDecoration a -> Window -> Int -> Int -> X Bool Source #

decorationWhileDraggingHook :: SimpleDecoration a -> CInt -> CInt -> (Window, Rectangle) -> Position -> Position -> X () Source #

decorationAfterDraggingHook :: SimpleDecoration a -> (Window, Rectangle) -> Window -> X () Source #

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

decorate :: SimpleDecoration a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle) Source #

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

shrinkText :: DefaultShrinker Source #

data CustomShrink Source #

Constructors

CustomShrink |

#### Instances

Instances details

Read CustomShrink Source # |
Instance details Defined in XMonad.Layout.Decoration Methods readsPrec :: Int -> ReadS CustomShrink Source # readList :: ReadS [CustomShrink] Source # readPrec :: ReadPrec CustomShrink Source # readListPrec :: ReadPrec [CustomShrink] Source #
Show CustomShrink Source # |
Instance details Defined in XMonad.Layout.Decoration Methods showsPrec :: Int -> CustomShrink -> ShowS Source # show :: CustomShrink -> String Source # showList :: [CustomShrink] -> ShowS Source #
Shrinker CustomShrink Source # |
Instance details Defined in XMonad.Config.Droundy Methods shrinkIt :: CustomShrink -> String -> [String] Source #

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 #