Flash lights on high usage
This commit is contained in:
parent
e9cabb1c26
commit
31f1096027
14
g910-lights
14
g910-lights
@ -33,14 +33,22 @@ loop-stats() {
|
||||
# CPU stats on F1 and G6
|
||||
g910-led -kn f1 $colorblue
|
||||
if (( $(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)/($2+$4+$5)} END {print (usage > 0.75)}') )); then
|
||||
g910-led -kn g6 $colorred
|
||||
if [ $(($(date +%s) % 2)) -eq 0 ]; then
|
||||
g910-led -kn g6 $colorred
|
||||
else
|
||||
g910-led -kn g6 $colorbase
|
||||
fi
|
||||
else
|
||||
g910-led -kn g6 $colorgreen
|
||||
fi
|
||||
# Memory stats on F2 and G7
|
||||
g910-led -kn f2 $colormagenta
|
||||
if (( $(free | grep Mem | awk '{print ($3/$2 > 0.75)}') )); then
|
||||
g910-led -kn g7 $colorred
|
||||
if (( $(free | grep Mem | awk '{print ($3/$2 > 0.25)}') )); then
|
||||
if [ $(($(date +%s) % 2)) -eq 0 ]; then
|
||||
g910-led -kn g7 $colorred
|
||||
else
|
||||
g910-led -kn g7 $colorbase
|
||||
fi
|
||||
else
|
||||
g910-led -kn g7 $colorgreen
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user