dotfiles

Configuration for the software I use.
git clone https://git.sr.ht/~jbauer/dotfiles
Log | Files | Refs | README | LICENSE

commit 4cdd7550ac753a7dab409d952124c7e3b48b8e86
parent f97ed4a38d334132f29d73e40f4d48676009f105
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Fri, 21 May 2021 22:08:23 -0400

Make CPU usage display more accurate

Diffstat:
M.local/bin/status | 12++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/.local/bin/status b/.local/bin/status @@ -1,17 +1,10 @@ #!/bin/sh while true; do + cpuUtil=$(vmstat -c2| awk 'NR>2 {print 100-$(NF);}' | tail -1) cpuTemp=$(sysctl hw.sensors.ksmn0.temp0 | cut -d= -f2 | cut -d. -f1) - - cpuIdle=$(top -1b | head -3 | tail -1 \ - | cut -d, -f6 | cut -d' ' -f2 | cut -d. -f1) - cpuUtil=$((100-cpuIdle)) - - memUtil=$(top -1b | head -4 | tail -1 \ - | cut -d' ' -f3 | cut -d'/' -f1) - + memUtil=$(top -1b | head -4 | tail -1 | cut -d' ' -f3 | cut -d'/' -f1) diskUtil=$(df -P | grep /home | awk '{print $5}') - localTime=$(date +"%Y-%m-%d %H:%M") europeTime=$(TZ=Europe/Berlin date +"%H:%M") @@ -56,5 +49,4 @@ while true; do # End NowPlaying Section xsetroot -name "$nowPlaying;$cpuTemp°C $cpuUtil% $memUtil $diskUtil $localTime/$europeTime" - sleep 1 done