xmonad-contrib-0.15: Third party extensions for xmonad

Copyright(c) Nelson Elhage <nelhage@mit.edu>
LicenseBSD
MaintainerNelson Elhage <nelhage@mit.edu>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

XMonad.Actions.PhysicalScreens

Contents

Description

Manipulate screens ordered by physical location instead of ID

Synopsis

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.

You can specify how to order the screen by giving a ScreenComparator. To create a screen comparator you can use screenComparatorByRectangle or screenComparatorByScreenId. The default ScreenComparator orders screens 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
import Data.Default
, ((modMask, xK_a), onPrevNeighbour def W.view)
, ((modMask, xK_o), onNextNeighbour def W.view)
, ((modMask .|. shiftMask, xK_a), onPrevNeighbour def W.shift)
, ((modMask .|. shiftMask, xK_o), onNextNeighbour def 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 def, 0), (sendToScreen def, shiftMask)]]

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

newtype PhysicalScreen #

The type of the index of a screen by location

Constructors

P Int 

Instances

Enum PhysicalScreen # 
Eq PhysicalScreen # 
Integral PhysicalScreen # 
Num PhysicalScreen # 
Ord PhysicalScreen # 
Read PhysicalScreen # 
Real PhysicalScreen # 
Show PhysicalScreen # 

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

Translate a physical screen index to a ScreenId

viewScreen :: ScreenComparator -> PhysicalScreen -> X () #

Switch to a given physical screen

sendToScreen :: ScreenComparator -> PhysicalScreen -> X () #

Send the active window to a given physical screen

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

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

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

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

horizontalScreenOrderer :: ScreenComparator #

orders screens by the upper-left-most corner, from left-to-right

verticalScreenOrderer :: ScreenComparator #

orders screens by the upper-left-most corner, from top-to-bottom

newtype ScreenComparator #

A ScreenComparator allow to compare two screen based on their coordonate and Xinerama Id

Instances

Default ScreenComparator #

The default ScreenComparator orders screens by the upper-left-most corner, from top-to-bottom

screenComparatorById :: (ScreenId -> ScreenId -> Ordering) -> ScreenComparator #

Compare screen only by their Xinerama id

screenComparatorByRectangle :: (Rectangle -> Rectangle -> Ordering) -> ScreenComparator #

Compare screen only by their coordonate