XMonad.Layout.IfMax

xmonad-contrib-0.12: Third party extensions for xmonad

Copyright | (c) 2013 Ilya Portnov
License | BSD3-style (see LICENSE)
Maintainer | Ilya Portnov <portnov84@rambler.ru>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Layout.IfMax

Contents

- Usage

Description

Provides IfMax layout, which will run one layout if there are maximum N windows on workspace, and another layout, when number of windows is greater than N.

Synopsis

- data IfMax l1 l2 w = IfMax Int (l1 w) (l2 w)
- ifMax :: (LayoutClass l1 w, LayoutClass l2 w) => Int -> l1 w -> l2 w -> IfMax l1 l2 w

# Usage

IfMax layout will run one layout if number of windows on workspace is as maximum N, and else will run another layout.

You can use this module by adding folowing in your `xmonad.hs`:

    import XMonad.Layout.IfMax

Then add layouts to your layoutHook:

    myLayoutHook = IfMax 2 Full (Tall ...) ||| ...

In this example, if there are 1 or 2 windows, Full layout will be used; otherwise, Tall layout will be used.

data IfMax l1 l2 w #

Constructors

IfMax Int (l1 w) (l2 w) |

Instances

(LayoutClass l1 a, LayoutClass l2 a) => LayoutClass (IfMax l1 l2) a # |
Methods runLayout :: Workspace WorkspaceId (IfMax l1 l2 a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (IfMax l1 l2 a)) # doLayout :: IfMax l1 l2 a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (IfMax l1 l2 a)) # pureLayout :: IfMax l1 l2 a -> Rectangle -> Stack a -> [(a, Rectangle)] # emptyLayout :: IfMax l1 l2 a -> Rectangle -> X ([(a, Rectangle)], Maybe (IfMax l1 l2 a)) # handleMessage :: IfMax l1 l2 a -> SomeMessage -> X (Maybe (IfMax l1 l2 a)) # pureMessage :: IfMax l1 l2 a -> SomeMessage -> Maybe (IfMax l1 l2 a) # description :: IfMax l1 l2 a -> String #
(Read (l1 w), Read (l2 w)) => Read (IfMax l1 l2 w) # |
Methods readsPrec :: Int -> ReadS (IfMax l1 l2 w) # readList :: ReadS [IfMax l1 l2 w] # readPrec :: ReadPrec (IfMax l1 l2 w) # readListPrec :: ReadPrec [IfMax l1 l2 w] #
(Show (l1 w), Show (l2 w)) => Show (IfMax l1 l2 w) # |
Methods showsPrec :: Int -> IfMax l1 l2 w -> ShowS # show :: IfMax l1 l2 w -> String # showList :: [IfMax l1 l2 w] -> ShowS #

ifMax #

Arguments

:: (LayoutClass l1 w, LayoutClass l2 w) |
=> Int | Maximum number of windows for the first layout
-> l1 w | First layout
-> l2 w | Second layout
-> IfMax l1 l2 w |

Layout itself