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

Copyright | (c) Andrea Rossato 2007
License | BSD-style (see xmonad/LICENSE)
Maintainer | andrea.rossato@unibz.it
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.WindowArranger

Contents

- Usage

Description

This is a pure layout modifier that will let you move and resize windows with the keyboard in any layout.

Synopsis

- windowArrange :: l a -> ModifiedLayout WindowArranger l a
- windowArrangeAll :: l a -> ModifiedLayout WindowArranger l a
- data WindowArrangerMsg
  - = DeArrange
  - | Arrange
  - | IncreaseLeft Int
  - | IncreaseRight Int
  - | IncreaseUp Int
  - | IncreaseDown Int
  - | DecreaseLeft Int
  - | DecreaseRight Int
  - | DecreaseUp Int
  - | DecreaseDown Int
  - | MoveLeft Int
  - | MoveRight Int
  - | MoveUp Int
  - | MoveDown Int
  - | SetGeometry Rectangle
- data WindowArranger a
- memberFromList :: (b -> c) -> (c -> a -> Bool) -> a -> [b] -> [b]
- listFromList :: (b -> c) -> (c -> [a] -> Bool) -> [a] -> [b] -> [b]
- diff :: Eq a => ([a], [a]) -> ([a], [a])

# Usage

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

    import XMonad.Layout.WindowArranger
    myLayout = layoutHook def
    main = xmonad def { layoutHook = windowArrange myLayout }

or

    main = xmonad def { layoutHook = windowArrangeAll myLayout }

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

You may also want to define some key binding to move or resize windows. These are good defaults:

           , ((modm .|. controlMask              , xK_s    ), sendMessage  Arrange         )
           , ((modm .|. controlMask .|. shiftMask, xK_s    ), sendMessage  DeArrange       )
           , ((modm .|. controlMask              , xK_Left ), sendMessage (MoveLeft      1))
           , ((modm .|. controlMask              , xK_Right), sendMessage (MoveRight     1))
           , ((modm .|. controlMask              , xK_Down ), sendMessage (MoveDown      1))
           , ((modm .|. controlMask              , xK_Up   ), sendMessage (MoveUp        1))
           , ((modm                 .|. shiftMask, xK_Left ), sendMessage (IncreaseLeft  1))
           , ((modm                 .|. shiftMask, xK_Right), sendMessage (IncreaseRight 1))
           , ((modm                 .|. shiftMask, xK_Down ), sendMessage (IncreaseDown  1))
           , ((modm                 .|. shiftMask, xK_Up   ), sendMessage (IncreaseUp    1))
           , ((modm .|. controlMask .|. shiftMask, xK_Left ), sendMessage (DecreaseLeft  1))
           , ((modm .|. controlMask .|. shiftMask, xK_Right), sendMessage (DecreaseRight 1))
           , ((modm .|. controlMask .|. shiftMask, xK_Down ), sendMessage (DecreaseDown  1))
           , ((modm .|. controlMask .|. shiftMask, xK_Up   ), sendMessage (DecreaseUp    1))

For detailed instructions on editing your key bindings, see the tutorial.

windowArrange :: l a -> ModifiedLayout WindowArranger l a Source #

A layout modifier to float the windows in a workspace

windowArrangeAll :: l a -> ModifiedLayout WindowArranger l a Source #

A layout modifier to float all the windows in a workspace

data WindowArrangerMsg Source #

Constructors

DeArrange |
Arrange |
IncreaseLeft Int |
IncreaseRight Int |
IncreaseUp Int |
IncreaseDown Int |
DecreaseLeft Int |
DecreaseRight Int |
DecreaseUp Int |
DecreaseDown Int |
MoveLeft Int |
MoveRight Int |
MoveUp Int |
MoveDown Int |
SetGeometry Rectangle |

#### Instances

Instances details

Message WindowArrangerMsg Source # |
Instance details Defined in XMonad.Layout.WindowArranger

data WindowArranger a Source #

#### Instances

Instances details

(Show a, Read a, Eq a) => LayoutModifier WindowArranger a Source # |

Instance details

Defined in XMonad.Layout.WindowArranger

Methods

modifyLayout :: LayoutClass l a => WindowArranger a -> Workspace WorkspaceId (l a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (l a)) Source #

modifyLayoutWithUpdate :: LayoutClass l a => WindowArranger a -> Workspace WorkspaceId (l a) a -> Rectangle -> X (([(a, Rectangle)], Maybe (l a)), Maybe (WindowArranger a)) Source #

handleMess :: WindowArranger a -> SomeMessage -> X (Maybe (WindowArranger a)) Source #

handleMessOrMaybeModifyIt :: WindowArranger a -> SomeMessage -> X (Maybe (Either (WindowArranger a) SomeMessage)) Source #

pureMess :: WindowArranger a -> SomeMessage -> Maybe (WindowArranger a) Source #

redoLayout :: WindowArranger a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (WindowArranger a)) Source #

pureModifier :: WindowArranger a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> ([(a, Rectangle)], Maybe (WindowArranger a)) Source #

hook :: WindowArranger a -> X () Source #

unhook :: WindowArranger a -> X () Source #

modifierDescription :: WindowArranger a -> String Source #

modifyDescription :: LayoutClass l a => WindowArranger a -> l a -> String Source #

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

memberFromList :: (b -> c) -> (c -> a -> Bool) -> a -> [b] -> [b] Source #

Given a function to be applied to each member of ta list, and a function to check a condition by processing this transformed member with something, you get the first member that satisfy the condition, or an empty list.

listFromList :: (b -> c) -> (c -> [a] -> Bool) -> [a] -> [b] -> [b] Source #

Given a function to be applied to each member of a list, and a function to check a condition by processing this transformed member with the members of a list, you get the list of members that satisfy the condition.

diff :: Eq a => ([a], [a]) -> ([a], [a]) Source #

Get the list of elements to be deleted and the list of elements to be added to the first list in order to get the second list.