Where would be the best place to insert pre kwin launch script?

When using SDDM to launch Plasma wayland session, then where would be the best place to insert and run a script to alter or even plainly overwrite ~/.config/kwinoutputconfig.json with previously set up and fixed configuration?

(so no matter how badly you effd your screen config up inside Plasma, after boot it’s back to normal?)

I would like to disable all but main display when starting kwin wayland session. And then once I am logged in, manually enable the rest. Why? Because amdgpu does not like (crashes system) when you try to start kwin up with 240Hz + 60Hz + 60Hz monitors at once. But it seems to be OK, if you only start with 240Hz monitor enabled and others disabled and then one by one enable them.

That’s something we should fix to allow you not to go through those oops.
Is that a reported crash?
Crash are relatively easy to fix, please report it.

it kind of is, but right now crashing is amdgpu. And yes, I did report it, however I can’t link it here because new person here.
gitlab (dot) freedesktop (dot) org (slash) drm (slash) amd (slash) - (slash) issues (slash) 3547
Same problem is crashing both sddm and kwin. For sddm I can craft workaround (certain monitors disabled) config easily, and it doesn’t get overwritten. However kwin is a different creature.

Thank you for the bug report, it seems complete, driver devs should be able to fix the issue in due time.

Regarding a workaround, you can use kscreen-doctor to turn on/off monitors, then put those commands in the startup/disconnect scripts in systemsettings autostart as you see fit with sleep if needed.

for instance (from kscreen-doctor -h):

   # Disable the hdmi output, enable the laptop panel and set it to a specific mode
   $ kscreen-doctor output.HDMI-2.disable output.eDP-1.mode.1 output.eDP-1.enable