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

Copyright | (c) -- David Roundy <droundy@darcs.net> 2018 Yclept Nemo
License | BSD3-style (see LICENSE)
Maintainer | Spencer Janssen <spencerjanssen@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.NoBorders

Contents

- Usage

Description

Make a given layout display without borders. This is useful for full-screen or tabbed layouts, where you don't really want to waste a couple of pixels of real estate just to inform yourself that the visible window has focus.

Synopsis

- noBorders :: LayoutClass l Window => l Window -> ModifiedLayout WithBorder l Window
- smartBorders :: LayoutClass l a => l a -> ModifiedLayout SmartBorder l a
- withBorder :: LayoutClass l a => Dimension -> l a -> ModifiedLayout WithBorder l a
- lessBorders :: (SetsAmbiguous p, Read p, Show p, LayoutClass l a) => p -> l a -> ModifiedLayout (ConfigurableBorder p) l a
- hasBorder :: Bool -> ManageHook
- class SetsAmbiguous p where
  - hiddens :: p -> WindowSet -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> [Window]
- data Ambiguity
  - = Combine With Ambiguity Ambiguity
  - | OnlyLayoutFloatBelow
  - | OnlyLayoutFloat
  - | OnlyScreenFloat
  - | Never
  - | EmptyScreen
  - | OtherIndicated
  - | OnlyFloat
  - | Screen
- data With
  - = Union
  - | Difference
  - | Intersection
- data BorderMessage
  - = HasBorder Bool Window
  - | ResetBorder Window
- borderEventHook :: Event -> X All
- type SmartBorder = ConfigurableBorder Ambiguity
- data WithBorder a
- data ConfigurableBorder p w

# Usage

You can use this module with the following in your xmonad.hs file:

    import XMonad.Layout.NoBorders

and modify the layouts to call noBorders on the layouts you want to lack borders:

    layoutHook = ... ||| noBorders Full ||| ...

For more detailed instructions on editing the layoutHook see the tutorial and XMonad.Doc.Extending.

noBorders :: LayoutClass l Window => l Window -> ModifiedLayout WithBorder l Window Source #

Removes all window borders from the specified layout.

smartBorders :: LayoutClass l a => l a -> ModifiedLayout SmartBorder l a Source #

Removes the borders from a window under one of the following conditions:

- There is only one screen and only one window. In this case it's obvious that it has the focus, so no border is needed.
- A floating window covers the entire screen (e.g. mplayer).

withBorder :: LayoutClass l a => Dimension -> l a -> ModifiedLayout WithBorder l a Source #

Forces a layout to use the specified border width. `noBorders` is equivalent to ``withBorder` 0`.

lessBorders :: (SetsAmbiguous p, Read p, Show p, LayoutClass l a) => p -> l a -> ModifiedLayout (ConfigurableBorder p) l a Source #

Apply a datatype that has a SetsAmbiguous instance to provide a list of windows that should not have borders.

This gives flexibility over when borders should be drawn, in particular with xinerama setups: `Ambiguity` has a number of useful `SetsAmbiguous` instances

hasBorder :: Bool -> ManageHook Source #

`ManageHook` for sending `HasBorder` messages:

       title =? "foo" --> hasBorder True

There is no equivalent for `ResetBorder`.

class SetsAmbiguous p where Source #

SetsAmbiguous allows custom actions to generate lists of windows that should not have borders drawn through `ConfigurableBorder`

To add your own (though perhaps those options would better belong as an additional constructor to `Ambiguity`), you can add the following function. Note that `lr`, the parameter representing the `Rectangle` of the parent layout, was added to `hiddens` in 0.14. Update your instance accordingly.

    data MyAmbiguity = MyAmbiguity deriving (Read, Show)

    instance SetsAmbiguous MyAmbiguity where
     hiddens _ wset lr mst wrs = otherHiddens Screen \\ otherHiddens OnlyScreenFloat
        where otherHiddens p = hiddens p wset lr mst wrs

The above example is redundant, because you can have the same result with:

    layoutHook = lessBorders (Combine Difference Screen OnlyScreenFloat) (Tall 1 0.5 0.03 ||| ... )

To get the same result as `smartBorders`:

    layoutHook = lessBorders Never (Tall 1 0.5 0.03 ||| ...)

This indirect method is required to keep the `Read` and `Show` for ConfigurableBorder so that xmonad can serialize state.

Methods

hiddens :: p -> WindowSet -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> [Window] Source #

#### Instances

Instances details

SetsAmbiguous Ambiguity Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods hiddens :: Ambiguity -> WindowSet -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> [Window] Source #

data Ambiguity Source #

In order of increasing ambiguity (less borders more frequently), where subsequent constructors add additional cases where borders are not drawn than their predecessors. These behaviors make most sense with with multiple screens: for single screens, `Never` or `smartBorders` makes more sense.

Constructors

Combine With Ambiguity Ambiguity | This constructor is used to combine the borderless windows provided by the SetsAmbiguous instances from two other `Ambiguity` data types.
OnlyLayoutFloatBelow | Like `OnlyLayoutFloat`, but only removes borders if no window stacked below remains visible. Considers all floating windows on the current screen and all visible tiled windows of the child layout. If any such window (that is stacked below) shows in any gap between the parent layout rectangle and the physical screen, the border will remain drawn.
OnlyLayoutFloat | Only remove borders on floating windows that exactly cover the parent layout rectangle.
OnlyScreenFloat | Only remove borders on floating windows that cover the whole screen.
Never | Like `OnlyScreenFloat`, and also remove borders of tiled windows when not ambiguous: this is the same as `smartBorders`.
EmptyScreen | Focus in an empty screen does not count as ambiguous.
OtherIndicated | No borders on full when all other screens have borders.
OnlyFloat | Remove borders on all floating windows; tiling windows of any kinds are not affected.
Screen | Borders are never drawn on singleton screens. With this one you really need another way such as a statusbar to detect focus.

