mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-01 20:51:55 -07:00
Move workspace fetching logic from Config.hs to Operations.hs
This commit is contained in:
@@ -136,7 +136,7 @@ keys = M.fromList $
|
|||||||
-- Keybindings to each screen :
|
-- Keybindings to each screen :
|
||||||
-- mod-wer (underneath 123) switches to physical/Xinerama screens 1 2 and 3
|
-- mod-wer (underneath 123) switches to physical/Xinerama screens 1 2 and 3
|
||||||
++
|
++
|
||||||
[((m .|. modMask, key), gets workspace >>= f . (+1) . fromMaybe 0 . W.workspace sc)
|
[((m .|. modMask, key), screenWorkspace sc >>= f)
|
||||||
| (key, sc) <- zip [xK_s, xK_d, xK_f] [0..]
|
| (key, sc) <- zip [xK_s, xK_d, xK_f] [0..]
|
||||||
, (f, m) <- [(view, 0), (tag, shiftMask)]]
|
, (f, m) <- [(view, 0), (tag, shiftMask)]]
|
||||||
|
|
||||||
|
@@ -238,6 +238,10 @@ view o = do
|
|||||||
setTopFocus
|
setTopFocus
|
||||||
where n = o-1
|
where n = o-1
|
||||||
|
|
||||||
|
-- | 'screenWorkspace sc' returns the workspace number viewed by 'sc'.
|
||||||
|
screenWorkspace :: Int -> X Int
|
||||||
|
screenWorkspace sc = fmap (succ . fromMaybe 0 . W.workspace sc) (gets workspace)
|
||||||
|
|
||||||
-- | True if window is under management by us
|
-- | True if window is under management by us
|
||||||
isClient :: Window -> X Bool
|
isClient :: Window -> X Bool
|
||||||
isClient w = liftM (W.member w) (gets workspace)
|
isClient w = liftM (W.member w) (gets workspace)
|
||||||
|
Reference in New Issue
Block a user