XMonad.Layout.Spacing

xmonad-contrib-0.15: Third party extensions for xmonad

Copyright | (C) -- Brent Yorgey 2018 Yclept Nemo
License | BSD-style (see LICENSE)
Maintainer | <byorgey@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Layout.Spacing

Contents

- Usage
- Backwards Compatibility

Description

Add a configurable amount of space around windows.

Note: For space/gaps along edges of the screen see XMonad.Layout.Gaps.

Synopsis

- data Border = Border {
  - top :: Integer
  - bottom :: Integer
  - right :: Integer
  - left :: Integer
  }
- data Spacing a = Spacing {
  - smartBorder :: Bool
  - screenBorder :: Border
  - screenBorderEnabled :: Bool
  - windowBorder :: Border
  - windowBorderEnabled :: Bool
  }
- data SpacingModifier
  - = ModifySmartBorder (Bool -> Bool)
  - | ModifyScreenBorder (Border -> Border)
  - | ModifyScreenBorderEnabled (Bool -> Bool)
  - | ModifyWindowBorder (Border -> Border)
  - | ModifyWindowBorderEnabled (Bool -> Bool)
- spacingRaw :: Bool -> Border -> Bool -> Border -> Bool -> l a -> ModifiedLayout Spacing l a
- setSmartSpacing :: Bool -> X ()
- setScreenSpacing :: Border -> X ()
- setScreenSpacingEnabled :: Bool -> X ()
- setWindowSpacing :: Border -> X ()
- setWindowSpacingEnabled :: Bool -> X ()
- toggleSmartSpacing :: X ()
- toggleScreenSpacingEnabled :: X ()
- toggleWindowSpacingEnabled :: X ()
- setScreenWindowSpacing :: Integer -> X ()
- incWindowSpacing :: Integer -> X ()
- incScreenSpacing :: Integer -> X ()
- decWindowSpacing :: Integer -> X ()
- decScreenSpacing :: Integer -> X ()
- incScreenWindowSpacing :: Integer -> X ()
- decScreenWindowSpacing :: Integer -> X ()
- borderMap :: (Integer -> Integer) -> Border -> Border
- borderIncrementBy :: Integer -> Border -> Border
- type SpacingWithEdge = Spacing
- type SmartSpacing = Spacing
- type SmartSpacingWithEdge = Spacing
- data ModifySpacing = ModifySpacing (Int -> Int)
- spacing :: Int -> l a -> ModifiedLayout Spacing l a
- spacingWithEdge :: Int -> l a -> ModifiedLayout Spacing l a
- smartSpacing :: Int -> l a -> ModifiedLayout Spacing l a
- smartSpacingWithEdge :: Int -> l a -> ModifiedLayout Spacing l a
- setSpacing :: Int -> X ()
- incSpacing :: Int -> X ()

# Usage

You can use this module by importing it into your `~/.xmonad/xmonad.hs` file:

    import XMonad.Layout.Spacing

and modifying your layoutHook as follows (for example):

    layoutHook = spacingRaw True (Border 0 10 10 10) True (Border 10 10 10 10) True $
                 layoutHook def

data Border #

Represent the borders of a rectangle.

Constructors

Border |
Fields top :: Integer bottom :: Integer right :: Integer left :: Integer

Instances

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

data Spacing a #

A `LayoutModifier` providing customizable screen and window borders. Borders are clamped to `[0,Infinity]` before being applied.

Constructors

Spacing |
Fields smartBorder :: Bool When `True` borders are not applied if there fewer than two windows. screenBorder :: Border The screen border. screenBorderEnabled :: Bool Is the screen border enabled? windowBorder :: Border The window borders. windowBorderEnabled :: Bool Is the window border enabled?

Instances

Eq a => LayoutModifier Spacing a # |
Instance details Defined in XMonad.Layout.Spacing Methods modifyLayout :: LayoutClass l a => Spacing a -> Workspace WorkspaceId (l a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (l a)) # modifyLayoutWithUpdate :: LayoutClass l a => Spacing a -> Workspace WorkspaceId (l a) a -> Rectangle -> X (([(a, Rectangle)], Maybe (l a)), Maybe (Spacing a)) # handleMess :: Spacing a -> SomeMessage -> X (Maybe (Spacing a)) # handleMessOrMaybeModifyIt :: Spacing a -> SomeMessage -> X (Maybe (Either (Spacing a) SomeMessage)) # pureMess :: Spacing a -> SomeMessage -> Maybe (Spacing a) # redoLayout :: Spacing a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (Spacing a)) # pureModifier :: Spacing a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> ([(a, Rectangle)], Maybe (Spacing a)) # hook :: Spacing a -> X () # unhook :: Spacing a -> X () # modifierDescription :: Spacing a -> String # modifyDescription :: LayoutClass l a => Spacing a -> l a -> String #
Read (Spacing a) # |
Instance details Defined in XMonad.Layout.Spacing Methods readsPrec :: Int -> ReadS (Spacing a) # readList :: ReadS [Spacing a] # readPrec :: ReadPrec (Spacing a) # readListPrec :: ReadPrec [Spacing a] #
Show (Spacing a) # |
Instance details Defined in XMonad.Layout.Spacing Methods showsPrec :: Int -> Spacing a -> ShowS # show :: Spacing a -> String # showList :: [Spacing a] -> ShowS #

