To have a window placed on the floating layer as soon as it appears, one can use the doFloat
function from ManageHooks
. In addition there are some additional functions, like doCenterFloat
for instance, that are provided by ManageHelpers
.
But is there any way to specify a specific size for a window?
Right now I have an application and it just takes the whole window space. I'd like to specify a more comfortable size.
ManageHelpers
does have a function called doRectFloat
which takes a RationalRect
. In the description for doRectFloat
it states the following:
The rectangle to float the window in. 0 to 1; x, y, w, h.
But I don't know how to use this.
ManageHelpers
does have a function calleddoRectFloat
[...] But I don't know how to use this.
The type of doRectFloat
is...
doRectFloat :: RationalRect -> ManageHook
... so you need to pass it a RationalRect
(following the links in the docs usually helps in figuring out such things):
doRectFloat (RationalRect (1 % 4) (1 % 4) (1 % 2) (1 % 2))
This should produce a centered rectangle with half of the full width and length. %
is used to build Rational
(a type for exact fractions) values. To use it, you will need to add import Data.Ratio
to the imports at the top of your xmonad.hs
file.