Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I came across Why do we need to be root in terminal for shutdown and restart? and the accepted answer has an explanation indicating that clicking on "Shutdown" in Ubuntu's dropdown menu triggers this command:

dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown

I also saw Are there any Keyboard Shortcuts to Shutdown? which suggested this code:

dbus-send --system --print-reply --system --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

The two codes differ. (Also, I don't know why --system comes twice in second code.) Which code is appropriate for 13.10? Or is there a new code to be used?

Then I can make keyboard shortcut of this command to shutdown my computer from the keyboard instead of having to use the mouse to click on "cogwheel", "shutdown".

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Yes, you can assign a specific, non-used key-combination as a shortcut to shut-down. To assign Ctrl+Alt+Esc (or any other key combination) as the shortcut, go to System settings > Keyboard > Shortcuts > Custom shortcut and then add a new shortcut.

The command should be

dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

I am not pretty sure why you have --system twice in the command, but a single one works on Ubuntu 13.10(have tested, confirmed to work).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.