@@ -27,7 +27,7 @@ module XMonad.Layout.IndependentScreens (
27
27
whenCurrentOn ,
28
28
countScreens ,
29
29
workspacesOn ,
30
- workspaceOnScreen , focusWindow' , focusScreen , nthWorkspace , withWspOnScreen ,
30
+ workspaceOnScreen , focusWindow' , focusScreen , focusWorkspace , nthWorkspace , withWspOnScreen ,
31
31
-- * Converting between virtual and physical workspaces
32
32
-- $converting
33
33
marshall , unmarshall , unmarshallS , unmarshallW ,
@@ -40,6 +40,7 @@ import XMonad
40
40
import XMonad.Hooks.StatusBar.PP
41
41
import XMonad.Prelude
42
42
import qualified XMonad.StackSet as W
43
+ import XMonad.Actions.OnScreen (viewOnScreen )
43
44
44
45
-- $usage
45
46
-- You can use this module with the following in your @xmonad.hs@:
@@ -163,6 +164,11 @@ focusWindow' window ws
163
164
focusScreen :: ScreenId -> WindowSet -> WindowSet
164
165
focusScreen screenId = withWspOnScreen screenId W. view
165
166
167
+
168
+ -- | Focus the given workspace on the correct Xinerama screen.
169
+ focusWorkspace :: WorkspaceId -> WindowSet -> WindowSet
170
+ focusWorkspace workspaceId = viewOnScreen (unmarshallS workspaceId) workspaceId
171
+
166
172
-- | Get the nth virtual workspace
167
173
nthWorkspace :: Int -> X (Maybe VirtualWorkspace )
168
174
nthWorkspace n = (!? n) . workspaces' <$> asks config
0 commit comments