add swapScreen to CycleWS

* add support for swapping the workspaces on screens to CycleWS
This commit is contained in:
its.sec
2008-02-06 19:10:32 +00:00
parent 8578cf419a
commit 3e5b16da3d

View File

@@ -50,6 +50,8 @@ module XMonad.Actions.CycleWS (
, prevScreen
, shiftNextScreen
, shiftPrevScreen
, swapNextScreen
, swapPrevScreen
-- * Moving between workspaces, take two!
-- $taketwo
@@ -254,6 +256,21 @@ screenBy d = do ws <- gets windowset
let now = screen (current ws)
return $ (now + fromIntegral d) `mod` fromIntegral (length (screens ws))
-- | Swap current screen with next screen
swapNextScreen :: X ()
swapNextScreen = swapScreen 1
-- | Swap current screen with previous screen
swapPrevScreen :: X ()
swapPrevScreen = swapScreen (-1)
swapScreen :: Int -> X ()
swapScreen d = do s <- screenBy d
mws <- screenWorkspace s
case mws of
Nothing -> return ()
Just ws -> windows (greedyView ws)
-- | Move focused window to workspace on next screen
shiftNextScreen :: X ()
shiftNextScreen = shiftScreenBy 1