From 0cda6acf7eefdaa1302d1fd902c0c181541845c1 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Mon, 7 Feb 2022 22:14:09 -0300 Subject: [PATCH] Use LAPTOP flag in cpu_temp.sh --- blocks.def/cpu_temp.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blocks.def/cpu_temp.sh b/blocks.def/cpu_temp.sh index 38b0288..13581ec 100755 --- a/blocks.def/cpu_temp.sh +++ b/blocks.def/cpu_temp.sh @@ -13,7 +13,7 @@ TEMP_LOW=30 #TEMP_CPU=$(sensors -A | awk 'NR == v+1 {print $4}' v="$(sensors -A | awk '{ if ($1 == "coretemp-isa-0000") {print NR}}')" | sed 's/+//' | sed 's/..°C//') TEMP_CPU=$(sensors -A | awk '/Package/ {print $4}' | sed 's/+//' | sed 's/..°C//') -TEMP_GPU=`nvidia-smi | awk '{if (NR == 10) {print $3}}' | sed 's/C//'` +[ -v LAPTOP ] || TEMP_GPU=`nvidia-smi | awk '{if (NR == 10) {print $3}}' | sed 's/C//'` #ICON="💻" @@ -35,4 +35,8 @@ else ICON="🥶" fi -printf "$ICON %s°C : %s°C" "$TEMP_CPU" "$TEMP_GPU" +if [ -v LAPTOP ]; then + printf "$ICON %s°C" "$TEMP_CPU" +else + printf "$ICON %s°C : %s°C" "$TEMP_CPU" "$TEMP_GPU" +fi