I'd like my system to resume from suspend on low battery to hibernate it automatically. There's the /sys/class/power_supply/BAT0/alarm interface which I'm trying to use. But my system doesn't not wake up again. I found two references that confirm the value in .../BAT0/alarm should be the same unit as .../BAT0/charge_now: stackoverflow, reddit.
and wait for a few minutes. My Lemur Pro 9 does not wake up automatically. If I wake it up manually, I can see that the charge_now after resume is below the alarm threshold. I also tried different offsets between 500 - 5000.
Expected behavior
The laptop should wake-up automatically as soon as the battery charge drops below the alarm level.
I'd like my system to resume from suspend on low battery to hibernate it automatically. There's the
/sys/class/power_supply/BAT0/alarm
interface which I'm trying to use. But my system doesn't not wake up again. I found two references that confirm the value in .../BAT0/alarm should be the same unit as .../BAT0/charge_now: stackoverflow, reddit.Steps to reproduce
Disconnect the laptop from the power supply. Run:
echo $((`cat /sys/class/power_supply/BAT0/charge_now` - 1000)) | sudo tee /sys/class/power_supply/BAT0/alarm; sudo systemctl suspend; cat /sys/class/power_supply/BAT0/charge_now
and wait for a few minutes. My Lemur Pro 9 does not wake up automatically. If I wake it up manually, I can see that the
charge_now
after resume is below the alarm threshold. I also tried different offsets between 500 - 5000.Expected behavior
The laptop should wake-up automatically as soon as the battery charge drops below the alarm level.
Actual behavior
The laptop remains suspended.