From b81f53be7b3c39644ad187b9f30dc9f2c3b39a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Uruba?= Date: Tue, 24 Nov 2020 17:09:57 +0100 Subject: [PATCH] update CPU block --- blocks.def.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blocks.def.h b/blocks.def.h index 70bce05..24bd90f 100644 --- a/blocks.def.h +++ b/blocks.def.h @@ -1,9 +1,10 @@ //Modify this file to change what commands output to your statusbar, and recompile using the make command. static const Block blocks[] = { /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ - {"CPU ", "echo \"$(mpstat -P ALL 5 1 | grep -i '\\: all' | tr -s ' ' \ - | cut -d ' ' -f 3)%\" \"($(sensors | grep 'Tdie:' \ - | tr -s ' ' | cut -f2 -d ' ' | cut -c 2-))\"", 5, 0}, + {"CPU ", "echo \"$(mpstat --dec=0 5 1 | tr -s ' ' | grep -i '\\: all' \ + | awk -F ' ' '{ print $3 + $4 + $5 }')%\" \ + \"($(sensors | grep 'Tdie:' | tr -s ' ' | cut -f2 -d ' ' \ + | cut -c 2-))\"", 5, 0}, {"Mem ", "free -h | awk '/^Minne/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0}, {"Bat ", "echo \"$(cat /sys/class/power_supply/BAT0/capacity)%\" \ \"[$(sed \"s/Unknown/?/;s/Charging/+/;s/Discharging/-/;\"\