blob: 62d9af7ffb7b26cb308d3505e8d48f657be8c2c2 [file] [log] [blame]
Skyler Grey4e230892024-02-13 22:58:46 +00001CPU=$(sed -n 's/^cpu\s//p' /proc/stat);
2TOTAL=$(($(T=0; for VAL in $CPU; do T=($((T))+$((VAL))); done; echo $T)));
3IDLE=${CPU[4]};
4IDLE_FRAC=$(echo $(($IDLE.00/$TOTAL)));
5IN_USE=$(echo $(( 1.00 - $IDLE_FRAC )));
6NUM=$(( $IN_USE * 100 ));
7echo $NUM