You are not logged in.

#1 2020-05-30 18:18:24

tty000
Member
From: zoneinfo/Europe/Rome
Registered: 2020-03-29
Posts: 23

Hibernate when battery is low [solved]

Hi guys,
I put this rules in /etc/udev/rules.d/99-lowbat.rules

# Suspend the system when battery level drops to 5% or lower
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl hibernate"

But seems to not work properly.. Can someone help me?

Note: I have already configured hibernate and works well when called from shell

Last edited by tty000 (2020-05-31 15:27:37)

Offline

#2 2020-05-31 04:25:07

bbaserdem
Member
Registered: 2017-07-27
Posts: 43

Re: Hibernate when battery is low [solved]

I had the same issue; on the laptop wiki page there is a warning. Your laptop probably does not report discharge events so it's not getting picked up by udev.

I would unplug computer while at 100%, run udevadm monitor --property, and let it sit for a while until you discharge some battery. (Some laptops don't report decreases; but do give warnings on low battery; so you can wait until 2% or so to check the results) If there are no discharge events; your rule will not work on that laptop. Instead; you can use some other tool to do hibernation (like xfce4-power-manager)

Last edited by bbaserdem (2020-05-31 04:26:10)

Offline

#3 2020-05-31 15:27:19

tty000
Member
From: zoneinfo/Europe/Rome
Registered: 2020-03-29
Posts: 23

Re: Hibernate when battery is low [solved]

Thank you!

Offline

Board footer

Powered by FluxBB