You are not logged in.

#1 2021-01-06 12:07:14

k395
Member
Registered: 2020-01-29
Posts: 37

XMonad: Display new window float at top corner?

I know I can do this

myManageHook = composeAll 
   [ fmap (isPrefixOf "ImageMagick: ") title --> doFloat
   ]

But if I do that, for some reason the `display` window is always at the bottom of the screen, obstruct about half of the image.

I know that

I end up with something like this, by reading and modifying XMonad's source implementation of `doFloat`:

import Data.Ratio
import qualified XMonad.StackSet as W


moveToTopCorner :: W.RationalRect -> W.RationalRect
moveToTopCorner (W.RationalRect x y w h) = W.RationalRect 0 (7%400) w h

doFloatAtTopCorner :: ManageHook
doFloatAtTopCorner = ask >>= \w -> (liftX (floatLocation w)) >>= (doF . W.float w . moveToTopCorner . snd)

It works well, except that I have to hard code the height of the status bar.

How can I automatically get the value for `y` to put in the code? I I want the window to appear just below the status bar (xmobar). (I'm starting xmobar with `main = xmonad =<< xmobar def { ...`)



*I heard that i3 is easier to configure.*

Last edited by k395 (2021-01-07 04:26:22)

Offline

Board footer

Powered by FluxBB