You are not logged in.
Hi,
I'm using https://wiki.archlinux.org/index.php/La … tery_level
/etc/udev/rules.d$ cat 99-lowbat.rules
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl suspend"
And since I have two batteries, if one is depleted, my Thinkpad T460s goes to sleep. This is annoying since I have another battery it could have used!
Any ideas how I have a udev rule for all my batteries? Or am I missing something simple here?
Thank you,
Offline
Have you confirmed that both batteries report discharge events to udev? (See the "Note" box in the section you linked). If so, you could probably replace the script inside "RUN" in that rule to run a custom script of your own, where it checks the battery levels of both batteries (e.g. via /sys/class/power_supply/BAT<N>/capacity) and only calls "/usr/bin/systemctl suspend" if both are low.
Last edited by GenkiSky (2017-09-09 00:57:25)
Offline