From 79b130b9d626414d02c8980f86e0b9ccf09e6af5 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Wed, 20 Oct 2021 10:37:02 +0100 Subject: [PATCH] Add some docs references for workspace filtering --- XMonad/Util/NamedScratchpad.hs | 12 +++++++----- XMonad/Util/Scratchpad.hs | 4 +++- XMonad/Util/WorkspaceCompare.hs | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/XMonad/Util/NamedScratchpad.hs b/XMonad/Util/NamedScratchpad.hs index 9aecbdcb98..12d6629304 100644 --- a/XMonad/Util/NamedScratchpad.hs +++ b/XMonad/Util/NamedScratchpad.hs @@ -90,11 +90,13 @@ import qualified XMonad.StackSet as W -- For detailed instruction on editing the key binding see -- "XMonad.Doc.Extending#Editing_key_bindings" -- --- For some applications (like displaying your workspaces in a status bar) it is --- convenient to filter out the @NSP@ workspace when looking at all workspaces. --- For this, you can use functions 'XMonad.Hooks.StatusBar.PP.filterOutWsPP' and --- 'XMonad.Util.WorkspaceCompare.filterOutWs'. See the documentation of these --- functions for examples. +-- For some applications (like displaying your workspaces in a status bar) it +-- is convenient to filter out the @NSP@ workspace when looking at all +-- workspaces. For this, you can use 'XMonad.Hooks.StatusBar.PP.filterOutWsPP', +-- or 'XMonad.Util.WorkspaceCompare.filterOutWs' together with +-- 'XMonad.Hooks.EwmhDesktops.addEwmhWorkspaceSort' if your status bar gets +-- the list of workspaces from EWMH. See the documentation of these functions +-- for examples. -- -- Further, there is also a @logHook@ that you can use to hide -- scratchpads when they lose focus; this is functionality akin to what diff --git a/XMonad/Util/Scratchpad.hs b/XMonad/Util/Scratchpad.hs index ca62a9c6ce..281835ec63 100644 --- a/XMonad/Util/Scratchpad.hs +++ b/XMonad/Util/Scratchpad.hs @@ -111,7 +111,9 @@ scratchpadManageHook rect = namedScratchpadManageHook [NS "" "" scratchpadQuery -- | Transforms a workspace list containing the SP workspace into one that --- doesn't contain it. Intended for use with logHooks. +-- doesn't contain it. Intended for use with 'logHook's (see +-- 'XMonad.Hooks.StatusBar.PP.filterOutWsPP') and "XMonad.Hooks.EwmhDesktops" +-- (see 'XMonad.Hooks.EwmhDesktops.addEwmhWorkspaceSort'). scratchpadFilterOutWorkspace :: [WindowSpace] -> [WindowSpace] scratchpadFilterOutWorkspace = filterOutWs [scratchpadWorkspaceTag] diff --git a/XMonad/Util/WorkspaceCompare.hs b/XMonad/Util/WorkspaceCompare.hs index 1290d1daaf..facc09940a 100644 --- a/XMonad/Util/WorkspaceCompare.hs +++ b/XMonad/Util/WorkspaceCompare.hs @@ -33,7 +33,9 @@ type WorkspaceCompare = WorkspaceId -> WorkspaceId -> Ordering type WorkspaceSort = [WindowSpace] -> [WindowSpace] -- | Transforms a workspace list by filtering out the workspaces that --- correspond to the given 'tag's. Intended for use with logHooks. +-- correspond to the given 'tag's. Intended for use with 'logHook's (see +-- 'XMonad.Hooks.StatusBar.PP.filterOutWsPP') and "XMonad.Hooks.EwmhDesktops" +-- (see 'XMonad.Hooks.EwmhDesktops.addEwmhWorkspaceSort'). filterOutWs :: [WorkspaceId] -> WorkspaceSort filterOutWs ws = filter (\S.Workspace{ S.tag = tag } -> tag `notElem` ws)