add middled temp over all sensors

This commit is contained in:
2020-09-16 19:18:07 +00:00
parent 344def0093
commit 486122ce5d
2 changed files with 26 additions and 2 deletions

22
bin/conky_temp.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/ksh
_count=0
_temp=0
sysctl hw.sensors | { while read _sensor _rest; do
case ${_sensor} in
*temp*)
_t=${_sensor##*=}
_t=${_t%%.*}
(( _count += 1 ))
(( _temp += ${_t} ))
;;
esac
done
[[ ${_count} -ne 0 ]] && print $(( _temp /= ${_count} ))
}