From 4f83a77b797048a2f720709bdbe6dee74b0c7e50 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sun, 12 May 2019 23:23:45 +0100 Subject: [PATCH] etc/profile.d/sys.sh --- etc/profile.d/sys.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 } -- 2.47.3