elenapan/Scripts/cpu.sh
elena 16779af195 updated cpu and weather scripts
Former-commit-id: aa039acc39
Former-commit-id: 511df177d316d7111196e5ddac6cd837a1c12be0
Former-commit-id: 26ec14ec4e464d6978f6d6e2be43b7d24fc64422
2017-09-25 14:19:49 +03:00

18 lines
No EOL
360 B
Bash
Executable file

#!/bin/bash
#   
CPU="$[100-$(vmstat 1 2|tail -1|awk '{printf "%d", $15}')]"
# GOVERNOR="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
# if [[ "$GOVERNOR" == "performance" ]]; then
# echo " $CPU%"
# else
# echo " $CPU%"
# fi
# Lazy whitespace padding
if [ "$CPU" -ge "10" ]; then
echo "$CPU%"
else
echo "$CPU%"
fi