mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
16 lines
320 B
Go
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
|
|
}
|