diff options
| author | hhvn <dev@hhvn.uk> | 2023-11-19 14:50:06 +0000 |
|---|---|---|
| committer | hhvn <dev@hhvn.uk> | 2023-11-19 14:50:06 +0000 |
| commit | f5e80f5bdcf43b7974064168c3eb0d4e993528df (patch) | |
| tree | ba3a5214c954ff842f6cce64076c4eabcfa9faf2 /status/02-cpu.go | |
| parent | 4722a069233b35efd0b600c973e7a7e9bca01d16 (diff) | |
Create function for drawing percentage usage bars
Diffstat (limited to 'status/02-cpu.go')
| -rw-r--r-- | status/02-cpu.go | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/status/02-cpu.go b/status/02-cpu.go index 34379fb..e00d74f 100644 --- a/status/02-cpu.go +++ b/status/02-cpu.go @@ -5,8 +5,6 @@ import ( "errors" "strings" - "hhvn.uk/hbspbar/drw" - "hhvn.uk/hbspbar/config" "hhvn.uk/hbspbar/common" ) @@ -104,15 +102,7 @@ func cpu(name string) error { ltotal = ltotal - total[i] used := int((100 * (ltotal - lidle)) / ltotal) - tbpad := 3 - th := int(config.H) - tbpad * 2 + 1 - h := int(th * used / 100) - fg := blendGYR(used) - bg := drw.Blend(fg, config.Status, 75) - - u.drawRect(cx, tbpad - 1, 3, th, bg, true) - u.drawRect(cx, tbpad + th - h - 1, 3, h, fg, true) - cx += 5 + cx += u.drawPercentBar(cx, used) } temps := 0 |