How can I suspend using a keyboard shortcut, without administrator privileges?
For Ubuntu 15.04. and later you can use from the terminal
systemctl suspend
Then create a shortcut in the settings/keyboard app with the same command.
Easy!
Reason: Ubuntu switched from upstart
to systemd
.
Install the powermanagement-interface package first, it provides the
pmi
command we will use to suspend.
UPDATE: I looked at the source forpmi
and the command it uses to suspend is:dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
If you can't install
pmi
, replacepmi action suspend
with that command in the next step.Open up System -> Preferences -> Keyboard Shortcuts, click on Add and put
pmi action suspend
as the command.Click on the newly created shortcut entry, and set the shortcut keys.
Same as above, but use this command instead:
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true
Source: http://forum.ubuntu-fr.org/viewtopic.php?pid=16497311#p16497311