Adding cpu to awesome

This commit is contained in:
Chris Cochrun 2021-02-03 09:50:49 -06:00
parent 2c45b82785
commit 7b173db93d
6 changed files with 18 additions and 15 deletions

3
scripts/cpu Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' \
<(rg 'cpu ' /proc/stat) <(sleep 1;rg 'cpu ' /proc/stat)