xmonad-contrib-0.16.999: Third party extensions for xmonad
Copyright(C) -- Brent Yorgey
2018 Yclept Nemo
LicenseBSD-style (see LICENSE)
Maintainer<byorgey@gmail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

XMonad.Layout.Spacing

Description

Add a configurable amount of space around windows.

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

Synopsis

Usage

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

import XMonad.Layout.Spacing

and, for example, modifying your layoutHook as follows:

main :: IO ()
main = xmonad $ def
  { layoutHook = spacingWithEdge 10 $ myLayoutHook
  }

myLayoutHook = Full ||| ...

The above would add a 10 pixel gap around windows on all sides, as well as add the same amount of spacing around the edges of the screen. If you only want to add spacing around windows, you can use spacing instead.

There is also the spacingRaw command, for more fine-grained control. For example:

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

Breaking this down, the above would do the following:

  • True: Enable the smartBorder to not apply borders when there is only one window.
  • (Border 0 10 10 10): Add a screenBorder of 10 pixels in every direction but the top.
  • True: Enable the screenBorder.
  • (Border 10 10 10 10): Add a windowBorder of 10 pixels in every direction.
  • True: Enable the windowBorder.

data Spacing a Source #

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

Constructors

Spacing 

Fields

Instances

Instances details
Eq a => LayoutModifier Spacing a Source # 
Instance details

Defined in XMonad.Layout.Spacing

Read (Spacing a) Source # 
Instance details

Defined in XMonad.Layout.Spacing

Show (Spacing a) Source # 
Instance details

Defined in XMonad.Layout.Spacing

Methods

showsPrec :: Int -> Spacing a -> ShowS #

show :: Spacing a -> String #

showList :: [Spacing a] -> ShowS #

spacingRaw Source #

Generate the ModifiedLayout, exposing all initial state of Spacing.

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

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

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

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

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

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.

Modify Spacing

data SpacingModifier Source #

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

Instances

Instances details
Message SpacingModifier Source # 
Instance details

Defined in XMonad.Layout.Spacing

setSmartSpacing :: Bool -> X () Source #

Set smartBorder to the given Bool.

setScreenSpacing :: Border -> X () Source #

Set screenBorder to the given Border.

setWindowSpacing :: Border -> X () Source #

Set windowBorder to the given Border.

setScreenWindowSpacing :: Integer -> X () Source #

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

incWindowSpacing :: Integer -> X () Source #

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

incScreenSpacing :: Integer -> X () Source #

Increment the borders of screenBorder using borderIncrementBy.

decWindowSpacing :: Integer -> X () Source #

Inverse of incWindowSpacing, equivalent to applying negate.

incScreenWindowSpacing :: Integer -> X () Source #

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

Modify Borders

data Border Source #

Represent the borders of a rectangle.

Constructors

Border 

Instances

Instances details
Read Border Source # 
Instance details

Defined in XMonad.Layout.Spacing

Show Border Source # 
Instance details

Defined in XMonad.Layout.Spacing

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

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

borderIncrementBy :: Integer -> Border -> Border Source #

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

Backwards Compatibility

type SpacingWithEdge = Spacing Source #

Deprecated: Use Spacing instead.

A type synonym for the Spacing LayoutModifier.

type SmartSpacing = Spacing Source #

Deprecated: Use Spacing instead.

A type synonym for the Spacing LayoutModifier.

type SmartSpacingWithEdge = Spacing Source #

Deprecated: Use Spacing instead.

A type synonym for the Spacing LayoutModifier.

newtype ModifySpacing Source #

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

Instances details
Message ModifySpacing Source # 
Instance details

Defined in XMonad.Layout.Spacing

setSpacing :: Int -> X () Source #

Deprecated: Use setScreenWindowSpacing instead.

See setScreenWindowSpacing.

incSpacing :: Int -> X () Source #

Deprecated: Use incScreenWindowSpacing instead.

See incScreenWindowSpacing.