add middled temp over all sensors
This commit is contained in:
22
bin/conky_temp.sh
Executable file
22
bin/conky_temp.sh
Executable 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} ))
|
||||
}
|
||||
Reference in New Issue
Block a user