How do I close the DE cleanly whilst rebooting into the motherboard firmware's GUI (with SystemD)?

Context

When necessary to programmatically reboot, I’ve been utilising qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndReboot, [1] in the stead of systemctl reboot, because SystemCtl appears to merely send a SIGKILL to plasma, whereas logoutAndReboot appears to send a SIGTERM.

Question

However, how can I reboot into my UEFI’s GUI, without utilising systemctl reboot --firmware-setup? I ask because I’d like to always close plasma as it expects.


  1. discuss.kde.org/t/743/9 [2] ↩︎

  2. superuser.com/revisions/1885525/3 ↩︎

There is kcm_smserver:

I’ll tentatively mark this as the solution for now. However, whether it’s scriptable isn’t evident, since systemsettings kcm_smserver --args merely returns:

systemsettings: Missing value after ‘--args’.

ksmserver sets org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.SetRebootToFirmwareSetup to true

So it looks like running

sudo qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.SetRebootToFirmwareSetup true

Then

qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndReboot

Should do the same?

Edit: Tried it just now and indeed it does

2 Likes

@luisbocanegra, thank you! I should really learn to read the source code when I have a question like this. I’ve reposted this at superuser.com/a/1887619 for visibility, since the other answers there all mention systemctl:

2 Likes