diff --git a/dots/bin/temperature.sh b/dots/bin/temperature.sh index 4afad77..3022b2d 100755 --- a/dots/bin/temperature.sh +++ b/dots/bin/temperature.sh @@ -10,10 +10,12 @@ # pch_cometlake @ tuxwarrior (i found out by doing more on all tmp input files, and comparing with psensor values): # `/sys/devices/virtual/thermal/thermal_zone3/hwmon6/temp1_input` = `/sys/class/hwmon/hwmon6/temp1_input` -threshold=$1 +threshold_1=$1 +threshold_2=$1 temp_file=$2 -threshold=${threshold:=59} +threshold_1=${threshold_1:=59} +threshold_2=${threshold_2:=65} temp_file=${temp_file:=/sys/devices/virtual/thermal/thermal_zone3/hwmon6/temp1_input} # the value is reported in milli-degrees celsius. we divide by 1000 to convert to degrees celsius @@ -21,10 +23,14 @@ temp_file=${temp_file:=/sys/devices/virtual/thermal/thermal_zone3/hwmon6/temp1_i # to set colour in svg, set `fill="white"` in the file temperature=$(($(cat ${temp_file}) / 1000)) -if [[ ${temperature} -gt ${threshold} ]]; then - echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.alarm.svg +if [[ ${temperature} -gt ${threshold_1} ]]; then + echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.alarm1.svg + echo "${temperature}°C" +elif [[ ${temperature} -gt ${threshold_2} ]]; then + echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.alarm2.svg + echo "WARNING: ${temperature}°C" else echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.svg + echo "${temperature}°C" fi -echo "${temperature}°C" diff --git a/dots/nwg-panel/icons/temperature-full-solid-full.alarm.svg b/dots/nwg-panel/icons/temperature-full-solid-full.alarm1.svg similarity index 89% rename from dots/nwg-panel/icons/temperature-full-solid-full.alarm.svg rename to dots/nwg-panel/icons/temperature-full-solid-full.alarm1.svg index 38ec84c..b83205c 100644 --- a/dots/nwg-panel/icons/temperature-full-solid-full.alarm.svg +++ b/dots/nwg-panel/icons/temperature-full-solid-full.alarm1.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/dots/nwg-panel/icons/temperature-full-solid-full.alarm2.svg b/dots/nwg-panel/icons/temperature-full-solid-full.alarm2.svg new file mode 100644 index 0000000..68748b3 --- /dev/null +++ b/dots/nwg-panel/icons/temperature-full-solid-full.alarm2.svg @@ -0,0 +1 @@ + \ No newline at end of file