xmonad-contrib-bluetilebranch-0.8.1.3: Third party extensions for xmonadSource codeContentsIndex
XMonad.Layout.LayoutBuilder
Portabilityunportable
Stabilityunstable
Maintainernone
Contents
Usage
Description
A layout combinator that sends a specified number of windows to one rectangle and the rest to another.
Synopsis
layoutN :: (Read a, Eq a, LayoutClass l1 a, LayoutClass l2 a, LayoutClass l3 a) => Int -> SubBox -> Maybe SubBox -> l1 a -> LayoutN l2 l3 a -> LayoutN l1 (LayoutN l2 l3) a
layoutR :: (Read a, Eq a, LayoutClass l1 a, LayoutClass l2 a, LayoutClass l3 a) => Rational -> Rational -> SubBox -> Maybe SubBox -> l1 a -> LayoutN l2 l3 a -> LayoutN l1 (LayoutN l2 l3) a
layoutAll :: (Read a, Eq a, LayoutClass l1 a) => SubBox -> l1 a -> LayoutN l1 Full a
data IncLayoutN = IncLayoutN Int
data SubMeasure
= Abs Int
| Rel Rational
data SubBox = SubBox SubMeasure SubMeasure SubMeasure SubMeasure
absBox :: Int -> Int -> Int -> Int -> SubBox
relBox :: Rational -> Rational -> Rational -> Rational -> SubBox
Usage

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

 import XMonad.Layout.LayoutBuilder

Then edit your layoutHook by adding something like:

 myLayouts = ( (layoutN 1 (relBox 0 0 0.5 1) (Just $ relBox 0 0 1 1) $ simpleTabbed)
             $ (layoutAll (relBox 0.5 0 1 1)                         $ simpleTabbed)
             ) |||
             ( (layoutN 1       (relBox (1/3) 0 (1/2) 1) (Just $ relBox 0 0 1 1) $ Tall 0 0 0)
             $ (layoutR 0.1 0.5 (relBox (2/3) 0 1     1) Nothing                 $ Tall 0 0 0)
             $ (layoutAll       (relBox 0     0 (1/3) 1)                         $ Tall 0 0 0)
             ) |||
             ( (layoutN 1 (absBox (-512-200) 0 512        0) (Just $ relBox 0 0 1 1) $ simpleTabbed)
             $ (layoutN 1 (absBox (-200)     0 0          0) Nothing                 $ simpleTabbed)
             $ (layoutAll (absBox 0          0 (-512-200) 0)                         $ simpleTabbed)
             ) ||| Full ||| etc... 
 main = xmonad defaultConfig { layoutHook = myLayouts }

This will produce a layout similar to DragPane, but with the possibility to have multiple windows in the left half and tabs that show the available windows. It will also produce a layout similar to ThreeColMid and a special layout created for use with a 80 columns wide Emacs window, its sidebar and a tabbed area for all other windows.

This module can be used to create many different custom layouts, but there are limitations. The primary limitation can be observed in the second and third example when there are only two columns with windows in them. The leftmost area is left blank. These blank areas can be avoided by placing the rectangles appropriately.

These examples require XMonad.Layout.Tabbed.

For more detailed instructions on editing the layoutHook see:

XMonad.Doc.Extending

You may wish to add the following keybindings:

    , ((modMask x .|. shiftMask, xK_h ), sendMessage $ IncLayoutN (-1))
    , ((modMask x .|. shiftMask, xK_l ), sendMessage $ IncLayoutN 1)

For detailed instruction on editing the key binding see:

XMonad.Doc.Extending.

layoutNSource
:: (Read a, Eq a, LayoutClass l1 a, LayoutClass l2 a, LayoutClass l3 a)
=> IntThe number of windows to handle
-> SubBoxThe box to place the windows in
-> Maybe SubBoxPossibly an alternative box that is used when this layout handles all windows that are left
-> l1 aThe layout to use in the specified area
-> LayoutN l2 l3 aWhere to send the remaining windows
-> LayoutN l1 (LayoutN l2 l3) aThe resulting layout
Use the specified layout in the described area for N windows and send the rest of the windows to the next layout in the chain. It is possible to supply an alternative area that will then be used instead, if there are no windows to send to the next layout.
layoutRSource
:: (Read a, Eq a, LayoutClass l1 a, LayoutClass l2 a, LayoutClass l3 a)
=> RationalHow much to change the ratio with each IncLayoutN
-> RationalThe ratio of the remaining windows to handle
-> SubBoxThe box to place the windows in
-> Maybe SubBoxPossibly an alternative box that is used when this layout handles all windows that are left
-> l1 aThe layout to use in the specified area
-> LayoutN l2 l3 aWhere to send the remaining windows
-> LayoutN l1 (LayoutN l2 l3) aThe resulting layout
As layoutN, but the number of windows is given relative to the total number of windows remaining to be handled. The first argument is how much to change the ratio when using IncLayoutN, and the second is the initial ratio.
layoutAllSource
:: (Read a, Eq a, LayoutClass l1 a)
=> SubBoxThe box to place the windows in
-> l1 aThe layout to use in the specified area
-> LayoutN l1 Full aThe resulting layout
Use the specified layout in the described area for all remaining windows.
data IncLayoutN Source
Change the number of windows handled by the focused layout.
Constructors
IncLayoutN Int
show/hide Instances
data SubMeasure Source
The absolute or relative measures used to describe the area a layout should be placed in. For negative absolute values the total remaining space will be added. For sizes, the remaining space will also be added for zeroes. Relative values are applied on the remaining space after the top-left corner of the box have been removed.
Constructors
Abs Int
Rel Rational
show/hide Instances
data SubBox Source
A box to place a layout in. The stored values are xpos, ypos, width and height.
Constructors
SubBox SubMeasure SubMeasure SubMeasure SubMeasure
show/hide Instances
absBoxSource
:: IntAbsolute X-Position
-> IntAbsolute Y-Position
-> IntAbsolute width
-> IntAbsolute height
-> SubBoxThe resulting SubBox describing the area
Create a box with only absolute measurements. If the values are negative, the total remaining space will be added. For sizes it will also be added for zeroes.
relBoxSource
:: RationalRelative X-Position with respect to the surrounding area
-> RationalRelative Y-Position with respect to the surrounding area
-> RationalRelative width with respect to the remaining width
-> RationalRelative height with respect to the remaining height
-> SubBoxThe resulting SubBox describing the area
Create a box with only relative measurements.
Produced by Haddock version 2.4.2