Resize NamedScratchpad with respect to screen size

Hi all, I have several NamedScratchpads defined in my XMonad configuration, and so far I've been using a manage hook like: customFloating $ W.RationalRect (1/2) (1/8) (1/2) (3/4) This made sense while I had monitors with similar resolution. I recently got a new monitor and now my two monitors have vastly different resolutions - one is 1920x1080, the other one is 3840x1600. So here's my issue - the RationalRect above doesn't make sense for both monitors. It still works fine on the smaller one, on the larger however it results in ridiculously a wide window. My question is - can I resize the scratchpad window I'm pulling into the current workspace with respect to the size of the screen that this workspace is displayed on? Thank you! Kind regards, -- alexander iliev

On Tue, Mar 14, 2023 at 6:04 PM Alexander Iliev
My question is - can I resize the scratchpad window I'm pulling into the current workspace with respect to the size of the screen that this workspace is displayed on?
Currently there is no control over this. It's not impossible, but would require a `handleEventHook` to catch the `MapNotifyEvent` for the `NamedScratchpad` window and resize it. -- brandon s allbery kf8nh allbery.b@gmail.com

On Tue, Mar 14 2023 18:07, Brandon Allbery wrote:
On Tue, Mar 14, 2023 at 6:04 PM Alexander Iliev
wrote: My question is - can I resize the scratchpad window I'm pulling into the current workspace with respect to the size of the screen that this workspace is displayed on?
Currently there is no control over this. It's not impossible, but would require a `handleEventHook` to catch the `MapNotifyEvent` for the `NamedScratchpad` window and resize it.
Alternatively, it should also be possible to check the currently focused window in a logHook and do this based on that. See `X.U.NamedScratchpad.nsHideOnFocusLoss` for inspiration. -- Tony Zorman | https://tony-zorman.com/

On 3/15/23 00:07, Brandon Allbery wrote:
Currently there is no control over this. It's not impossible, but would require a `handleEventHook` to catch the `MapNotifyEvent` for the `NamedScratchpad` window and resize it.
I see. I'll have a look, although I doubt that both my Haskell and my XMonad skills will be sufficient for me to successfully accomplish this. Thanks, Brandon. -- alexander iliev

You might be able to glean some inspiration from
https://github.com/geekosaur/xmonad.hs/blob/skkukuk/xmonad.hs#L301-L313
which is hackily catching my notification windows currently.
On Tue, Mar 14, 2023 at 6:18 PM Alexander Iliev
On 3/15/23 00:07, Brandon Allbery wrote:
Currently there is no control over this. It's not impossible, but would require a `handleEventHook` to catch the `MapNotifyEvent` for the `NamedScratchpad` window and resize it.
I see. I'll have a look, although I doubt that both my Haskell and my XMonad skills will be sufficient for me to successfully accomplish this.
Thanks, Brandon.
-- alexander iliev
-- brandon s allbery kf8nh allbery.b@gmail.com
participants (3)
-
Alexander Iliev
-
Brandon Allbery
-
Tony Zorman