mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
This makes it possible to query the current layout state, which might be useful to e.g. show the current X.L.WorkspaceDir in xmobar. Example of use (assuming myLayout is the layout that is assigned to layoutHook): asMyLayout (Layout l) = (`asTypeOf` myLayout) <$> cast l … layout <- asMyLayout . W.layout . W.workspace . W.current <$> gets windowset case layout of Just (WorkspaceDir d) -> … Unfortunately this requires adding the Typeable constraint to a bunch of classes in xmonad-contrib, so we need to merge those changes there first (fortunately it doesn't need to go in lockstep, adding a Typeable constraint to those classes in xmonad-contrib is harmless).