PaddiM8 / asahi-battery-threshold

A small daemon for setting a charging threshold on Asahi Linux systems
MIT License
19 stars 2 forks source link

This tool is no longer necessary #3

Open Enzime opened 1 year ago

Enzime commented 1 year ago

As per https://twitter.com/AsahiLinux/status/1638954458821578752

charge_control_start_threshold and charge_control_end_threshold are available inside /sys/class/power_supply/macsmc-battery/

To keep the properties set across reboots, you can create a udev rule (e.g. /etc/udev/rules.d/99-asahi-battery.rules):

KERNEL=="macsmc-battery", SUBSYSTEM=="power_supply", ATTR{charge_control_end_threshold}="80", ATTR{charge_control_start_threshold}="70"
xorbuht commented 1 year ago

It works when I set udev rule. However how can I change these values manually, without restarting? E.g. I've tried "echo 99 > sudo tee /sys/class/power_supply/macsmc-battery/charge_control_end_threshold", but the value stays the same. Changing it as root did not work either.