aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--XMonad/Actions/CycleWS.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/XMonad/Actions/CycleWS.hs b/XMonad/Actions/CycleWS.hs
index 00dc53d..dc8db73 100644
--- a/XMonad/Actions/CycleWS.hs
+++ b/XMonad/Actions/CycleWS.hs
@@ -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