+ temp file and threshold as input
This commit is contained in:
@@ -10,17 +10,21 @@
|
|||||||
# pch_cometlake @ tuxwarrior (i found out by doing more on all tmp input files, and comparing with psensor values):
|
# 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`
|
# `/sys/devices/virtual/thermal/thermal_zone3/hwmon6/temp1_input` = `/sys/class/hwmon/hwmon6/temp1_input`
|
||||||
|
|
||||||
|
temp_file=$1
|
||||||
|
threshold=$2
|
||||||
|
|
||||||
|
temp_file=${temp_file:=/sys/devices/virtual/thermal/thermal_zone3/hwmon6/temp1_input}
|
||||||
|
threshold=${threshold:=60}
|
||||||
|
|
||||||
# the value is reported in milli-degrees celsius. we divide by 1000 to convert to degrees celsius
|
# the value is reported in milli-degrees celsius. we divide by 1000 to convert to degrees celsius
|
||||||
# icon: https://fontawesome.com/icons/temperature-full?f=classic&s=solid
|
# icon: https://fontawesome.com/icons/temperature-full?f=classic&s=solid
|
||||||
# to set colour in svg, set `fill="white"` in the file
|
# to set colour in svg, set `fill="white"` in the file
|
||||||
temperature=$(($(cat /sys/devices/virtual/thermal/thermal_zone3/hwmon6/temp1_input) / 1000))
|
temperature=$(($(cat ${temp_file}) / 1000))
|
||||||
|
|
||||||
if [[ ${temperature} -gt 59 ]]; then
|
if [[ ${temperature} -gt ${threshold} ]]; then
|
||||||
echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.alarm.svg
|
echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.alarm.svg
|
||||||
echo "WARNING: ${temperature}°C"
|
|
||||||
else
|
else
|
||||||
echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.svg
|
echo /home/poq/.config/nwg-panel/icons/temperature-full-solid-full.svg
|
||||||
echo "${temperature}°C"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "${temperature}°C"
|
||||||
|
|||||||
Reference in New Issue
Block a user