Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDen committed Dec 2, 2023
1 parent 6144b1a commit 143fb5b
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 143fb5b

Please sign in to comment.