diff options
Diffstat (limited to 'i3blocks-cputemp.sh')
-rwxr-xr-x | i3blocks-cputemp.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/i3blocks-cputemp.sh b/i3blocks-cputemp.sh new file mode 100755 index 0000000..94a9a2b --- /dev/null +++ b/i3blocks-cputemp.sh @@ -0,0 +1,14 @@ +#!/bin/sh +kelvins=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input) +low=122 # 50C +high=176 # 80C +icon_low= +icon_mid= +icon_high= + +fahrenheit=$(expr $(expr $(expr $(expr $kelvins \* 9) / 5) / 1000) + 32) +[ $fahrenheit -lt $low ] && printf $icon_low +[ $fahrenheit -ge $low ] && [ $fahrenheit -lt $high ] && printf $icon_mid +[ $fahrenheit -ge $high ] && printf $icon_high + +printf " %s ℉\n" $fahrenheit |