您可以尝试将其添加Logger
到ppExtras
:
import qualified XMonad.StackSet as W
import XMonad.Util.NamedWindows ( getName )
import Data.Traversable ( traverse )
import Data.Maybe ( maybeToList )
import Data.List ( (\\) )
logTitles :: X (Maybe String) -- this is a Logger
logTitles = withWindowSet $ fmap (Just . unwords) -- fuse window names
. traverse (fmap show . getName) -- show window names
. (\ws -> W.index ws \\ maybeToList (W.peek ws))
-- all windows except the focused (may be slow)
您可以将其添加到您的PP
喜欢中:
{
...
ppExtras = [logTitels]
ppOrder = \(ws:l:t:ts:_) -> ws : l : t : [xmobarColor "gray" "" ts]
-- Use dzenColor if you use dzen and not xmobar
-- ts is the string of the unfocused window titles (seperated by spaces)
...
}