From: Nicolas Boisselier Date: Sun, 12 May 2019 22:23:45 +0000 (+0100) Subject: etc/profile.d/sys.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=4f83a77b797048a2f720709bdbe6dee74b0c7e50;p=nb.git etc/profile.d/sys.sh --- diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index 6eb0a908..b7c15a9f 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -228,6 +228,12 @@ sys_cpu_load() { } sys_cpu_temperature() { - awk '{printf("%.1f\n",$1/1000)}' /sys/class/thermal/thermal_zone*/temp + ( + # Mac + cat /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_max \ + # Others + || cat /sys/class/thermal/thermal_zone*/temp + ) | awk '/^[0-9]/ {printf("%.1f\n",$1/1000)}' + #awk '{printf("%.1f\n",$1/1000)}' /sys/class/thermal/thermal_zone*/temp #awk '{ count++; sum+=$1 } END {printf("%.1f",sum/count/1000)}' /sys/class/thermal/thermal_zone*/temp }