xmonad-contrib-0.13: Third party extensions for xmonad

Copyright | (c) Nelson Elhage <nelhage@mit.edu>
License | BSD
Maintainer | Nelson Elhage <nelhage@mit.edu>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Actions.PhysicalScreens

Contents

- Usage

Description

Manipulate screens ordered by physical location instead of ID

Synopsis

- newtype PhysicalScreen = P Int
- getScreen :: PhysicalScreen -> X (Maybe ScreenId)
- viewScreen :: PhysicalScreen -> X ()
- sendToScreen :: PhysicalScreen -> X ()
- onNextNeighbour :: (WorkspaceId -> WindowSet -> WindowSet) -> X ()
- onPrevNeighbour :: (WorkspaceId -> WindowSet -> WindowSet) -> X ()

# Usage

This module allows you name Xinerama screens from XMonad using their physical location relative to each other (as reported by Xinerama), rather than their `ScreenID` s, which are arbitrarily determined by your X server and graphics hardware.

Screens are ordered by the upper-left-most corner, from top-to-bottom and then left-to-right.

Example usage in your `~/.xmonad/xmonad.hs` file:

    import XMonad.Actions.PhysicalScreens

    , ((modMask, xK_a), onPrevNeighbour W.view)
    , ((modMask, xK_o), onNextNeighbour W.view)
    , ((modMask .|. shiftMask, xK_a), onPrevNeighbour W.shift)
    , ((modMask .|. shiftMask, xK_o), onNextNeighbour W.shift)

    --
    -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
    -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
    --
    [((modm .|. mask, key), f sc)
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, mask) <- [(viewScreen, 0), (sendToScreen, shiftMask)]]

For detailed instructions on editing your key bindings, see XMonad.Doc.Extending.

newtype PhysicalScreen Source #

The type of the index of a screen by location

Constructors

P Int |

Instances

Enum PhysicalScreen Source # |

Methods

succ :: PhysicalScreen -> PhysicalScreen #

pred :: PhysicalScreen -> PhysicalScreen #

toEnum :: Int -> PhysicalScreen #

fromEnum :: PhysicalScreen -> Int #

enumFrom :: PhysicalScreen -> [PhysicalScreen] #

enumFromThen :: PhysicalScreen -> PhysicalScreen -> [PhysicalScreen] #

enumFromTo :: PhysicalScreen -> PhysicalScreen -> [PhysicalScreen] #

enumFromThenTo :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen -> [PhysicalScreen] #

Eq PhysicalScreen Source # |
Methods (==) :: PhysicalScreen -> PhysicalScreen -> Bool # (/=) :: PhysicalScreen -> PhysicalScreen -> Bool #
Integral PhysicalScreen Source # |

Methods

quot :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen #

rem :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen #

div :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen #

mod :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen #

quotRem :: PhysicalScreen -> PhysicalScreen -> (PhysicalScreen, PhysicalScreen) #

divMod :: PhysicalScreen -> PhysicalScreen -> (PhysicalScreen, PhysicalScreen) #

toInteger :: PhysicalScreen -> Integer #

Num PhysicalScreen Source # |
Methods (+) :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen # (-) :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen # (*) :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen # negate :: PhysicalScreen -> PhysicalScreen # abs :: PhysicalScreen -> PhysicalScreen # signum :: PhysicalScreen -> PhysicalScreen # fromInteger :: Integer -> PhysicalScreen #
Ord PhysicalScreen Source # |
Methods compare :: PhysicalScreen -> PhysicalScreen -> Ordering # (<) :: PhysicalScreen -> PhysicalScreen -> Bool # (<=) :: PhysicalScreen -> PhysicalScreen -> Bool # (>) :: PhysicalScreen -> PhysicalScreen -> Bool # (>=) :: PhysicalScreen -> PhysicalScreen -> Bool # max :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen # min :: PhysicalScreen -> PhysicalScreen -> PhysicalScreen #
Read PhysicalScreen Source # |
Methods readsPrec :: Int -> ReadS PhysicalScreen # readList :: ReadS [PhysicalScreen] # readPrec :: ReadPrec PhysicalScreen # readListPrec :: ReadPrec [PhysicalScreen] #
Real PhysicalScreen Source # |
Methods toRational :: PhysicalScreen -> Rational #
Show PhysicalScreen Source # |
Methods showsPrec :: Int -> PhysicalScreen -> ShowS # show :: PhysicalScreen -> String # showList :: [PhysicalScreen] -> ShowS #

getScreen :: PhysicalScreen -> X (Maybe ScreenId) Source #

Translate a physical screen index to a ScreenId

viewScreen :: PhysicalScreen -> X () Source #

Switch to a given physical screen

sendToScreen :: PhysicalScreen -> X () Source #

Send the active window to a given physical screen

onNextNeighbour :: (WorkspaceId -> WindowSet -> WindowSet) -> X () Source #

Apply operation on a WindowSet with the WorkspaceId of the next screen in the physical order as parameter.

onPrevNeighbour :: (WorkspaceId -> WindowSet -> WindowSet) -> X () Source #

Apply operation on a WindowSet with the WorkspaceId of the previous screen in the physical order as parameter.