ENH make xmobar workspace list pretty

This commit is contained in:
Nathan Dwarshuis 2020-02-16 01:01:36 -05:00
parent 42c4e2f22f
commit 724076bece
1 changed files with 18 additions and 7 deletions

View File

@ -71,14 +71,25 @@ myLayouts = onWorkspace "VM" (lessBorders OnlyScreenFloat Full) $
-- that currently has focus -- that currently has focus
myLoghook h = withWindowSet $ io . hPutStrLn h . myWindowSetXinerama myLoghook h = withWindowSet $ io . hPutStrLn h . myWindowSetXinerama
myWindowSetXinerama ws = "[" ++ unwords onscreen ++ "] " ++ myWindowSetXinerama ws = wsString ++ sep ++ layout
unwords offscreen ++ " | " ++ layout
where where
onscreen = map (fmtTags . W.tag . W.workspace) wsString = xmobarColor "#444444" "" $ onscreen ++ " " ++ offscreen
. sortBy compareXCoord $ W.current ws : W.visible ws sep = xmobarColor "#888888" "" " : "
fmtTags t = if t == W.currentTag ws then wrap "<" ">" t else t onscreen = xmobarColor "#5574ad" visColor
offscreen = map W.tag . filter (isJust . W.stack) $ wrap " " " "
. sortBy (comparing W.tag) $ W.hidden ws $ unwords
$ map (fmtTags . W.tag . W.workspace)
. sortBy compareXCoord
$ W.current ws : W.visible ws
fmtTags t = if t == W.currentTag ws
then xmobarColor "#2c2c2c" visColor t
else t
offscreen = unwords
$ map W.tag
. filter (isJust . W.stack)
. sortBy (comparing W.tag)
$ W.hidden ws
visColor = "#8fc7ff"
layout = description . W.layout . W.workspace . W.current $ ws layout = description . W.layout . W.workspace . W.current $ ws
compareXCoord s0 s1 = compare x0 x1 compareXCoord s0 s1 = compare x0 x1
where where