mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
xmonad: remove count in PP for xmobar
This commit is contained in:
parent
c2a37b5f72
commit
5a39fe89c5
1 changed files with 10 additions and 29 deletions
|
|
@ -26,7 +26,6 @@ import XMonad.Util.NamedScratchpad
|
||||||
import XMonad.Util.SpawnOnce
|
import XMonad.Util.SpawnOnce
|
||||||
import XMonad.Layout.Magnifier
|
import XMonad.Layout.Magnifier
|
||||||
|
|
||||||
import Data.Function
|
|
||||||
import Data.Char.Greek
|
import Data.Char.Greek
|
||||||
import Data.Ratio
|
import Data.Ratio
|
||||||
import Data.Semigroup
|
import Data.Semigroup
|
||||||
|
|
@ -357,33 +356,15 @@ fullFloat = W.RationalRect 0 0 1 1
|
||||||
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
||||||
|
|
||||||
xmobarConfig :: StatusBarConfig
|
xmobarConfig :: StatusBarConfig
|
||||||
xmobarConfig = statusBarProp "xmobar -x 0" myPrettyPrinter
|
xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter)
|
||||||
where
|
where
|
||||||
mkPpCurrent :: X (String -> String)
|
myPrettyPrinter :: PP
|
||||||
mkPpCurrent = do
|
myPrettyPrinter =
|
||||||
windowCount <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
filterOutWsPP [scratchpadWorkspaceTag]
|
||||||
pure $ \wid ->
|
|
||||||
wid <> (if windowCount > 1 then ":" <> show windowCount else mempty)
|
|
||||||
& xmobarColor "#000000" "#ffffff" . wrap " " " "
|
|
||||||
|
|
||||||
mkPpHidden :: X (String -> String)
|
|
||||||
mkPpHidden = do
|
|
||||||
m <- gets $ M.fromList . map (\x -> (W.tag x, length . W.integrate' . W.stack $ x)) . W.hidden . windowset
|
|
||||||
pure $ \wid ->
|
|
||||||
let windowCount = m M.! wid
|
|
||||||
in wid <> (if windowCount > 1 then ":" <> show windowCount else mempty)
|
|
||||||
& xmobarColor "#ffffff" ""
|
|
||||||
|
|
||||||
myPrettyPrinter :: X PP
|
|
||||||
myPrettyPrinter = do
|
|
||||||
myPpCurrent <- mkPpCurrent
|
|
||||||
myPpHidden <- mkPpHidden
|
|
||||||
pure
|
|
||||||
$ filterOutWsPP [scratchpadWorkspaceTag]
|
|
||||||
$ def
|
$ def
|
||||||
{ ppCurrent = myPpCurrent
|
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " "
|
||||||
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
||||||
, ppHidden = myPpHidden
|
, ppHidden = xmobarColor "#ffffff" ""
|
||||||
, ppSep = " | "
|
, ppSep = " | "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue