From 5cdfeb842a86ab42073bb7b6bbf459b4101fbfcd Mon Sep 17 00:00:00 2001 From: Thomas Preisner Date: Fri, 9 Dec 2016 02:38:53 +0100 Subject: [PATCH] herbstluftwm: panel: add check for cpu-temp coloring --- config/herbstluftwm/panel.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/herbstluftwm/panel.sh b/config/herbstluftwm/panel.sh index a60ee30..2418f53 100755 --- a/config/herbstluftwm/panel.sh +++ b/config/herbstluftwm/panel.sh @@ -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