Show nice CPU usage master
authorSergey Matveev <stargrave@stargrave.org>
Tue, 28 Dec 2021 11:22:05 +0000 (14:22 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 28 Dec 2021 11:22:05 +0000 (14:22 +0300)
main.go

diff --git a/main.go b/main.go
index 50ede58eb7c76ac1d14c65f982f5ebc2d59f6e9c..e99bf5b056d00b51d3ec605fdfb92828a6c8a6fb 100644 (file)
--- a/main.go
+++ b/main.go
@@ -68,10 +68,10 @@ func top() {
        for cols := range bg("top", "-b", "-d", "infinity", "-p", MyPID, "-s", "5", "infinity") {
                switch cols[0] {
                case "CPU:":
-                       CPU = strings.ReplaceAll(
-                               fmt.Sprintf("%s sys:%s int:%s", cols[1], cols[5], cols[7]),
-                               "%", "",
-                       )
+                       CPU = strings.ReplaceAll(fmt.Sprintf(
+                               "%s sys:%s int:%s n:%s",
+                               cols[1], cols[5], cols[7], cols[3],
+                       ), "%", "")
                case "Mem:":
                        Mem = strings.ReplaceAll(strings.Join(cols[1:], " "), ",", "")
                case "ARC:":