Command for shutdown

The shutdown menu in KDE plasma 6 (when clicking on shutdown in the task manager) is really neat. It opens a GUI with options to shutdown, sleep, log out, restart or cancel, and start a 30 second cooldown before shuting down. In the meantime, it doesn’t close anything. I love it.

What is the command for it though? I would love to make a keyboard shortcut for it (instead of the command poweroff which can be risky)

The commands used by the gui is the systemctl commands

 $ file /usr/bin/poweroff
/usr/bin/poweroff: symbolic link to systemctl

poweroff is just the short version and not risky at all

systemctl poweroff
 $ systemctl --help
[..]
System Commands:
  is-system-running                   Check whether system is fully running
  default                             Enter system default mode
  rescue                              Enter system rescue mode
  emergency                           Enter system emergency mode
  halt                                Shut down and halt the system
  poweroff                            Shut down and power-off the system
  reboot                              Shut down and reboot the system
  kexec                               Shut down and reboot the system with kexec
  soft-reboot                         Shut down and reboot userspace
  exit [EXIT_CODE]                    Request user instance or container exit
  switch-root [ROOT [INIT]]           Change to a different root file system
  sleep                               Put the system to sleep (through one of
                                      the operations below)
  suspend                             Suspend the system
  hibernate                           Hibernate the system
  hybrid-sleep                        Hibernate and suspend the system
  suspend-then-hibernate              Suspend the system, wake after a period of
                                      time, and hibernate
[...]

Also see the default sddm.conf where the commands used are listed

cat /usr/lib/sddm.d/default.conf
1 Like

Try any of these:

qdbus org.kde.LogoutPrompt /LogoutPrompt promptLogout

qdbus org.kde.LogoutPrompt /LogoutPrompt promptReboot

qdbus org.kde.LogoutPrompt /LogoutPrompt promptShutDown

Source:

4 Likes

You can also skip this Log out Screen… so when you click on this buttons it can do all this options without any delay.

I like the gui and wonder if there is a command to open the gui.

I had set a shortcut to poweroff which worked well but I find it risky - if I enter it by mistake I can lose what I am currently working on. So I removed it.

Ahh - that ‘risky’ - I thought it had something to do with the system.

Then you are correct - the wayland shell command is the way to go - I simply misunderstood you initial topic.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.