From f5e80f5bdcf43b7974064168c3eb0d4e993528df Mon Sep 17 00:00:00 2001 From: hhvn Date: Sun, 19 Nov 2023 14:50:06 +0000 Subject: Create function for drawing percentage usage bars --- status/02-cpu.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'status/02-cpu.go') 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 -- cgit v1.2.3