mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
uses the FreeBSD apm command to get charge status and battery percentage Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>
16 lines
288 B
Go
16 lines
288 B
Go
// +build freebsd
|
|
|
|
package power
|
|
|
|
// powerSource returns the name of the current power source, probably one of
|
|
// "AC Power" or "Battery Power"
|
|
func powerSource() string {
|
|
switch batteryState {
|
|
case "1":
|
|
return "AC Power"
|
|
case "0":
|
|
return "Battery Power"
|
|
}
|
|
return batteryState
|
|
}
|