diff --git a/main.go b/main.go index e3de619..df7e1fd 100644 --- a/main.go +++ b/main.go @@ -15,23 +15,26 @@ import ( ) const ( - appVersion = "0.2.3" - boltIconOutline = "bolt.png" - boltIconFilled = "bolt-filled.png" -) - -var hardwareUUID string -var plistPath string - -type BatteryState uint8 - -const ( - ALWAYS BatteryState = iota + appVersion = "0.2.3" + boltIconOutline = "bolt.png" + boltIconFilled = "bolt-filled.png" + ALWAYS BatteryState = iota NEVER BATTERY_ONLY POWER_ONLY ) +var ( + hardwareUUID string //lint:ignore U1000 false positives + plistPath string + lowPowerMode = "" + inChan = make(chan BatteryState) + currentState BatteryState //lint:ignore U1000 false positives + currentIcon string +) + +type BatteryState uint8 + func (b BatteryState) String() string { switch b { case ALWAYS: @@ -61,11 +64,6 @@ func getStateFromCondition(ac bool, battery bool) BatteryState { return BatteryState(states[[2]bool{ac, battery}]) } -var lowPowerMode = "" -var inChan = make(chan BatteryState) -var currentState BatteryState -var currentIcon string - func getHardwareUUID() (string, error) { cmd := exec.Command("system_profiler", "SPHardwareDataType") output, err := cmd.Output()