[xmonad] How to extend layout modifier by visibility of status bar ?
Dunric
dunric29a at gmail.com
Sun Aug 14 19:19:35 CEST 2011
Hi,
I'm trying to extend XMonad.Layout.NoBorders.lessBorders modifier
function. The goal is to don't draw border if there is only one window
focused AND statusbar is hidden at the same time.
-- status bar gets spawned by XMonad.Hooks.DynamicLog.statusBar
main = xmonad =<< statusBar "xmobar" myBarPP toggleStrutsKey myConfig
-- an attempt to add SetsAmbiguous instance to handle status bar visibility
data MyAmbiguity = NoStatusBar deriving (Read, Show)
instance SetsAmbiguous MyAmbiguity where
hiddens amb wset mst wrs
| NoStatusBar <- amb = wins
where
wins = filter (`elem` StackSet.integrate' mst) $
map fst (withoutSBar wrs)
-- HERE I WOULD NEED TO CHECK IF STATUS BAR IS VISIBLE OR NOT
withoutSBar = filter (\ (_, winrect) -> winrect ==
getScreenRect wset)
getScreenRect = screenRect . StackSet.screenDetail .
StackSet.current
Any idea how to detect if status bar is visible or not ?
Thx.
David
More information about the xmonad
mailing list