From 444eeac214103e7337265a2eeb745ff1ab36914b Mon Sep 17 00:00:00 2001 From: narugit Date: Wed, 23 Feb 2022 23:39:28 +0900 Subject: [PATCH] feat: use smctemp instead of osx-cpu-temp to support M1 mac --- scripts/temp_cpu.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/temp_cpu.sh b/scripts/temp_cpu.sh index 4beccef..a6c36c8 100755 --- a/scripts/temp_cpu.sh +++ b/scripts/temp_cpu.sh @@ -30,9 +30,8 @@ print_cpu_temp() { done # remove leading and trailing whitespace echo "$temp_string" | awk 'BEGIN{OFS=" "}$1=$1{print $0}' - elif command_exists "osx-cpu-temp"; then - local temp - temp=$(osx-cpu-temp | grep -o "[0-9]*\.[0-9]") + elif command_exists "smctemp"; then + temp=$(smctemp -c) else echo "no sensors found" fi