Slow Shutdown times with xorg


Hello !
I am using Manjaro with kde minimal and Xorg. I have an amd cpu and an nvidia gpu.
2 out of 5 times when I reboot, I get stuck on the black screen saying :

A stopjob is running (45sec/1min 30sec)

After some web searching I found out that is is a problem with the kwin_x11 failing to properly shutdown, as mentioned in reddit post.
According the op I need to make a script that runs on every shutdown which kills the kwin process before it hangs, hence letting the system shutdown normally.

My question is that is this workaround a viable solution AND will this cause ANY problems in my system ??

Here is the summary:

we need a script that kills the kwin process at /usr/lib/systemd/system-shutdown.
cd /usr/lib/systemd/system-shutdown > sudo touch kill_kwin.shutdown

Put these lines in the script.

# Kill KWin immediately to prevent stalled shutdowns/reboots
pkill -KILL kwin_x11

Make the script executable.
chmod +x kill_kwin.shutdown

Create a systemd service at /etc/systemd/system
/etc/systemd/system > sudo touch kill_kwin.service

Put these lines in the file.
Description=Kill KWin at shutdown/reboot

ExecStop=/bin/sh /usr/lib/systemd/system-shutdown/kill_kwin.shutdown


Then enable the service.
sudo systemctl enable kill_kwin.service