Newbie questions (wrt floating windows)

Hi, I've just begun an attempt at moving to XMonad, and have a couple of questions. 1) I like titlebars but find that the decorators (e.g. noFrillsDeco) do not apply to floating windows. Is there a way to decorate the floats too? Even better: is there a way to apply decorations only to certain windows (i.e. in the manageHook)? 2) The floating windows are always in front of tiled windows. This is annoying: i would like to be able to script something so that the floating layer is hidden if a tiled window is focused. Is there some command along the lines of "hide all floats"? (I'm sure #2 runs against the whole philosophy of tiling window managers, but i like a "mongrel" workspace for freeform messing around, and tiling for when i'm down to some serious work.) Best, Matt

On Mon, Jul 2, 2012 at 5:59 AM, Matthew Hague
1) I like titlebars but find that the decorators (e.g. noFrillsDeco) do not apply to floating windows. Is there a way to decorate the floats too?
I don't think so.
Even better: is there a way to apply decorations only to certain windows (i.e. in the manageHook)?
Only if you can do it by sending a message to the layout modifier or by storing information in ExtensibleState. (That is, you'll have to write your own layout modifier based on Decoration.) Note also that, as currently written, Decoration is quadratic in both the number of managed windows *and* in the number of decorations applied to a window; this means things get rather slow if you have a lot of windows or a lot of decorations (not to say both!). 2) The floating windows are always in front of tiled windows. This is
annoying: i would like to be able to script something so that the floating layer is hidden if a tiled window is focused. Is there some command along the lines of "hide all floats"?
Not /per se/; the usual way to do this is scratchpads ( XMonad.Util.NamedScratchpadhttp://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Util-NamedScratchpad.htm... ). -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

2) The floating windows are always in front of tiled windows. This is annoying: i would like to be able to script something so that the floating layer is hidden if a tiled window is focused. Is there some command along the lines of "hide all floats"?
I have a solution to this as follows. Apologies for the newbie haskell... First some functions for hiding the floating windows when you're viewing a tiled one: doIfFloat :: (Window -> X()) -> M.Map Window W.RationalRect -> Window -> X () doIfFloat f floats w = if (M.member w floats) then f w else return () withWindows :: (Window -> X ()) -> X () withWindows f = do wins <- gets (W.allWindows . windowset) mapM f wins return () showHideFloats :: X () showHideFloats = do (mw, floats) <- gets (liftM2 (,) W.peek W.floating . windowset) maybe (return ()) (\w -> if (M.member w floats) then return () -- XMonad unhides automatically else withWindows (doIfFloat hide floats)) mw Then one for making sure the focused window is on top (as floats can hide other floats): raiseFocused :: X () raiseFocused = do XConf { display = disp } <- ask mw <- gets (W.peek . windowset) maybe (return ()) (io . (raiseWindow disp)) mw Finally, my log hook: logHook = raiseFocused <+> showHideFloats If you don't like all the tiled windows appearing when you focus just one of them, you can simply set logHook = raiseFocused If anyone likes this, perhaps i could make a contrib module? Criticisms &c. encouraged :) Matt
participants (2)
-
Brandon Allbery
-
Matthew Hague