From 47d093dbe68a5f1d7eaed9960df86476d27a53e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Thu, 5 Dec 2013 00:13:57 +0100 Subject: [PATCH] _lp_temp_acpi: handle multiple temperature sensors (multi CPU) --- liquidprompt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 98592d8..524c6c2 100755 --- a/liquidprompt +++ b/liquidprompt @@ -1400,7 +1400,13 @@ _lp_temp_sensors() _lp_temp_acpi() { - expr "$(acpi -t)" : '.* \([0-9]*\)\.[0-9]* degrees C' + local temperature i + temperature=0 + for i in $(acpi -t | sed 's/.* \([0-9]*\)\.[0-9]* degrees C$/\1/p') + do + (( $i > $temperature )) && temperature=$i + done + echo -ne "$temperature" } # Will set _LP_TEMP_FUNCTION so the temperature monitoring feature use an