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

Copyright | (c) 2009 Nils Schweinsberg 2015 Evgeny Kurnevsky
License | BSD3-style (see LICENSE)
Maintainer | Nils Schweinsberg <mail@n-sch.de>
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Hooks.ScreenCorners

Contents

- Usage
- Adding screen corners
- Event hook
- Layout hook

Description

Run `X ()` actions by touching the edge of your screen with your mouse.

Synopsis

- data ScreenCorner
  - = SCUpperLeft
  - | SCUpperRight
  - | SCLowerLeft
  - | SCLowerRight
- addScreenCorner :: ScreenCorner -> X () -> X ()
- addScreenCorners :: [(ScreenCorner, X ())] -> X ()
- screenCornerEventHook :: Event -> X All
- screenCornerLayoutHook :: l a -> ModifiedLayout ScreenCornerLayout l a

# Usage

This extension adds KDE-like screen corners to XMonad. By moving your cursor into one of your screen corners you can trigger an `X ()` action, for example `XMonad.Actions.GridSelect.goToSelected` or `XMonad.Actions.CycleWS.nextWS` etc.

To use it, import it on top of your `xmonad.hs`:

    import XMonad.Hooks.ScreenCorners

Then add your screen corners in our startup hook:

    myStartupHook = do
        ...
        addScreenCorner SCUpperRight (goToSelected def { gs_cellwidth = 200})
        addScreenCorners [ (SCLowerRight, nextWS)
                         , (SCLowerLeft,  prevWS)
                         ]

Then add layout hook:

    myLayout = screenCornerLayoutHook $ tiled ||| Mirror tiled ||| Full where
        tiled   = Tall nmaster delta ratio
        nmaster = 1
        ratio   = 1 / 2
        delta   = 3 / 100

And finally wait for screen corner events in your event hook:

    myEventHook e = do
        ...
        screenCornerEventHook e

# Adding screen corners

data ScreenCorner Source #

Constructors

SCUpperLeft |
SCUpperRight |
SCLowerLeft |
SCLowerRight |

#### Instances

Instances details

Show ScreenCorner Source # |
Instance details Defined in XMonad.Hooks.ScreenCorners Methods showsPrec :: Int -> ScreenCorner -> ShowS Source # show :: ScreenCorner -> String Source # showList :: [ScreenCorner] -> ShowS Source #
Eq ScreenCorner Source # |
Instance details Defined in XMonad.Hooks.ScreenCorners Methods (==) :: ScreenCorner -> ScreenCorner -> Bool Source # (/=) :: ScreenCorner -> ScreenCorner -> Bool Source #
Ord ScreenCorner Source # |

Instance details

Defined in XMonad.Hooks.ScreenCorners

Methods

compare :: ScreenCorner -> ScreenCorner -> Ordering Source #

(<) :: ScreenCorner -> ScreenCorner -> Bool Source #

(<=) :: ScreenCorner -> ScreenCorner -> Bool Source #

(>) :: ScreenCorner -> ScreenCorner -> Bool Source #

(>=) :: ScreenCorner -> ScreenCorner -> Bool Source #

max :: ScreenCorner -> ScreenCorner -> ScreenCorner Source #

min :: ScreenCorner -> ScreenCorner -> ScreenCorner Source #

addScreenCorner :: ScreenCorner -> X () -> X () Source #

Add one single `X ()` action to a screen corner

addScreenCorners :: [(ScreenCorner, X ())] -> X () Source #

Add a list of `(ScreenCorner, X ())` tuples

# Event hook

screenCornerEventHook :: Event -> X All Source #

Handle screen corner events

# Layout hook

screenCornerLayoutHook :: l a -> ModifiedLayout ScreenCornerLayout l a Source #