You are not logged in.
Greetings!
Per this topic and this wiki section I tried to make my laptop suspend on reaching low battery level, but couldn't make it work.
I use i3wm and powerdown and no other power management packages.
My guess is that udev doesn't get a battery capacity change event as in `udevadm monitor` there are no changes over time while battery is discharging (however, there are when charger is plugged in and out)
Right now, /etc/udev/rules.d/99-lowbat.rules is as follows:
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-4]", RUN+="/usr/bin/systemctl suspend"
SUBSYSTEM=="power_supply", ATTR{capacity}=="[70-90]", RUN+="/usr/bin/touch /tmp/eventcapacity7090"
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[70-90]", RUN+="/usr/bin/systemctl suspend"So, am I right or not and how can I make my laptop respond to changes in battery level?
Thanks
Last edited by dmitriy (2015-03-01 23:52:50)
Offline
You could use incron to look at /sys/class/power_supply/BAT*/capacity . From what I've been reading this may or may not work, but it's worth a try.
Offline
As far as I understand, it isn't related to udev anymore and is more of like usual cron which just watches filesystem, am I right?
Offline
Right, it's not related to udev, but since your kernel doesn't seem to be sending uevents when your battery capacity changes, perhaps udev isn't the way to go.
Offline
I hoped there could be a way to make it send them, but I understand I should use the other thing.
By the way, is acpid an option or it depends the same way on kernel events?
Last edited by dmitriy (2015-03-02 15:28:33)
Offline
I'd like to jump in in the conversation, because I have the exact same problem.
I'm also looking at acpid but can't figure out what type of config I have to set up to make it work.
Should I use systemd services to watch "acpi -b" or else.
Thank you
Offline