+ two alarm icons, two thresholds

This commit is contained in:
committer@tuxwarrior
2026-03-04 13:54:32 -05:00
parent c2440baed8
commit eacab3695a
3 changed files with 13 additions and 6 deletions

View File

@@ -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"

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="#b30059" d="M320 64C267 64 224 107 224 160L224 324.7C194.5 351 176 389.4 176 432C176 511.5 240.5 576 320 576C399.5 576 464 511.5 464 432C464 389.4 445.5 351 416 324.7L416 160C416 107 373 64 320 64zM384 432C384 467.3 355.3 496 320 496C284.7 496 256 467.3 256 432C256 405.1 272.5 382.1 296 372.7L296 160C296 146.7 306.7 136 320 136C333.3 136 344 146.7 344 160L344 372.7C367.5 382.2 384 405.2 384 432z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="#ff66b3" d="M320 64C267 64 224 107 224 160L224 324.7C194.5 351 176 389.4 176 432C176 511.5 240.5 576 320 576C399.5 576 464 511.5 464 432C464 389.4 445.5 351 416 324.7L416 160C416 107 373 64 320 64zM384 432C384 467.3 355.3 496 320 496C284.7 496 256 467.3 256 432C256 405.1 272.5 382.1 296 372.7L296 160C296 146.7 306.7 136 320 136C333.3 136 344 146.7 344 160L344 372.7C367.5 382.2 384 405.2 384 432z"/></svg>

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 632 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="#ffff00" d="M320 64C267 64 224 107 224 160L224 324.7C194.5 351 176 389.4 176 432C176 511.5 240.5 576 320 576C399.5 576 464 511.5 464 432C464 389.4 445.5 351 416 324.7L416 160C416 107 373 64 320 64zM384 432C384 467.3 355.3 496 320 496C284.7 496 256 467.3 256 432C256 405.1 272.5 382.1 296 372.7L296 160C296 146.7 306.7 136 320 136C333.3 136 344 146.7 344 160L344 372.7C367.5 382.2 384 405.2 384 432z"/></svg>

After

Width:  |  Height:  |  Size: 632 B