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_gputemp.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'configs/xmobar_gputemp.sh') diff --git a/configs/xmobar_gputemp.sh b/configs/xmobar_gputemp.sh index c4dffe3..eb5bf64 100755 --- a/configs/xmobar_gputemp.sh +++ b/configs/xmobar_gputemp.sh @@ -1,3 +1,18 @@ #!/bin/bash -nvidia-smi | grep -oE '[0-9]{2,3}C' +if [ "x$1" = "xmem" ]; then + nvidia-smi | grep -oE '[0-9]{1,3}%\s*[0-9]{1,4}MB\s*/\s*[0-9]{1,4}MB' +else + OUT=$(nvidia-smi | sed -n 's/\(.*\)\([0-9]\{2,3\}\)C\(.*\)/\2/p') + if [ "x$OUT" = "x" ]; then + echo "ERR" + elif [ $OUT -gt 75 ]; then + echo "$OUT°C" + elif [ $OUT -ge 65 ]; then + echo "$OUT°C" + elif [ $OUT -ge 50 ]; then + echo "$OUT°C" + else + echo "$OUT°C" + fi +fi -- cgit v1.2.3