The current battery.sh script checks for the state of BAT1 to decide if the AC is online. I think, that's not a good idea (e.g. my notebooks battery is BAT0), instead, it should check for the state of /proc/acpi/ac_adapter/AC.
Attached is an updated battery.sh that checks if the AC is on- or off-line.
Works for me (I changed /etc/acpi/event/default to "event=ac_adapter.*").
See also #52616
Created attachment 35099 [details]
New battery.sh script
Anybody responsible for this bug? No response for over a month and really simple to fix.
*** Bug 52616 has been marked as a duplicate of this bug. ***
Fridtjof, are you still using speedfreq? If you are, maybe you'd like to see bug #70163 and test if it works for you. Some positive test reports might speed up getting it into portage ;-)
Is the solution in bug 70163 ok for you?
Bug 70163 doesn't work for me since it depends for some reason on sys-apps/powermgmt-base which isn't in portage. I don't like the way it puts the whole battery-handling into /etc/init.d/speedfreq as well, it should stay in /etc/acpi IMO.
Even if I remove the dependency, I get an error in the runscript (on_ac_power: command not found. Too lazy to investigate this since my changed battery.sh works fine with my without being intrusive.
sys-power/speedfreq is deprecated in favor of sys-power/cpufreqd due to unresolved bugs and lack of upstream activity.
If you would like to see this fixed, please contact upstream.