summaryrefslogtreecommitdiff
path: root/status/01-bat.go
diff options
context:
space:
mode:
Diffstat (limited to 'status/01-bat.go')
-rw-r--r--status/01-bat.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/status/01-bat.go b/status/01-bat.go
index 4566398..5eb9295 100644
--- a/status/01-bat.go
+++ b/status/01-bat.go
@@ -5,6 +5,7 @@ import (
"path"
"errors"
"strings"
+ "image/color"
// "hhvn.uk/hbspbar/drw"
"hhvn.uk/hbspbar/config"
@@ -58,13 +59,13 @@ func bat(name string) error {
avgcap := (usedcap * 100) / totalcap
- var c uint32
+ var c color.Color
// Colour of outline = charge indicator
switch stati {
case nothing: c = config.Fg
- case charging: c = Green
- case discharging: c = Red
+ case charging: c = config.Green
+ case discharging: c = config.Red
}
var iw int = 20
@@ -78,8 +79,8 @@ func bat(name string) error {
u.drawRect(4, 3, iw + 2, ih + 2, c, false)
switch {
- case avgcap < 25: c = Red
- case avgcap >= 99: c = Green
+ case avgcap < 25: c = config.Red
+ case avgcap >= 99: c = config.Green
default: c = config.FgDark
}