data SpacingModifier #

Messages to alter the state of `Spacing` using the endomorphic function arguments.

Constructors

ModifySmartBorder (Bool -> Bool) |
ModifyScreenBorder (Border -> Border) |
ModifyScreenBorderEnabled (Bool -> Bool) |
ModifyWindowBorder (Border -> Border) |
ModifyWindowBorderEnabled (Bool -> Bool) |

Instances

Message SpacingModifier # |
Instance details Defined in XMonad.Layout.Spacing

spacingRaw #

Arguments

:: Bool | The `smartBorder`.
-> Border | The `screenBorder`.
-> Bool | The `screenBorderEnabled`.
-> Border | The `windowBorder`.
-> Bool | The `windowBorderEnabled`.
-> l a |
-> ModifiedLayout Spacing l a |

Generate the `ModifiedLayout`, exposing all initial state of `Spacing`.

setSmartSpacing :: Bool -> X () #

Set `smartBorder` to the given `Bool`.

setScreenSpacing :: Border -> X () #

Set `screenBorder` to the given `Border`.

setScreenSpacingEnabled :: Bool -> X () #

Set `screenBorderEnabled` to the given `Bool`.

setWindowSpacing :: Border -> X () #

Set `windowBorder` to the given `Border`.

setWindowSpacingEnabled :: Bool -> X () #

Set `windowBorderEnabled` to the given `Bool`.

toggleSmartSpacing :: X () #

Toggle `smartBorder`.

toggleScreenSpacingEnabled :: X () #

Toggle `screenBorderEnabled`.

toggleWindowSpacingEnabled :: X () #

Toggle `windowBorderEnabled`.

setScreenWindowSpacing :: Integer -> X () #

Set all borders to a uniform size; see `setWindowSpacing` and `setScreenSpacing`.

incWindowSpacing :: Integer -> X () #

Increment the borders of `windowBorder` using `borderIncrementBy`, which preserves border ratios during clamping.

incScreenSpacing :: Integer -> X () #

Increment the borders of `screenBorder` using `borderIncrementBy`.

decWindowSpacing :: Integer -> X () #

Inverse of `incWindowSpacing`, equivalent to applying `negate`.

decScreenSpacing :: Integer -> X () #

Inverse of `incScreenSpacing`.

incScreenWindowSpacing :: Integer -> X () #

Increment both screen and window borders; see `incWindowSpacing` and `incScreenSpacing`.

decScreenWindowSpacing :: Integer -> X () #

Inverse of `incScreenWindowSpacing`.

borderMap :: (Integer -> Integer) -> Border -> Border #

Map a function over a `Border`. That is, over the four individual borders.

borderIncrementBy :: Integer -> Border -> Border #

Change the border spacing by the provided amount, adjusted so that at least one border field is `>=0`.

# Backwards Compatibility

The following functions and types exist solely for compatibility with pre-0.14 releases.

type SpacingWithEdge = Spacing #

Deprecated: Use Spacing instead.

A type synonym for the `Spacing` `LayoutModifier`.

type SmartSpacing = Spacing #

Deprecated: Use Spacing instead.

A type synonym for the `Spacing` `LayoutModifier`.

type SmartSpacingWithEdge = Spacing #

Deprecated: Use Spacing instead.

A type synonym for the `Spacing` `LayoutModifier`.

data ModifySpacing #

Deprecated: Use SpacingModifier instead, perhaps with sendMessages.

Message to dynamically modify (e.g. increase/decrease/set) the size of the screen spacing and window spacing. See `SpacingModifier`.

Constructors

ModifySpacing (Int -> Int) | Deprecated: Use SpacingModifier instead, perhaps with sendMessages.

Instances

Message ModifySpacing # |
Instance details Defined in XMonad.Layout.Spacing

spacing :: Int -> l a -> ModifiedLayout Spacing l a #

Deprecated: Use spacingRaw instead.

Surround all windows by a certain number of pixels of blank space. See `spacingRaw`.

spacingWithEdge :: Int -> l a -> ModifiedLayout Spacing l a #

Deprecated: Use spacingRaw instead.

Surround all windows by a certain number of pixels of blank space, and additionally adds the same amount of spacing around the edge of the screen. See `spacingRaw`.

smartSpacing :: Int -> l a -> ModifiedLayout Spacing l a #

Deprecated: Use spacingRaw instead.

Surrounds all windows with blank space, except when the window is the only visible window on the current workspace. See `spacingRaw`.

smartSpacingWithEdge :: Int -> l a -> ModifiedLayout Spacing l a #

Deprecated: Use spacingRaw instead.

Surrounds all windows with blank space, and adds the same amount of spacing around the edge of the screen, except when the window is the only visible window on the current workspace. See `spacingRaw`.

setSpacing :: Int -> X () #

Deprecated: Use setScreenWindowSpacing instead.

See `setScreenWindowSpacing`.

incSpacing :: Int -> X () #

Deprecated: Use incScreenWindowSpacing instead.

See `incScreenWindowSpacing`.