diff options
author | Patrick Simianer <pks@pks.rocks> | 2019-09-03 22:12:30 +0200 |
---|---|---|
committer | Patrick Simianer <pks@pks.rocks> | 2019-09-03 22:12:30 +0200 |
commit | 1ab1c41b13fd206eae21c9bfe6aa013413481c00 (patch) | |
tree | 41e7cd0de72832849df71ebb79084d149426fd61 | |
parent | ce73672f925bd3edfc6771616d5cb3b2916b828f (diff) |
temp.sh: show CPU and GPU temps
-rwxr-xr-x | temp.sh | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -0,0 +1,7 @@ +#!/usr/bin/env zsh + +echo "CPU:$(sensors | grep Core | cut -d ' ' -f 10 | sed 's|°C||' | sed 's|+||' | awk '{x+=$1; next} END{printf "%3.0f\n", x/NR}')°C" +if [[ $(command -v nvidia-smi) == 0 ]]; then + echo "GPU: $(nvidia-smi | head -9 | tail -1 | cut -d " " -f 5 | sed 's|C||')°C" +fi + |