#### Instances

Instances details

Read Ambiguity Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods readsPrec :: Int -> ReadS Ambiguity Source # readList :: ReadS [Ambiguity] Source # readPrec :: ReadPrec Ambiguity Source # readListPrec :: ReadPrec [Ambiguity] Source #
Show Ambiguity Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods showsPrec :: Int -> Ambiguity -> ShowS Source # show :: Ambiguity -> String Source # showList :: [Ambiguity] -> ShowS Source #
SetsAmbiguous Ambiguity Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods hiddens :: Ambiguity -> WindowSet -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> [Window] Source #

data With Source #

Used to indicate to the `SetsAmbiguous` instance for `Ambiguity` how two lists should be combined.

Constructors

Union | uses `union`
Difference | uses `\\`
Intersection | uses `intersect`

#### Instances

Instances details

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

data BorderMessage Source #

Constructors

HasBorder Bool Window | If `True`, never remove the border from the specified window. If `False`, always remove the border from the specified window.
ResetBorder Window | Reset the effects of any `HasBorder` messages on the specified window.

#### Instances

Instances details

Message BorderMessage Source # |
Instance details Defined in XMonad.Layout.NoBorders

borderEventHook :: Event -> X All Source #

Only necessary with `BorderMessage` - remove non-existent windows from the `alwaysHidden` or `neverHidden` lists.

type SmartBorder = ConfigurableBorder Ambiguity Source #

data WithBorder a Source #

#### Instances

Instances details

LayoutModifier WithBorder Window Source # |

Instance details

Defined in XMonad.Layout.NoBorders

Methods

modifyLayout :: LayoutClass l Window => WithBorder Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) Source #

modifyLayoutWithUpdate :: LayoutClass l Window => WithBorder Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (WithBorder Window)) Source #

handleMess :: WithBorder Window -> SomeMessage -> X (Maybe (WithBorder Window)) Source #

handleMessOrMaybeModifyIt :: WithBorder Window -> SomeMessage -> X (Maybe (Either (WithBorder Window) SomeMessage)) Source #

pureMess :: WithBorder Window -> SomeMessage -> Maybe (WithBorder Window) Source #

redoLayout :: WithBorder Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (WithBorder Window)) Source #

pureModifier :: WithBorder Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (WithBorder Window)) Source #

hook :: WithBorder Window -> X () Source #

unhook :: WithBorder Window -> X () Source #

modifierDescription :: WithBorder Window -> String Source #

modifyDescription :: LayoutClass l Window => WithBorder Window -> l Window -> String Source #

Read a => Read (WithBorder a) Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods readsPrec :: Int -> ReadS (WithBorder a) Source # readList :: ReadS [WithBorder a] Source # readPrec :: ReadPrec (WithBorder a) Source # readListPrec :: ReadPrec [WithBorder a] Source #
Show a => Show (WithBorder a) Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods showsPrec :: Int -> WithBorder a -> ShowS Source # show :: WithBorder a -> String Source # showList :: [WithBorder a] -> ShowS Source #

data ConfigurableBorder p w Source #

#### Instances

Instances details

(Read p, Show p, SetsAmbiguous p) => LayoutModifier (ConfigurableBorder p) Window Source # |

Instance details

Defined in XMonad.Layout.NoBorders

Methods

modifyLayout :: LayoutClass l Window => ConfigurableBorder p Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) Source #

modifyLayoutWithUpdate :: LayoutClass l Window => ConfigurableBorder p Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (ConfigurableBorder p Window)) Source #

handleMess :: ConfigurableBorder p Window -> SomeMessage -> X (Maybe (ConfigurableBorder p Window)) Source #

handleMessOrMaybeModifyIt :: ConfigurableBorder p Window -> SomeMessage -> X (Maybe (Either (ConfigurableBorder p Window) SomeMessage)) Source #

pureMess :: ConfigurableBorder p Window -> SomeMessage -> Maybe (ConfigurableBorder p Window) Source #

redoLayout :: ConfigurableBorder p Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (ConfigurableBorder p Window)) Source #

pureModifier :: ConfigurableBorder p Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (ConfigurableBorder p Window)) Source #

hook :: ConfigurableBorder p Window -> X () Source #

unhook :: ConfigurableBorder p Window -> X () Source #

modifierDescription :: ConfigurableBorder p Window -> String Source #

modifyDescription :: LayoutClass l Window => ConfigurableBorder p Window -> l Window -> String Source #

(Read p, Read w) => Read (ConfigurableBorder p w) Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods readsPrec :: Int -> ReadS (ConfigurableBorder p w) Source # readList :: ReadS [ConfigurableBorder p w] Source # readPrec :: ReadPrec (ConfigurableBorder p w) Source # readListPrec :: ReadPrec [ConfigurableBorder p w] Source #
(Show p, Show w) => Show (ConfigurableBorder p w) Source # |
Instance details Defined in XMonad.Layout.NoBorders Methods showsPrec :: Int -> ConfigurableBorder p w -> ShowS Source # show :: ConfigurableBorder p w -> String Source # showList :: [ConfigurableBorder p w] -> ShowS Source #