Export X.A.CycleWS.screenBy (issue 439)

This commit is contained in:
Adam Vogt 2011-06-07 00:20:53 +00:00
parent d752141be1
commit ff41d7dc68

View File

@ -73,6 +73,8 @@ module XMonad.Actions.CycleWS (
, toggleOrDoSkip , toggleOrDoSkip
, skipTags , skipTags
, screenBy
) where ) where
import Control.Monad ( unless ) import Control.Monad ( unless )
@ -313,6 +315,17 @@ switchScreen d = do s <- screenBy d
Nothing -> return () Nothing -> return ()
Just ws -> windows (view ws) Just ws -> windows (view ws)
{- | Get the 'ScreenId' /d/ places over. Example usage is a variation of the
the default screen keybindings:
> -- mod-{w,e}, Switch to previous/next Xinerama screen
> -- mod-shift-{w,e}, Move client to previous/next Xinerama screen
> --
> [((m .|. modm, key), sc >>= screenWorkspace >>= flip whenJust (windows . f))
> | (key, sc) <- zip [xK_w, xK_e] [(screenBy (-1)),(screenBy 1)]
> , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
-}
screenBy :: Int -> X (ScreenId) screenBy :: Int -> X (ScreenId)
screenBy d = do ws <- gets windowset screenBy d = do ws <- gets windowset
--let ss = sortBy screen (screens ws) --let ss = sortBy screen (screens ws)