File tree Expand file tree Collapse file tree 1 file changed +23
-14
lines changed Expand file tree Collapse file tree 1 file changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -84,20 +84,29 @@ cpu_intensive_processes() {
84
84
}
85
85
86
86
cpu_temp () {
87
-
88
- if type -P sensors 2> /dev/null; then
89
- returnString=` sensors`
90
- # amd
91
- if [[ " ${returnString/ " k10" } " != " ${returnString} " ]] ; then
92
- $ECHO ${returnString##* k10} | $CUT -d ' ' -f 6 | $CUT -c 2- | $CUT -c 1-4
93
- # intel
94
- elif [[ " ${returnString/ " core" } " != " ${returnString} " ]] ; then
95
- fromcore=${returnString##* " coretemp" }
96
- $ECHO ${fromcore##* Physical} | $CUT -d ' ' -f 3 | $CUT -c 2-5 | _parseAndPrint
97
- fi
98
- else
99
- $ECHO " []" | _parseAndPrint
100
- fi
87
+ local ID=*
88
+ [ -f /etc/os-release ] && source /etc/os-release
89
+ case " $ID " in
90
+ " raspbian" )
91
+ cpu=$( < /sys/class/thermal/thermal_zone0/temp)
92
+ echo " $(( cpu/ 1000 )) " | _parseAndPrint
93
+ ;;
94
+ * )
95
+ if type -P sensors 2> /dev/null; then
96
+ returnString=` sensors`
97
+ # amd
98
+ if [[ " ${returnString/ " k10" } " != " ${returnString} " ]] ; then
99
+ $ECHO ${returnString##* k10} | $CUT -d ' ' -f 6 | $CUT -c 2- | $CUT -c 1-4
100
+ # intel
101
+ elif [[ " ${returnString/ " core" } " != " ${returnString} " ]] ; then
102
+ fromcore=${returnString##* " coretemp" }
103
+ $ECHO ${fromcore##* Physical} | $CUT -d ' ' -f 3 | $CUT -c 2-5 | _parseAndPrint
104
+ fi
105
+ else
106
+ $ECHO " []" | _parseAndPrint
107
+ fi
108
+ ;;
109
+ esac
101
110
}
102
111
103
112
# by Paul Colby (http://colby.id.au), no rights reserved ;)
You can’t perform that action at this time.
0 commit comments