How to Hibernate on Low Battery Percentage

There’s nothing in the power settings. I’ve tried using the dconf-editor to tweak Gnome power settings. There’s nothing in /etc/UPower/UPower.conf.

How do I do this?

In my UPower conf file I can see the option in the end, but I’m using Debian Testing, try to add it manually.

# Policy for warnings and action based on battery levels
#
# Whether battery percentage based policy should be used. The default
# is to use the time left, change to true to use the percentage, which
# should work around broken firmwares. It is also more reliable than
# the time left (frantically saving all your files is going to use more
# battery than letting it rest for example).
# default=true
UsePercentageForPolicy=true

# When UsePercentageForPolicy is true, the levels at which UPower will
# consider the battery low, critical, or take action for the critical
# battery level.
#
# This will also be used for batteries which don't have time information
# such as that of peripherals.
#
# If any value is invalid, or not in descending order, the defaults
# will be used.
#
# Defaults:
# PercentageLow=10
# PercentageCritical=3
# PercentageAction=2
PercentageLow=10
PercentageCritical=3
PercentageAction=2

# When UsePercentageForPolicy is false, the time remaining at which UPower
# will consider the battery low, critical, or take action for the critical
# battery level.
#
# If any value is invalid, or not in descending order, the defaults
# will be used.
#
# Defaults:
# TimeLow=1200
# TimeCritical=300
# TimeAction=120
TimeLow=1200
TimeCritical=300
TimeAction=120

# The action to take when "TimeAction" or "PercentageAction" above has been
# reached for the batteries (UPS or laptop batteries) supplying the computer
#
# Possible values are:
# PowerOff
# Hibernate
# HybridSleep
#
# If HybridSleep isn't available, Hibernate will be used
# If Hibernate isn't available, PowerOff will be used
CriticalPowerAction=Hibernate

I’m not sure if this is going to work, because the energy management depends on the hardware and I don’t have a Librem to test it.

Thanks. Done and will try rebooting and draining tonight.

If you edit that line you can set any percentage level you want, you can use a near one to you actual battery level and just drain 1 or 2% of battery.

Remember to do it in descending order like this.
PercentageLow=65 PercentageCritical=61 PercentageAction=60