Automatically put computer to sleep when battery hits a certain level

Other computers I’ve had will automatically put the computer to sleep when the battery gets to a certain level to prevent the battery from draining all the way and then the computer turning off. Is there any way to do this on the Librem 14? Thank you.



If you install the Cinnamon interface, check out the BAMS applet. I don’t use GNOME Shell, but I assume that it has a similar applet.

The battery charge percentage can be configured in /etc/UPower/UPower.conf.
@Sailin you’ll be about to change this PureOS defaults (admin rights needed: sudo -H gedit /etc/UPower/UPower.conf):
PercentageAction=2 −− “the battery from draining all the way” down to 2%.

systemctl status upower.service
sudo systemctl restart upower

Some other (un)related PureOS settings of interest:
gsettings list-recursively org.gnome.settings-daemon.plugins.power

dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout

dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout XXX
dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout XXX

Thank you! I will try these

1 Like