1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/power/source_linux.go
2018-06-04 14:57:05 +08:00

16 lines
320 B
Go

// +build linux
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 "charging", "fully-charged":
return "AC Power"
case "discharging":
return "Battery Power"
}
return batteryState
}