mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -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
|
||||
, 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
|
||||
|
Reference in New Issue
Block a user