Skip to content

Commit

Permalink
Add some docs references for workspace filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
liskin committed Oct 20, 2021
1 parent 08ec79e commit 79b130b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 7 additions & 5 deletions XMonad/Util/NamedScratchpad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion XMonad/Util/Scratchpad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 3 additions & 1 deletion XMonad/Util/WorkspaceCompare.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 79b130b

Please sign in to comment.