diff --git a/.config/xmobar/xmobarrc_hdmi b/.config/xmobar/xmobarrc_hdmi index f0916ec..6a59b53 100644 --- a/.config/xmobar/xmobarrc_hdmi +++ b/.config/xmobar/xmobarrc_hdmi @@ -1,6 +1,6 @@ Config { overrideRedirect = True , lowerOnStart = True - , font = "Jetbrains Mono Nerd Font Bold 9" + , font = "Jetbrains Mono Nerd Font Bold 10" , bgColor = "#24283b" , fgColor = "#737aa2" , position = TopH 24 diff --git a/.config/xmobar/xmobarrc_laptop b/.config/xmobar/xmobarrc_laptop index ca25fbd..3b5cd85 100644 --- a/.config/xmobar/xmobarrc_laptop +++ b/.config/xmobar/xmobarrc_laptop @@ -1,6 +1,6 @@ Config { overrideRedirect = True , lowerOnStart = True - , font = "Jetbrains Mono Nerd Font Bold 9" + , font = "Jetbrains Mono Nerd Font Bold 10" , bgColor = "#24283b" , fgColor = "#737aa2" , position = TopH 24 diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 1e4b083..c48d508 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -299,17 +299,41 @@ myXmobarPP = ppHidden = cultured . wrap " " "", ppHiddenNoWindows = outerspace . wrap " " "", ppUrgent = sunsetorange . wrap (keylime "!") (keylime "!"), + -- Show "1:" as just the icon; tags stay as they are (clickablePP uses the index) + ppRename = \tag _ -> case break (== ':') tag of + (_, ':' : icon) -> icon + _ -> tag, -- NamedScratchpad never removes NSP once created; hide it while it's empty ppSort = (. filter (\w -> W.tag w /= scratchpadWorkspaceTag || isJust (W.stack w))) <$> ppSort def, ppOrder = \[ws, l, _, wins] -> [ws, l, wins], - ppExtras = [logTitles formatFocused formatUnfocused] + ppLayout = layoutIcon, + ppExtras = [budgetTitles] } where - formatFocused = wrap (cultured "[") (cultured "]") . pink . ppWindow - formatUnfocused = wrap (outerspace "[") (outerspace "]") . cultured . ppWindow + layoutIcon :: String -> String + layoutIcon l = case l of + "Tall" -> "\xf0bcc" + "Mirror Tall" -> "\xf0bcb" + "Tabbed" -> "\xf04e9" + "ThreeCol" -> "\xf056d" + "Grid" -> "\xf0570" + "Spiral" -> "\xf056e" + "Full" -> "\xf0293" + _ -> l - ppWindow :: String -> String - ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 20 + -- Titles share one width budget, so more windows get shorter titles instead of overflowing the bar + budgetTitles :: Logger + budgetTitles = do + n <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset + let width = max 8 . min 30 $ 60 `div` max 1 n + logTitles (formatFocused width) (formatUnfocused width) + + formatFocused, formatUnfocused :: Int -> String -> String + formatFocused w = wrap (cultured "[") (cultured "]") . pink . ppWindow w + formatUnfocused w = wrap (outerspace "[") (outerspace "]") . cultured . ppWindow w + + ppWindow :: Int -> String -> String + ppWindow w = xmobarRaw . (\t -> if null t then "untitled" else t) . shorten' "…" w outerspace, pink, sunsetorange, cultured, keylime :: String -> String pink = xmobarColor "#ff79c6" ""