This repository has been archived on 2019-02-28. You can view files and clone it, but cannot push or open issues or pull requests.

25 lines
486 B
Bash
Executable File

#!/bin/bash
top -bn1 | gawk '
/^\%CPU/ {
cpu=100-$8
}
END {
printf("%d%", cpu)
print("\n")
if (cpu < 50) {
print("#04B431\n")
} else if (cpu < 60) {
print("#A8FF00\n")
} else if (cpu < 70) {
print("#FFF600\n")
} else if (cpu < 80) {
print("#FFAE00\n")
} else if (cpu < 90) {
print("#FF0000\n")
} else {
exit 33
}
}
'