xmonad-contrib-0.15: Third party extensions for xmonad

Copyright | (c) 2009 Adam Vogt 2007 James Webb
License | BSD-style (see xmonad/LICENSE)
Maintainer | vogt.adam<at>gmail.com
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Layout.Mosaic

Contents

- Usage

Description

Based on MosaicAlt, but aspect ratio messages always change the aspect ratios, and rearranging the window stack changes the window sizes.

Synopsis

- data Aspect
  - = Taller
  - | Wider
  - | Reset
  - | SlopeMod ([Rational] -> [Rational])
- mosaic :: Rational -> [Rational] -> Mosaic a
- changeMaster :: (Rational -> Rational) -> X ()
- changeFocused :: (Rational -> Rational) -> X ()
- data Mosaic a

# Usage

You can use this module with the following in your `~/.xmonad/xmonad.hs`:

    import XMonad.Layout.Mosaic

Then edit your `layoutHook` by adding the Mosaic layout:

    myLayout = mosaic 2 [3,2] ||| Full ||| etc..
    main = xmonad $ def { layoutHook = myLayout }

Unfortunately, infinite lists break serialization, so don't use them. And if the list is too short, it is extended with `++ repeat 1`, which covers the main use case.

To change the choice in aspect ratio and the relative sizes of windows, add to your keybindings:

    , ((modm, xK_a), sendMessage Taller)
    , ((modm, xK_z), sendMessage Wider)

    , ((modm, xK_r), sendMessage Reset)

For more detailed instructions on editing the layoutHook see:

XMonad.Doc.Extending

data Aspect Source #

Constructors

Taller |
Wider |
Reset |
SlopeMod ([Rational] -> [Rational]) |

Instances

Message Aspect Source # |
Instance details Defined in XMonad.Layout.Mosaic

mosaic :: Rational -> [Rational] -> Mosaic a Source #

The relative magnitudes (the sign is ignored) of the rational numbers in the second argument determine the relative areas that the windows receive. The first number represents the size of the master window, the second is for the next window in the stack, and so on.

The list is extended with `++ repeat 1`, so `mosaic 1.5 []` is like a resizable grid.

The first parameter is the multiplicative factor to use when responding to the `Expand` message.

changeMaster :: (Rational -> Rational) -> X () Source #

These sample functions are meant to be applied to the list of window sizes through the `SlopeMod` message.

changeFocused :: (Rational -> Rational) -> X () Source #

Apply a function to the Rational that represents the currently focused window.

`Expand` and `Shrink` messages are responded to with `changeFocused (*delta)` or `changeFocused (delta/)` where `delta` is the first argument to `mosaic`.

This is exported because other functions (ex. `const 1`, `(+1)`) may be useful to apply to the current area.

data Mosaic a Source #

Instances

LayoutClass Mosaic a Source # |

Instance details

Defined in XMonad.Layout.Mosaic

Methods

runLayout :: Workspace WorkspaceId (Mosaic a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (Mosaic a)) Source #

doLayout :: Mosaic a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (Mosaic a)) Source #

pureLayout :: Mosaic a -> Rectangle -> Stack a -> [(a, Rectangle)] Source #

emptyLayout :: Mosaic a -> Rectangle -> X ([(a, Rectangle)], Maybe (Mosaic a)) Source #

handleMessage :: Mosaic a -> SomeMessage -> X (Maybe (Mosaic a)) Source #

pureMessage :: Mosaic a -> SomeMessage -> Maybe (Mosaic a) Source #

description :: Mosaic a -> String Source #

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