Restarting KDE Plasma session from remote

How to recover your KDE Plasma session via terminal

If for whatever reason, your desktop is stuck and neither mouse nor keyboard entries will be accepted anymore there might still be a chance of rescueing the session in case your machine is still reachable from outside via ssh.

Once you have successfully sshd to the machine (this might take a while when the system is overloaded and memory is cramped) issue

# kwin_wayland --replace

This restores the session for me.

If the system is still in an unusable state, maybe

# systemctl restart --user plasma-plasmashell

will help. I didn’t have to go that far yet.