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
myLoghook h = withWindowSet $ io . hPutStrLn h . myWindowSetXinerama
myWindowSetXinerama ws = "[" ++ unwords onscreen ++ "] " ++
unwords offscreen ++ " | " ++ layout
myWindowSetXinerama ws = wsString ++ sep ++ layout
where
onscreen = map (fmtTags . W.tag . W.workspace)
. sortBy compareXCoord $ W.current ws : W.visible ws
fmtTags t = if t == W.currentTag ws then wrap "<" ">" t else t
offscreen = map W.tag . filter (isJust . W.stack)
. sortBy (comparing W.tag) $ W.hidden ws
wsString = xmobarColor "#444444" "" $ onscreen ++ " " ++ offscreen
sep = xmobarColor "#888888" "" " : "
onscreen = xmobarColor "#5574ad" visColor
$ wrap " " " "
$ 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
compareXCoord s0 s1 = compare x0 x1
where