Xubuntu hotkey for immediate shutdown
gksudo shutdown -h now
would come to mind, but this command requires root privileges. To execute it you would have to enter you password.
Here's a command that should work without root and shut down your PC immediately (compatible with all official Ubuntu flavors):
dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
These are Xubuntu-specific:
- shutdown:
xfce4-session-logout --halt
- restart:
xfce4-session-logout --reboot
- log out:
xfce4-session-logout --logout
- suspend:
xfce4-session-logout --suspend
- hibernate:
xfce4-session-logout --hibernate
Sources:
http://bbs.archbang.org/viewtopic.php?pid=9078#p9078
http://linux.die.net/man/1/xfce4-session-logout
Related videos on Youtube
Sebastian
The founder and designer of www.nottelo.com, searching for right people to work with. Especially Javascript / Typescript / Angular 2 / Java developers are welcomed. Let me know via e-mail form on nottelo.com/joinus!
Updated on September 18, 2022Comments
-
Sebastian over 1 year
I would like to create a two hotkeys. First for terminating all procesess and shutdown the system and turn computer off.
I have tried something but it only logged me off and then I had to confirm I want to log off and then turn off computer manually.
The second one for simple log off.
What is the command I should type in keyboard/hotkey settings? Or should I make .sh file and run it? What command for running the file should I use then?
Thank you very much!
-
kiri over 10 years@Glutanimate It may be worse than clicking 'shutdown' from the menu but it's better than just doing a hardware shutdown. It asks processes to close nicely and writes data to disk before actually powering off. See the link 'Magic SysRq Key' in my answer for info about what each key does
-
Glutanimate over 10 yearsYes, but it still bypasses the natural shutdown procedure and should be reserved for emergency cases only. There are less radical alternatives out there.
-
kiri over 10 yearsOK, agreed with that.
-
kiri over 10 yearsDid you want
--halt
(instead of--logout
) for the shutdown command? -
Daniel almost 9 yearsAnd it's
--reboot
not restart. -
Sebastian over 6 yearsAlso interesting option might be
--fast
option to shutdown fast without saving the session.