From edc12f4b1ff9df92c6adbd912995d19fe9821792 Mon Sep 17 00:00:00 2001 From: toni Date: Tue, 14 Oct 2014 22:20:45 +0200 Subject: improved xmobarrc+scripts --- configs/xmobar_cputemp.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'configs/xmobar_cputemp.sh') diff --git a/configs/xmobar_cputemp.sh b/configs/xmobar_cputemp.sh index 15a2bf9..8af1b47 100755 --- a/configs/xmobar_cputemp.sh +++ b/configs/xmobar_cputemp.sh @@ -1,8 +1,19 @@ #!/bin/sh if [ "x$1" = "xCPU" ]; then - sensors | sed -n 's/^CPU Temperature:\s*+\(.*\)°C\s*(\(.*\)/CPU TEMP: \1°C/p' + OUT=$(sensors | sed -n 's/^CPU Temperature:\s*+\(.*\)°C\s*(\(.*\)/\1/p') elif [ "x$1" = "xMB" ]; then - sensors | sed -n 's/^MB Temperature:\s*+\(.*\)°C\s*(\(.*\)/MB TEMP: \1°C/p' + OUT=$(sensors | sed -n 's/^MB Temperature:\s*+\(.*\)°C\s*(\(.*\)/\1/p') +else + exit 1 +fi + +if [ $OUT -ge 60 ]; then + echo "$OUT°C" +elif [ $OUT -ge 67 ]; then + echo "$OUT°C" +elif [ $OUT -ge 75 ]; then + echo "$OUT°C" +else + echo "$OUT°C" fi -exit $? -- cgit v1.2.3