ACPI ¶
To get battery/power monitoring on supported laptops you need to run the acpi deamon.
Add aux/acpi to /rc/bin/termrc.local.
E.g.
TIMESYNCARGS=(-ra1000000)
# start acpi
aux/acpi
# start cron
auth/cron
You cn now use stats -b to display a graph of the battery charge. The following script will display the battery status:
#!/bin/rc
# batt - display battery status
# usage: batt
rfork e
if(test -f /dev/battery){
dt=`{awk '{print $1, $11, $12}' /dev/battery}
echo Battery $dt(3) at $dt(1)^% dt(2) remaining
}
if not{
echo batt: /dev/battery not found! >[1=2]
exit nobattery
}