X.A.WorkspaceNames: Update X.H.DynamicLog references

This commit is contained in:
Yecine Megdiche 2021-10-05 19:29:29 +02:00
parent 45a07b0e1b
commit c2f45b49ff

View File

@ -9,7 +9,7 @@
-- Stability : experimental -- Stability : experimental
-- Portability : unportable -- Portability : unportable
-- --
-- Provides bindings to rename workspaces, show these names in DynamicLog and -- Provides bindings to rename workspaces, show these names in a status bar and
-- swap workspaces along with their names. These names survive restart. -- swap workspaces along with their names. These names survive restart.
-- Together with "XMonad.Layout.WorkspaceDir" this provides for a fully -- Together with "XMonad.Layout.WorkspaceDir" this provides for a fully
-- dynamic topic space workflow. -- dynamic topic space workflow.
@ -49,7 +49,7 @@ import qualified XMonad.Util.ExtensibleState as XS
import XMonad.Actions.CycleWS (findWorkspace, WSType(..), Direction1D(..), anyWS) import XMonad.Actions.CycleWS (findWorkspace, WSType(..), Direction1D(..), anyWS)
import qualified XMonad.Actions.SwapWorkspaces as Swap import qualified XMonad.Actions.SwapWorkspaces as Swap
import XMonad.Hooks.DynamicLog (PP(..)) import XMonad.Hooks.StatusBar.PP (PP(..))
import XMonad.Prompt (mkXPrompt, XPConfig) import XMonad.Prompt (mkXPrompt, XPConfig)
import XMonad.Prompt.Workspace (Wor(Wor)) import XMonad.Prompt.Workspace (Wor(Wor))
import XMonad.Util.WorkspaceCompare (getSortByIndex) import XMonad.Util.WorkspaceCompare (getSortByIndex)
@ -65,10 +65,12 @@ import qualified Data.Map as M
-- --
-- > , ((modm .|. shiftMask, xK_r ), renameWorkspace def) -- > , ((modm .|. shiftMask, xK_r ), renameWorkspace def)
-- --
-- and apply workspaceNamesPP to your DynamicLog pretty-printer: -- and apply workspaceNamesPP to your pretty-printer:
-- --
-- > myLogHook = -- > myPP = workspaceNamesPP xmobarPP
-- > workspaceNamesPP xmobarPP >>= dynamicLogString >>= xmonadPropLog --
-- Check "XMonad.Hooks.StatusBar" for more information on how to incorprate
-- this into your status bar.
-- --
-- We also provide a modification of "XMonad.Actions.SwapWorkspaces"\'s -- We also provide a modification of "XMonad.Actions.SwapWorkspaces"\'s
-- functionality, which may be used this way: -- functionality, which may be used this way:
@ -133,7 +135,7 @@ renameWorkspace conf =
mkXPrompt pr conf (const (return [])) setCurrentWorkspaceName mkXPrompt pr conf (const (return [])) setCurrentWorkspaceName
where pr = Wor "Workspace name: " where pr = Wor "Workspace name: "
-- | Modify "XMonad.Hooks.DynamicLog"\'s pretty-printing format to show -- | Modify 'XMonad.Hooks.StatusBar.PP.PP'\'s pretty-printing format to show
-- workspace names as well. -- workspace names as well.
workspaceNamesPP :: PP -> X PP workspaceNamesPP :: PP -> X PP
workspaceNamesPP pp = getWorkspaceNames ":" <&> \ren -> pp{ ppRename = ppRename pp >=> ren } workspaceNamesPP pp = getWorkspaceNames ":" <&> \ren -> pp{ ppRename = ppRename pp >=> ren }