1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/modules/power/source_linux.go
2019-02-18 11:16:34 -05: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
}