Guidance Requested: GUI Reboot vs. Command Line Reboot

While @dalto is 99% of the time correct (a percentage much higher than mine, btw), I have to disagree here: there definitely is a difference between clicking on the button “Restart” in KDE Plasma and running the command reboot.

Rebooting from the CLI using the reboot command on KDE Plasma is generally safe, but will not save the current session properly because it won’t log you out (thus it won’t execute all the logout stuff Plasma does). If you want to do exactly what clicking on the GUI button does, only invoke it from the terminal, on KDE Plasma, the proper command is:

qdbus org.kde.ksmserver /KSMServer logout 0 1 1    

This will properly save your Plasma session, gracefully terminate your apps, log you out of your Plasma session, and then reboot (using the systemctl command). All of that will take a few seconds longer.

You can alias this to a more memorable command, like restart, by adding the following to your .bashrc or .zshrc:

alias restart="qdbus org.kde.ksmserver /KSMServer logout 0 1 1"
9 Likes