ENH refactor xinerama function
This commit is contained in:
parent
7c3d01947c
commit
45799ae512
|
@ -229,30 +229,39 @@ myLoghook h = withWindowSet $ io . hPutStrLn h . myWindowSetXinerama
|
||||||
myWindowSetXinerama
|
myWindowSetXinerama
|
||||||
:: LayoutClass layout a1 =>
|
:: LayoutClass layout a1 =>
|
||||||
W.StackSet String (layout a1) a2 ScreenId ScreenDetail -> String
|
W.StackSet String (layout a1) a2 ScreenId ScreenDetail -> String
|
||||||
myWindowSetXinerama ws = wsString ++ sep ++ layout ++ "(" ++ nWindows ++ ")"
|
myWindowSetXinerama ws = unwords [onScreen, offScreen, sep, layout, nWindows]
|
||||||
where
|
where
|
||||||
wsString = wrapColorBg T.backdropFgColor "" $ onscreen ++ offscreen'
|
onScreen = wrapColorBg hilightFgColor hilightBgColor
|
||||||
offscreen' = if null offscreen then "" else " " ++ offscreen
|
|
||||||
sep = wrapColorBg T.backdropFgColor "" " : "
|
|
||||||
onscreen = wrapColorBg hilightFgColor hilightBgColor
|
|
||||||
$ (\s -> " " ++ s ++ " ")
|
$ (\s -> " " ++ s ++ " ")
|
||||||
$ unwords
|
$ unwords
|
||||||
$ map (fmtTags . W.tag . W.workspace)
|
$ map (fmtTags . W.tag . W.workspace)
|
||||||
. sortBy compareXCoord
|
$ sortBy compareXCoord
|
||||||
$ W.current ws : W.visible ws
|
$ W.current ws : W.visible ws
|
||||||
|
offScreen = wrapColor T.backdropFgColor
|
||||||
|
$ unwords
|
||||||
|
$ map W.tag
|
||||||
|
$ filter (isJust . W.stack)
|
||||||
|
$ sortOn W.tag
|
||||||
|
$ W.hidden ws
|
||||||
|
sep = wrapColor T.backdropFgColor ":"
|
||||||
|
layout = description $ W.layout $ W.workspace $ W.current ws
|
||||||
|
nWindows = (\s -> "(" ++ s ++ ")")
|
||||||
|
$ show
|
||||||
|
$ length
|
||||||
|
$ W.integrate'
|
||||||
|
$ W.stack
|
||||||
|
$ W.workspace
|
||||||
|
$ W.current ws
|
||||||
|
hilightBgColor = "#8fc7ff"
|
||||||
|
hilightFgColor = T.blend' 0.5 hilightBgColor T.fgColor
|
||||||
fmtTags t = if t == W.currentTag ws
|
fmtTags t = if t == W.currentTag ws
|
||||||
then wrapColorBg T.fgColor hilightBgColor t
|
then wrapColorBg T.fgColor hilightBgColor t
|
||||||
else t
|
else t
|
||||||
offscreen = unwords
|
|
||||||
$ map W.tag
|
compareXCoord
|
||||||
. filter (isJust . W.stack)
|
:: W.Screen i1 l1 a1 ScreenId ScreenDetail
|
||||||
. sortOn W.tag
|
-> W.Screen i2 l2 a2 ScreenId ScreenDetail -> Ordering
|
||||||
$ W.hidden ws
|
compareXCoord s0 s1 = compare x0 x1
|
||||||
hilightBgColor = "#8fc7ff"
|
|
||||||
hilightFgColor = T.blend' 0.5 hilightBgColor T.fgColor
|
|
||||||
layout = description . W.layout . W.workspace . W.current $ ws
|
|
||||||
nWindows = show . length . W.integrate' . W.stack . W.workspace . W.current $ ws
|
|
||||||
compareXCoord s0 s1 = compare x0 x1
|
|
||||||
where
|
where
|
||||||
(_, Rectangle x0 _ _ _) = getScreenIdAndRectangle s0
|
(_, Rectangle x0 _ _ _) = getScreenIdAndRectangle s0
|
||||||
(_, Rectangle x1 _ _ _) = getScreenIdAndRectangle s1
|
(_, Rectangle x1 _ _ _) = getScreenIdAndRectangle s1
|
||||||
|
|
Loading…
Reference in New Issue