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

Copyright | (c) 2018 L. S. Leary 2022 Tony Zorman
License | BSD3
Maintainer | Tony Zorman <soliditsallgood@mailbox.org>
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.SideBorderDecoration

Contents

- Usage
- Border configuration
- Re-exports
- Lower-level hooks

Description

This module allows for having a configurable border position around windows; i.e., it can move the border to any cardinal direction.

Synopsis

- sideBorder :: forall (l :: Type -> Type). SideBorderConfig -> XConfig l -> XConfig (SideBorder l)
- data SideBorderConfig = SideBorderConfig {
  - sbSide :: !Direction2D
  - sbActiveColor :: !String
  - sbInactiveColor :: !String
  - sbSize :: !Dimension
  }
- def :: Default a => a
- data Direction2D
  - = U
  - | D
  - | R
  - | L
- sideBorderLayout :: Eq a => SideBorderConfig -> l a -> SideBorder l a

# Usage

To use this module, first import it into your configuration file:

    import XMonad.Layout.SideBorderDecoration

You can now add the `sideBorder` combinator to your configuration:

    main :: IO ()
    main = xmonad
         $ …
         $ sideBorder mySideBorderConfig
         $ def { … }
     where
      mySideBorderConfig :: SideBorderConfig
      mySideBorderConfig = def
        { sbSide          = D
        , sbActiveColor   = "#ff0000"
        , sbInactiveColor = "#ffaaaa"
        , sbSize          = 5
        }

or, alternatively,

    main :: IO ()
    main = xmonad
         $ …
         $ sideBorder def{ sbSide = D, sbActiveColor = "#ff000", … }
         $ def { … }

See `SideBorderConfig` for the different size and colour options.

The following is a fully-functional, minimal configuration example:

    import XMonad
    import XMonad.Layout.SideBorderDecoration

    main :: IO ()
    main = xmonad $ sideBorder def $ def

This would result in the following border being displayed:

sideBorder :: forall (l :: Type -> Type). SideBorderConfig -> XConfig l -> XConfig (SideBorder l) Source #

Move the default XMonad border to any of the four cardinal directions.

Note that this function should only be applied once to your configuration and should not be combined with `sideBorderLayout`.

# Border configuration

data SideBorderConfig Source #

Configuring how the border looks like.

Constructors

SideBorderConfig |

Fields

- sbSide :: !Direction2D

  Which side to have the border on.

- sbActiveColor :: !String

  Active border colour.

- sbInactiveColor :: !String

  Inactive border colour.

- sbSize :: !Dimension

  Size of the border. This will be the height if `sbSide` is `U` or `D` and the width if it is `L` or `R`.

#### Instances

Instances details

Default SideBorderConfig Source # |
Instance details Defined in XMonad.Layout.SideBorderDecoration Methods def :: SideBorderConfig #

def :: Default a => a #

# Re-exports

data Direction2D Source #

Two-dimensional directions:

Constructors

U | Up
D | Down
R | Right
L | Left

#### Instances

Instances details

Bounded Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods minBound :: Direction2D Source # maxBound :: Direction2D Source #
Enum Direction2D Source # |

Instance details

Defined in XMonad.Util.Types

Methods

succ :: Direction2D -> Direction2D Source #

pred :: Direction2D -> Direction2D Source #

toEnum :: Int -> Direction2D Source #

fromEnum :: Direction2D -> Int Source #

enumFrom :: Direction2D -> [Direction2D] Source #

enumFromThen :: Direction2D -> Direction2D -> [Direction2D] Source #

enumFromTo :: Direction2D -> Direction2D -> [Direction2D] Source #

enumFromThenTo :: Direction2D -> Direction2D -> Direction2D -> [Direction2D] Source #

Read Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods readsPrec :: Int -> ReadS Direction2D Source # readList :: ReadS [Direction2D] Source # readPrec :: ReadPrec Direction2D Source # readListPrec :: ReadPrec [Direction2D] Source #
Show Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods showsPrec :: Int -> Direction2D -> ShowS Source # show :: Direction2D -> String Source # showList :: [Direction2D] -> ShowS Source #
Eq Direction2D Source # |
Instance details Defined in XMonad.Util.Types Methods (==) :: Direction2D -> Direction2D -> Bool Source # (/=) :: Direction2D -> Direction2D -> Bool Source #
Ord Direction2D Source # |

Instance details

Defined in XMonad.Util.Types

Methods

compare :: Direction2D -> Direction2D -> Ordering Source #

(<) :: Direction2D -> Direction2D -> Bool Source #

(<=) :: Direction2D -> Direction2D -> Bool Source #

(>) :: Direction2D -> Direction2D -> Bool Source #

(>=) :: Direction2D -> Direction2D -> Bool Source #

max :: Direction2D -> Direction2D -> Direction2D Source #

min :: Direction2D -> Direction2D -> Direction2D Source #

# Lower-level hooks

sideBorderLayout :: Eq a => SideBorderConfig -> l a -> SideBorder l a Source #

Layout hook to only enable the side border for some layouts. For example:

    myLayout = Full ||| sideBorderLayout def tall ||| somethingElse

Note that, unlike `sideBorder`, this does not disable the normal border in XMonad, you will have to do this yourself. Remove this function from your layout hook and use `sideBorder` if you want a side border in every layout (do not use the two functions together).