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) #

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 #

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 # |
Instance details Defined in XMonad.Layout.SideBorderDecoration Methods def :: SideBorderConfig #

def :: Default a => a #

The default value for this type.

# Re-exports

data Direction2D #

Two-dimensional directions:

Constructors

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

#### Instances

Instances details

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

Instance details

Defined in XMonad.Util.Types

Methods

succ :: Direction2D -> Direction2D #

pred :: Direction2D -> Direction2D #

toEnum :: Int -> Direction2D #

fromEnum :: Direction2D -> Int #

enumFrom :: Direction2D -> [Direction2D] #

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

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

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

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

# Lower-level hooks

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

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