diff options
author | toni <matzeton@googlemail.com> | 2014-10-14 22:20:45 +0200 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2014-10-14 22:20:45 +0200 |
commit | edc12f4b1ff9df92c6adbd912995d19fe9821792 (patch) | |
tree | 0c6894d5349f015709f4d4d99ec3aab104f2e8ae /configs/xmobar_cputemp.sh | |
parent | 725c71037ba88bc785ae7b7538a61728efcd1f38 (diff) |
improved xmobarrc+scripts
Diffstat (limited to 'configs/xmobar_cputemp.sh')
-rwxr-xr-x | configs/xmobar_cputemp.sh | 17 |
1 files changed, 14 insertions, 3 deletions
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 "<fc=#00FF00>$OUT</fc>°C" +elif [ $OUT -ge 67 ]; then + echo "<fc=#FFFF00>$OUT</fc>°C" +elif [ $OUT -ge 75 ]; then + echo "<fc=#FF0000>$OUT</fc>°C" +else + echo "$OUT°C" fi -exit $? |