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

Copyright | (c) Peter De Wachter Ilya V. Portnov
License | BSD-style (see LICENSE)
Maintainer | Ilya V. Portnov <portnov84@rambler.ru>
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Layout.CircleEx

Contents

- Usage

Description

Circle is an elliptical, overlapping layout. Original code by Peter De Wachter, extended by Ilya Porntov.

Synopsis

- data CircleEx a = CircleEx {
  - cNMaster :: !Int
  - cMasterRatio :: !Rational
  - cStackRatio :: !Rational
  - cMultiplier :: !Rational
  - cDelta :: !Double
  }
- circle :: CircleEx a
- circleEx :: CircleEx a
- data CircleExMsg
  - = Rotate !Double
  - | IncStackRatio !Rational
  - | IncMultiplier !Rational

# Usage

The layout puts the first N windows (called master) into the center of screen. All others (called secondary, or stack) are organized in a circle (well, ellipse). When opening a new secondary window, its size will be slightly smaller than that of its predecessor (this is configurable). If the number of master windows is set to zero, all windows will be arranged in a circle. If there is more than one master window, they will be stacked in the center on top of each other. The size of each additional master window will again be slightly smaller than that of the former.

Since a picture says more than a thousand words, you see one here.

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

    import XMonad.Layout.CircleEx

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

    myCircle = circleEx {cDelta = -3*pi/4}
    myLayout = myCircle ||| Full ||| etc..
    main = xmonad def { layoutHook = myLayout }

This layout understands standard messages:

- `IncMasterN`: increase or decrease the number of master windows.
- `Shrink` and `Expand`: change the size of master windows.

More layout-specific messages are also supported, see `CircleExMsg` below.

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

data CircleEx a Source #

The layout data type. It is recommended to not use the `CircleEx` data constructor directly, and instead rely on record update syntax; for example: `circleEx {cMasterRatio = 4%5}`. In this way you can avoid nasty surprises if one day additional fields are added to `CircleEx`.

Constructors

CircleEx |

Fields

- cNMaster :: !Int

  Number of master windows. Default value is 1.

- cMasterRatio :: !Rational

  Size of master window in relation to screen size. Default value is `4%5`.

- cStackRatio :: !Rational

  Size of first secondary window in relation to screen size. Default value is `3%5`.

- cMultiplier :: !Rational

  Coefficient used to calculate the sizes of subsequent secondary windows. The size of the next window is calculated as the size of the previous one multiplied by this value. This value is also used to scale master windows, in case there is more than one. Default value is `5%6`. Set this to 1 if you want all secondary windows to have the same size.

- cDelta :: !Double

  Angle of rotation of the whole circle layout. Usual values are from 0 to 2π, although it will work outside this range as well. Default value of 0 means that the first secondary window will be placed at the right side of screen.

#### Instances

Instances details

LayoutClass CircleEx Window Source # |

Instance details

Defined in XMonad.Layout.CircleEx

Methods

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

doLayout :: CircleEx Window -> Rectangle -> Stack Window -> X ([(Window, Rectangle)], Maybe (CircleEx Window)) Source #

pureLayout :: CircleEx Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] Source #

emptyLayout :: CircleEx Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (CircleEx Window)) Source #

handleMessage :: CircleEx Window -> SomeMessage -> X (Maybe (CircleEx Window)) Source #

pureMessage :: CircleEx Window -> SomeMessage -> Maybe (CircleEx Window) Source #

description :: CircleEx Window -> String Source #

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

circle :: CircleEx a Source #

Circle layout with default settings:

- Number of master windows is set to 1
- `cMasterRatio` is set to `70/99`, which is nearly `1/sqrt(2)`
- `cStackRatio` is set to `2/5`
- `cMultiplier` is set to 1, which means all secondary windows will have the same size

This can be used as a drop-in replacement for XMonad.Layout.Circle.

circleEx :: CircleEx a Source #

Another variant of default settings for circle layout:

- Number of master windows is set to 1
- `cMasterRatio` is set to `4/5`
- `cStackRatio` is set to `3/5`
- `cMultiplier` is set to `5/6`

data CircleExMsg Source #

Specific messages understood by CircleEx layout.

Constructors

Rotate !Double | Rotate secondary windows by specific angle
IncStackRatio !Rational | Increase (or decrease, with negative value) sizes of secondary windows
IncMultiplier !Rational | Increase `cMultiplier`.

#### Instances

Instances details

Show CircleExMsg Source # |
Instance details Defined in XMonad.Layout.CircleEx Methods showsPrec :: Int -> CircleExMsg -> ShowS Source # show :: CircleExMsg -> String Source # showList :: [CircleExMsg] -> ShowS Source #
Eq CircleExMsg Source # |
Instance details Defined in XMonad.Layout.CircleEx Methods (==) :: CircleExMsg -> CircleExMsg -> Bool Source # (/=) :: CircleExMsg -> CircleExMsg -> Bool Source #
Message CircleExMsg Source # |
Instance details Defined in XMonad.Layout.CircleEx