aboutsummaryrefslogtreecommitdiff
path: root/.config/swayrbar/scripts/temp-status
blob: 2d54d39e13159247f64255c7e3db6f33d2c2872e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env sh

total_temp=0
i=0

for temp_file in /sys/class/hwmon/hwmon*/temp*_input
do
	temp="$(cat "${temp_file}")"
	if [ "${temp}" != "0" ]
	then
		total_temp="$(( ${total_temp} + ${temp} ))"
		i="$(( ${i} + 1 ))"
	fi
done

echo -n "$(( ${total_temp} / ${i} / 1000 ))" °C