herbstluftwm: panel: add check for cpu-temp coloring

This commit is contained in:
Thomas Preisner 2016-12-09 02:38:53 +01:00
parent 36a56026a1
commit 5cdfeb842a

View file

@ -80,7 +80,12 @@ function icon() {
# CPU
function cpu() {
cpu=$(sensors | grep "Core" | cut -b 18-21)
echo -n $(icon temp yellow) ${cpu}
temp=$(sensors | grep "Physical id 0:" | awk '{print $4}' | cut -b 2-3)
if [[ $temp -le 70 ]]; then
echo -n $(icon temp brightblue) ${cpu}
else
echo -n $(icon temp red) ${cpu}
fi
}
# BATTERY