Skip to content

Commit

Permalink
docs: Add usage example for focusWorkspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1mir committed Jan 24, 2025
1 parent aacfd31 commit 6fd934a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions XMonad/Hooks/EwmhDesktops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,12 @@ setEwmhActivateHook h = XC.modifyDef $ \c -> c{ activateHook = h }
-- > import XMonad.Actions.OnScreen
-- > import XMonad.Layout.IndependentScreens
-- >
-- > main = xmonad $ ... . setEwmhSwitchDesktopAction switchDesktopAction . ewmh . ... $
-- > main = xmonad $ ... . setEwmhSwitchDesktopAction focusWorkspace . ewmh . ... $
-- > def{
-- > ...
-- > workspaces = withScreens 2 (workspaces def)
-- > ...
-- > }
-- >
-- > switchDesktopAction workspaceId = viewOnScreen (unmarshallS workspaceId) workspaceId

-- | Set (replace) the action which is invoked when a client sends a
-- @_NET_CURRENT_DESKTOP@ request to switch workspace.
Expand Down
1 change: 1 addition & 0 deletions XMonad/Layout/IndependentScreens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ focusScreen screenId = withWspOnScreen screenId W.view


-- | Focus the given workspace on the correct Xinerama screen.
-- An example usage can be found at `XMonad.Hooks.EwmhDesktops.setEwmhSwitchDesktopAction`
focusWorkspace :: WorkspaceId -> WindowSet -> WindowSet
focusWorkspace workspaceId = viewOnScreen (unmarshallS workspaceId) workspaceId

Expand Down

0 comments on commit 6fd934a

Please sign in to comment.