Создаем файл
/etc/systemd/system/plasma-restart@.service
с содержимым
#/etc/systemd/system/plasma-restart@.service
#sudo systemctl enable plasma-restart@$USER.service
#sudo systemctl start plasma-restart@$USER.service
#sudo systemctl stop plasma-restart@$USER.service
#sudo systemctl disable plasma-restart@$USER.service
[Unit]
Description=Plasma Restart Service
After=suspend.target
StopWhenUnneeded=yes
[Service]
User=%i
WorkingDirectory=/home/%i
Type=oneshot
Slice=user-%i.slice
RemainAfterExit=yes
ExecStart=/bin/bash -alc "sudo -Hiu %i pkill -ABRT plasmashell"
[Install]
WantedBy=suspend.target
Alias=plasma-restart@%i.service
после чего активируем сервис в системе:
sudo systemctl enable plasma-restart@$USER.service