aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorits.sec <its.sec@gmx.net>2008-02-06 20:10:32 +0100
committerits.sec <its.sec@gmx.net>2008-02-06 20:10:32 +0100
commit8e132fc36b99d8f9132c392d81b4a714163c8e62 (patch)
tree8c6d3fcfe507a95538ac3c200655c5051c8c9d22 /XMonad/Actions
parent3a72afe4962384c13a69ee5cba7be46cc9494d3d (diff)
downloadXMonadContrib-8e132fc36b99d8f9132c392d81b4a714163c8e62.tar.gz
XMonadContrib-8e132fc36b99d8f9132c392d81b4a714163c8e62.tar.xz
XMonadContrib-8e132fc36b99d8f9132c392d81b4a714163c8e62.zip
add swapScreen to CycleWS
* add support for swapping the workspaces on screens to CycleWS darcs-hash:20080206191032-07ee0-9f041fb517000089fe62ac0ca621af36e1745253.gz
Diffstat (limited to 'XMonad/Actions')
-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