dwmblocks/blocks/cpu_temp.sh

16 lines
308 B
Bash
Raw Normal View History

2020-07-18 12:00:48 +00:00
#!/bin/sh
2020-07-06 20:06:10 +00:00
2020-11-23 06:12:13 +00:00
ICONc=" " # icon for critical temperatures
ICONn=" " # icon for normal temperatures
crit=70 # critical temperature
2020-07-06 20:06:10 +00:00
read -r temp </sys/class/thermal/thermal_zone0/temp
temp=${temp%???}
if [ "$temp" -ge "$crit" ] ; then
2020-11-23 06:12:13 +00:00
echo "${ICONc}${temp}°C"
2020-07-06 20:06:10 +00:00
else
2020-11-23 06:12:13 +00:00
echo "${ICONn}${temp}°C"
2020-07-06 20:06:10 +00:00
fi