Skip to content

battery warning level for FreeBSD control method batteries.

Notifications You must be signed in to change notification settings

random532/FreeBSD_Battery_Trip_Point

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 

Repository files navigation

FreeBSD Battery Warnings


Affected file:
sys/dev/acpica/acpi_cmbat.c


Short description:
Get notified if your battery reaches a user-defined percentage.

Long description:
There is no need to run a daemon that regularly checks the battery level.
Just tell the battery controller your desired warning level via the optional acpi method _BTP.

Your battery supports this if the command "acpidump -dt |grep _BTP" returns something (an acpi method).

Currently the FreeBSD cmbat driver only supports mandatory methods (bif, bix, ..), but no optional ones.

If supported by the battery, a new sysctl is created, dev.battery.0.Warning_Level
You can set the warning level with this sysctl (values between 0-100). Once the battery reaches that level, devd will be notified via system "ACPI" subsystem "CMBAT" events.

A /etc/devd.conf entry might look like this:
notify 10 {
match "system" "ACPI";
match "subsystem" "CMBAT";
action "/home/myuser/myscript.sh $notify";
};


Personal note: Please write me if I need to look at this again.
For example, if it no longer compiles. Thanks. :-)

About

battery warning level for FreeBSD control method batteries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages