I am using LXDE on Debian. When logged in LXDE as user, I can click on the logout
icon in the menu and choose one of the options:
shutdown
reboot
logout
suspend
But when I type reboot
or shutdown -r now
in the terminal, that does not work.
How can I shutdown my system as the user from within the terminal? I need a command, which will be executed when my battery is critically low, so that my system can be shut down cleanly.
Best Answer
The command run when your computer is running low on battery should be configurable through your desktop environment's GUI. Just open the settings app of whatever you use and look at the power options, you should have something like (this is on Cinnamon):
To make your user able to run these commands without entering a password, run
sudo visudo
to edit/etc.sudoers
and add these lines (assuming your user name ismartin
):You can then run them with no password like so:
Alternatively, and specifically for
shutdown
, you can add your user to/etc/shutdown.allow
and then runshutdown -a
but that one does not work for Debian.