From 6fd934aaf1fbe70c3c2e9eed6cec340f553e4d61 Mon Sep 17 00:00:00 2001 From: m1mir Date: Fri, 24 Jan 2025 02:56:59 +0100 Subject: [PATCH] docs: Add usage example for focusWorkspace. --- XMonad/Hooks/EwmhDesktops.hs | 4 +--- XMonad/Layout/IndependentScreens.hs | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index 661b48156..7bc36ee1a 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -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. diff --git a/XMonad/Layout/IndependentScreens.hs b/XMonad/Layout/IndependentScreens.hs index 76893cac8..47da5dc1d 100644 --- a/XMonad/Layout/IndependentScreens.hs +++ b/XMonad/Layout/IndependentScreens.hs @@ -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