I am trying to spawn a floating window whose screen position would match currently focused, tiled or itself floating, window.
I am assuming the spawn command itself should reside inside keys
list (like all other commands) while layout should reside in layoutHook
. I can distinguish the window precisely by setting unique WM_NAME
(urxvt
makes that easy), and I can access currently focused window inside keys
list; however, I don’t know if there’s a proper, built-in/non-dirty way of passing this information downwards into the layoutHook
.
In addition, I am assuming (perhaps wrongly?) that during layout, focused window is going to be the newly spawned window – so I can’t access it there inside layout code.
Three ideas I have (descending order of hacky):
- store layout data into WM_NAME and parse it out down the line
- store dimensions as an X attribute and read it down in the layout hook
- store focused window as an MVar, then access it during layout to obtain dimensions
All these seem a bit hacky; is there a better way?