In Ubuntu 14.04 I used to use the following command to suspend the computer as a user without root privileges:
dbus-send --system --print-reply --dest="org.freedesktop.UPower" \
/org/freedesktop/UPower org.freedesktop.UPower.Suspend
Unfortunately in Ubuntu 16.04 this doesn't work anymore and I get an error message:
Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend'
Apparently there has been some changes so what would be the correct command now?
-i
meansignore-inhibitors
(See systemctl manpage: http://manpages.ubuntu.com/manpages/xenial/en/man1/systemctl.1.html) which might not be what you want. – CJlano Jun 22 '16 at 07:04sudo
for Ubuntu 22.04 – Manuel Jordan Sep 15 '23 at 17:13