XMonad.Layout.DwmStyle

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.DwmStyle

Contents

- Usage:

Description

A layout modifier for decorating windows in a dwm like style.

Synopsis

- dwmStyle :: (Eq a, Shrinker s) => s -> Theme -> l a -> ModifiedLayout (Decoration DwmStyle 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
- data DwmStyle a = Dwm
- 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.DwmStyle

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

    myL = dwmStyle 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.

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

and

    myL = dwmStyle shrinkText myDWConfig (layoutHook def)

A complete xmonad.hs file for this would therefore be:

    import XMonad
    import XMonad.Layout.DwmStyle

    main = xmonad def {
        layoutHook = dwmStyle shrinkText def (layoutHook def)
        }

dwmStyle :: (Eq a, Shrinker s) => s -> Theme -> l a -> ModifiedLayout (Decoration DwmStyle s) l a #

Add simple old dwm-style decorations to windows of a layout.

data Theme #

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

def :: Default a => a #

The default value for this type.

data DwmStyle a #

Constructors

Dwm |

#### Instances

Instances details

Eq a => DecorationStyle DwmStyle a # |
Instance details Defined in XMonad.Layout.DwmStyle Methods describeDeco :: DwmStyle a -> String # shrink :: DwmStyle a -> Rectangle -> Rectangle -> Rectangle # decorationEventHook :: DwmStyle a -> DecorationState -> Event -> X () # decorationCatchClicksHook :: DwmStyle a -> Window -> Int -> Int -> X Bool # decorationWhileDraggingHook :: DwmStyle a -> CInt -> CInt -> (Window, Rectangle) -> Position -> Position -> X () # decorationAfterDraggingHook :: DwmStyle a -> (Window, Rectangle) -> Window -> X () # pureDecoration :: DwmStyle a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe Rectangle # decorate :: DwmStyle a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle) #
Read (DwmStyle a) # |
Instance details Defined in XMonad.Layout.DwmStyle Methods readsPrec :: Int -> ReadS (DwmStyle a) # readList :: ReadS [DwmStyle a] # readPrec :: ReadPrec (DwmStyle a) # readListPrec :: ReadPrec [DwmStyle a] #
Show (DwmStyle a) # |
Instance details Defined in XMonad.Layout.DwmStyle Methods showsPrec :: Int -> DwmStyle a -> ShowS # show :: DwmStyle a -> String # showList :: [DwmStyle a] -> ShowS #

shrinkText :: DefaultShrinker #

data CustomShrink #

Constructors

CustomShrink |

#### Instances

Instances details

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

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

Methods

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

#### Instances

Instances details

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