mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 12:41:52 -07:00
add swapScreen to CycleWS
* add support for swapping the workspaces on screens to CycleWS
This commit is contained in:
@@ -50,6 +50,8 @@ module XMonad.Actions.CycleWS (
|
|||||||
, prevScreen
|
, prevScreen
|
||||||
, shiftNextScreen
|
, shiftNextScreen
|
||||||
, shiftPrevScreen
|
, shiftPrevScreen
|
||||||
|
, swapNextScreen
|
||||||
|
, swapPrevScreen
|
||||||
|
|
||||||
-- * Moving between workspaces, take two!
|
-- * Moving between workspaces, take two!
|
||||||
-- $taketwo
|
-- $taketwo
|
||||||
@@ -254,6 +256,21 @@ screenBy d = do ws <- gets windowset
|
|||||||
let now = screen (current ws)
|
let now = screen (current ws)
|
||||||
return $ (now + fromIntegral d) `mod` fromIntegral (length (screens 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
|
-- | Move focused window to workspace on next screen
|
||||||
shiftNextScreen :: X ()
|
shiftNextScreen :: X ()
|
||||||
shiftNextScreen = shiftScreenBy 1
|
shiftNextScreen = shiftScreenBy 1
|
||||||
|
Reference in New Issue
Block a user