Automatically restart kwin and plasmashell after resuming from suspend/hibernate?

My setup: - Arch Linux - NVIDIA GTX 970 with NVIDIA proprietary drivers - KDE Plasma 5.21.4

Everytime I resume from suspend or hibernate, my windows title bars are frozen and I'm also having some graphical glitches here and there. Known issues, blame NVIDIA.

A quick workaround is to run plasmashell --replace and kwin_x11 --replace but now I'm trying to automate this with systemd units.

After I failed at writting my own units, I came accross these. While both seem to trigger just fine after a first resume from suspend, the kwin one doesn't do anything if I suspend/resume again. Which means my windows title bars are still frozen.

Yet, running /usr/bin/env bash -c "XDG_RUNTIME_DIR=/run/user/id --userDISPLAY=:0 XDG_CURRENT_DESKTOP=KDE kwin_x11 --replace" in konsole always works as expected no matter how many times I suspend/resume.

Any idea how I could fix that?

The Arch Wiki also mentions using hooks in /usr/lib/systemd/system-sleep/. I haven't tried that method yet, I don't understand the script syntax very well in order to achieve what I'm trying to do for both suspend and hibernate.

Thanks!

Edit: Found this script. I placed it in /usr/lib/systemd/system-sleep/, it's run after resume because I can see the echo command with sudo journalctl -b -u systemd-suspend.service but the actual command to restart kwin_x11 doesn't seem to do anything at all on my system.