From a1cacfc90d09dfb82c0f2f9275de7bc50b000cf3 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Thu, 29 Sep 2016 04:39:53 +0200 Subject: [PATCH] show CPU temperature --- screenfetch-dev | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/screenfetch-dev b/screenfetch-dev index 2869d59..6a0e4b9 100755 --- a/screenfetch-dev +++ b/screenfetch-dev @@ -1212,7 +1212,14 @@ detectcpu () { else cpu="$cpu @ ${cpun}${cpufreq}" fi - cpu=$(sed $REGEXP 's/\([tT][mM]\)|\([Rr]\)|[pP]rocessor//g' <<< "${cpu}" | xargs) + thermal="/sys/class/hwmon/hwmon0/temp1_input" + if [ -e $thermal ]; then + temp=$(bc <<< "scale=1; $(cat $thermal)/1000") + fi + if [ -n "$temp" ]; then + cpu="$cpu [${temp}°C]" + fi + cpu=$(sed $REGEXP 's/\([tT][mM]\)|\([Rr]\)|[pP]rocessor|CPU//g' <<< "${cpu}" | xargs) verboseOut "Finding current CPU...found as '$cpu'" } # CPU Detection - End