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:shutdownrebootlogoutsuspendBut 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.
command to reboot as non-root user
debian;power management;acpi
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 is martin):martin ALL=NOPASSWD:/usr/sbin/pm-suspendmartin ALL=NOPASSWD:/sbin/rebootmartin ALL=NOPASSWD:/sbin/shutdownYou can then run them with no password like so:sudo rebootAlternatively, and specifically for shutdown, you can add your user to /etc/shutdown.allow and then run shutdown -a but that one does not work for Debian.