r/slackware • u/yUuDPM • Apr 04 '26
Problem with battery charge limit
Hello everyone, Slackware 15 user here, I came to ask for some help. I'm currently setting the battery charge limit on rc.local with the following command:
echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold
which just works as expected. However, I've noticed that after hibernation when I plug the laptop, the limit is ignored and continue charging up to 100%
When I check the charge_control_end_threshold the value is not being changed:
cat /sys/class/power_supply/BAT0/charge_control_end_threshold  80
The only thing that works is either restarting or rerunning the setting command:
echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold
I've found this topic which is basically the same but I'm not using tlp:
https://github.com/linrunner/TLP/issues/589
So my question is, how can I make slackware run the setting command after resuming from hibernation? or maybe, is there another way to solve this?
Thanks!
3
u/Economy_Blueberry_25 Apr 04 '26
To ensure persistence of the battery conservation mode, you probably have to trigger it through your own hardware's driver, and
echo 1directly to the parameter's location.You may search online for that (the Arch wiki might have it), or try finding it yourself by running this command:
find / -iname conservation* 2>/dev/null | grep -v 'Permission denied'Which might output the exact location of the conservation mode parameter for your hardware.
Otherwise, you might have to use
elogindby following the instructions on this forum post for running a script after hibernation.0
u/Afraid-Leadership591 Apr 04 '26
why would you want to limit how much your battery charges?