aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authormail <mail@joachim-breitner.de>2007-12-31 18:16:09 +0100
committermail <mail@joachim-breitner.de>2007-12-31 18:16:09 +0100
commitd84c418e78ca9f24b9643e973794ef4fc016e6df (patch)
tree54380517787b42e1831d9452176c2de0d74570ab /XMonad/Actions
parent390229850013184e9f5558c093b74edfe7c8dd91 (diff)
downloadXMonadContrib-d84c418e78ca9f24b9643e973794ef4fc016e6df.tar.gz
XMonadContrib-d84c418e78ca9f24b9643e973794ef4fc016e6df.tar.xz
XMonadContrib-d84c418e78ca9f24b9643e973794ef4fc016e6df.zip
shiftPrevScreen and shiftNextScreen, to make CycleWS consistent
darcs-hash:20071231171609-c9905-843656222b29cf2f40922b243d78be02608a9a8a.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/CycleWS.hs21
1 files changed, 20 insertions, 1 deletions
diff --git a/XMonad/Actions/CycleWS.hs b/XMonad/Actions/CycleWS.hs
index 1920d44..38a8d53 100644
--- a/XMonad/Actions/CycleWS.hs
+++ b/XMonad/Actions/CycleWS.hs
@@ -23,7 +23,9 @@ module XMonad.Actions.CycleWS (
shiftToPrev,
toggleWS,
nextScreen,
- prevScreen
+ prevScreen,
+ shiftNextScreen,
+ shiftPrevScreen
) where
import Data.List ( findIndex )
@@ -44,6 +46,8 @@ import XMonad.Util.WorkspaceCompare
-- > , ((modMask x .|. shiftMask, xK_Up), shiftToPrev)
-- > , ((modMask x, xK_Right), nextScreen)
-- > , ((modMask x, xK_Left), prevScreen)
+-- > , ((modMask x .|. shiftMask, xK_Right), shiftNextScreen)
+-- > , ((modMask x .|. shiftMask, xK_Left), shiftPrevScreen)
-- > , ((modMask x, xK_t), toggleWS)
--
-- If you want to follow the moved window, you can use both actions:
@@ -113,3 +117,18 @@ screenBy d = do ws <- gets windowset
--let ss = sortBy screen (screens ws)
let now = screen (current ws)
return $ (now + fromIntegral d) `mod` fromIntegral (length (screens ws))
+
+-- | Move focused window to workspace on next screen
+shiftNextScreen :: X ()
+shiftNextScreen = shiftScreenBy 1
+
+-- | Move focused window to workspace on prev screen
+shiftPrevScreen :: X ()
+shiftPrevScreen = shiftScreenBy (-1)
+
+shiftScreenBy :: Int -> X ()
+shiftScreenBy d = do s <- screenBy d
+ mws <- screenWorkspace s
+ case mws of
+ Nothing -> return ()
+ Just ws -> windows (shift ws)