xmonad-contrib-0.13: Third party extensions for xmonad

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

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
- class SetsAmbiguous p where
- data Ambiguity
  - = Combine With Ambiguity Ambiguity
  - | OnlyFloat
  - | Never
  - | EmptyScreen
  - | OtherIndicated
  - | Screen
- data With
  - = Union
  - | Difference
  - | Intersection
- type SmartBorder = ConfigurableBorder Ambiguity
- data WithBorder a
- data ConfigurableBorder p w

# Usage

You can use this module with the following in your ~/.xmonad/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:

XMonad.Doc.Extending

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

Removes all window borders from the specified layout.

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

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 #

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 #

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

class SetsAmbiguous p where #

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 aditional constructor to `Ambiguity`), you can add the function as such:

    data MyAmbiguity = MyAmbiguity deriving (Read, Show)

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

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

    layoutHook = lessBorders (Combine Difference Screen OnlyFloat) (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.

Minimal complete definition

hiddens

Methods

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

Instances

SetsAmbiguous Ambiguity # |
Methods hiddens :: Ambiguity -> WindowSet -> Maybe (Stack Window) -> [(Window, Rectangle)] -> [Window] #

data Ambiguity #

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.
OnlyFloat | Only remove borders on floating windows that cover the whole screen
Never | Never remove borders when ambiguous: this is the same as smartBorders
EmptyScreen | Focus in an empty screens does not count as ambiguous.
OtherIndicated | No borders on full when all other screens have borders.
Screen | Borders are never drawn on singleton screens. With this one you really need another way such as a statusbar to detect focus.

Instances

Read Ambiguity # |
Methods readsPrec :: Int -> ReadS Ambiguity # readList :: ReadS [Ambiguity] # readPrec :: ReadPrec Ambiguity # readListPrec :: ReadPrec [Ambiguity] #
Show Ambiguity # |
Methods showsPrec :: Int -> Ambiguity -> ShowS # show :: Ambiguity -> String # showList :: [Ambiguity] -> ShowS #
SetsAmbiguous Ambiguity # |
Methods hiddens :: Ambiguity -> WindowSet -> Maybe (Stack Window) -> [(Window, Rectangle)] -> [Window] #

data With #

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

Read With # |
Methods readsPrec :: Int -> ReadS With # readList :: ReadS [With] # readPrec :: ReadPrec With # readListPrec :: ReadPrec [With] #
Show With # |
Methods showsPrec :: Int -> With -> ShowS # show :: With -> String # showList :: [With] -> ShowS #

type SmartBorder = ConfigurableBorder Ambiguity #

data WithBorder a #

Instances

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

data ConfigurableBorder p w #

Instances

(Read p, Show p, SetsAmbiguous p) => LayoutModifier (ConfigurableBorder p) Window # |
Methods modifyLayout :: LayoutClass l Window => ConfigurableBorder p Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) # modifyLayoutWithUpdate :: LayoutClass l Window => ConfigurableBorder p Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (ConfigurableBorder p Window)) # handleMess :: ConfigurableBorder p Window -> SomeMessage -> X (Maybe (ConfigurableBorder p Window)) # handleMessOrMaybeModifyIt :: ConfigurableBorder p Window -> SomeMessage -> X (Maybe (Either (ConfigurableBorder p Window) SomeMessage)) # pureMess :: ConfigurableBorder p Window -> SomeMessage -> Maybe (ConfigurableBorder p Window) # redoLayout :: ConfigurableBorder p Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (ConfigurableBorder p Window)) # pureModifier :: ConfigurableBorder p Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (ConfigurableBorder p Window)) # hook :: ConfigurableBorder p Window -> X () # unhook :: ConfigurableBorder p Window -> X () # modifierDescription :: ConfigurableBorder p Window -> String # modifyDescription :: LayoutClass l Window => ConfigurableBorder p Window -> l Window -> String #
(Read p, Read w) => Read (ConfigurableBorder p w) # |
Methods readsPrec :: Int -> ReadS (ConfigurableBorder p w) # readList :: ReadS [ConfigurableBorder p w] # readPrec :: ReadPrec (ConfigurableBorder p w) # readListPrec :: ReadPrec [ConfigurableBorder p w] #
(Show p, Show w) => Show (ConfigurableBorder p w) # |
Methods showsPrec :: Int -> ConfigurableBorder p w -> ShowS # show :: ConfigurableBorder p w -> String # showList :: [ConfigurableBorder p w] -> ShowS #