X.U.ClickableWorkspaces: Improve getWsIndex doc

This commit is contained in:
Tomas Janousek
2021-04-15 08:48:40 +01:00
parent 1d7abb102f
commit 52bb28824d

View File

@@ -56,13 +56,14 @@ import Data.List (elemIndex)
clickableWrap :: Int -> String -> String clickableWrap :: Int -> String -> String
clickableWrap i ws = xmobarAction ("xdotool set_desktop " ++ show i) "1" ws clickableWrap i ws = xmobarAction ("xdotool set_desktop " ++ show i) "1" ws
-- Note that 'getWsIndex' from "XMonad.Util.WorkspaceCompare" only works for -- | 'XMonad.Util.WorkspaceCompare.getWsIndex' extended to handle workspaces
-- predefined workspaces. When used together with "XMonad.Action.DynamicWorkspaces", -- not the static 'workspaces' config, such as those created by
-- 'getWsIndex' needs to be rewritten to get the correct index of a workspace. -- "XMonad.Action.DynamicWorkspaces".
-- The workspace order perceived by @xdotool@ is the same as that by 'getSortByIndex'. --
-- So 'getSortByIndex' is used in such case. -- Uses 'getSortByIndex', as that's what "XMonad.Hooks.EwmhDesktops" uses to
-- export the information to tools like @xdotool@. (Note that EwmhDesktops can
-- | Return the index of a workspace if it exists. -- be configured with a custom sort function, and we don't handle that here
-- yet.)
getWsIndex :: X (WorkspaceId -> Maybe Int) getWsIndex :: X (WorkspaceId -> Maybe Int)
getWsIndex = do getWsIndex = do
wSort <- getSortByIndex wSort <- getSortByIndex