Quick work-around for bug in KDE Plasma 5.19.1 (Restart and Shut Down from system menu result in Log Out instead)

See the recent post on 17 June 2020 by reddit and Arch Linux user SnowGigs re KDE Plasma 5.19.1: Cannot shutdown or restart from system menu. Actually I experience the same problem with Plasma 5.19.0 in Gentoo Linux.

Until you can install a newer version of Plasma which fixes the bug, here is a quick and easy work-around that is perfectly usable:

Install kde-apps/kdialog and add the following Desktop Configuration file Shutdown.desktop to your Desktop directory — also drag it to the Panel if you wish — and make it executable:

[Desktop Entry]
Comment[en_GB]=Shutdown system
Comment=Shutdown system
Exec=kdialog --title "Shutdown system" --warningcontinuecancel "Are you sure you want to shutdown?" && loginctl poweroff
GenericName[en_GB]=Shutdown
GenericName=Shutdown
Icon=system-shutdown
MimeType=
Name[en_GB]=Shutdown
Name=Shutdown
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo

(Obviously replace ‘fitzcarraldo‘ with your own username.)

user $ chown 744 ~/Desktop/Shutdown.desktop

I have assumed your installation has elogind installed, hence the command ‘loginctl poweroff‘ in the above-mentioned file. If systemd is installed instead of elogind, use the command ‘systemctl poweroff‘ instead.

When you click/double-click on the ‘Shutdown’ icon, a window will pop-up asking you ‘Are you sure you want to shutdown?’ with ‘Continue’ and ‘Cancel’ buttons. If you click ‘Continue’ then the system will execute the ‘loginctl poweroff‘ command; if you click on ‘Cancel’ then it won’t. Simple as that.

If you want, you can also create a file Reboot.desktop to reboot the system:

[Desktop Entry]
Comment[en_GB]=Reboot system
Comment=Reboot system
Exec=kdialog --title "Reboot system" --warningcontinuecancel "Are you sure you want to reboot?" && loginctl reboot
GenericName[en_GB]=Reboot
GenericName=Reboot
Icon=system-reboot
MimeType=
Name[en_GB]=Reboot
Name=Reboot
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo

Similarly, if systemd is installed instead of elogind, use the command ‘systemctl reboot‘ instead.

About Fitzcarraldo
A Linux user with an interest in all things technical.

One Response to Quick work-around for bug in KDE Plasma 5.19.1 (Restart and Shut Down from system menu result in Log Out instead)

  1. Fitzcarraldo says:

    I’ve just been playing around with this in LXQt in Lubuntu 20.04, and I found that a Desktop Configuration file in LXQt will not execute the systemctl command if you click ‘Continue’. The solution is to replace the line beginning ‘Exec=‘ in the Desktop Configuration file with the following line:

    Exec=/home/fitzcarraldo/Shutdown.sh

    and create a Bash script Shutdown.sh containing the command instead:

    #!/bin/bash
    kdialog --title "Shutdown system" --warningcontinuecancel "Are you sure you want to shutdown?" && systemctl poweroff

    Similarly, if you also created Reboot.desktop, change the ‘Exec=‘ line in it to the following:

    Exec=/home/fitzcarraldo/Reboot.sh

    and create a Bash script Reboot.sh containing the following:

    #!/bin/bash
    kdialog --title "Reboot system" --warningcontinuecancel "Are you sure you want to reboot?" && systemctl reboot

    You’ll need to install kdialog in Lubuntu 20.04 if you haven’t already done so:

    $ sudo apt install kdialog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.