Skip to content

Commit bab69a9

Browse files
committed
X.L.IndependentScreens: Added focusWorkspace function.
1 parent 0bf796e commit bab69a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: XMonad/Layout/IndependentScreens.hs

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module XMonad.Layout.IndependentScreens (
2727
whenCurrentOn,
2828
countScreens,
2929
workspacesOn,
30-
workspaceOnScreen, focusWindow', focusScreen, nthWorkspace, withWspOnScreen,
30+
workspaceOnScreen, focusWindow', focusScreen, focusWorkspace, nthWorkspace, withWspOnScreen,
3131
-- * Converting between virtual and physical workspaces
3232
-- $converting
3333
marshall, unmarshall, unmarshallS, unmarshallW,
@@ -40,6 +40,7 @@ import XMonad
4040
import XMonad.Hooks.StatusBar.PP
4141
import XMonad.Prelude
4242
import qualified XMonad.StackSet as W
43+
import XMonad.Actions.OnScreen (viewOnScreen)
4344

4445
-- $usage
4546
-- You can use this module with the following in your @xmonad.hs@:
@@ -163,6 +164,11 @@ focusWindow' window ws
163164
focusScreen :: ScreenId -> WindowSet -> WindowSet
164165
focusScreen screenId = withWspOnScreen screenId W.view
165166

167+
168+
-- | Focus the given workspace on the correct Xinerama screen.
169+
focusWorkspace :: WorkspaceId -> WindowSet -> WindowSet
170+
focusWorkspace workspaceId = viewOnScreen (unmarshallS workspaceId) workspaceId
171+
166172
-- | Get the nth virtual workspace
167173
nthWorkspace :: Int -> X (Maybe VirtualWorkspace)
168174
nthWorkspace n = (!? n) . workspaces' <$> asks config

0 commit comments

Comments
 (0)