From 1ab1c41b13fd206eae21c9bfe6aa013413481c00 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 3 Sep 2019 22:12:30 +0200 Subject: temp.sh: show CPU and GPU temps --- temp.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 temp.sh diff --git a/temp.sh b/temp.sh new file mode 100755 index 0000000..49b8fbd --- /dev/null +++ b/temp.sh @@ -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 + -- cgit v1.2.3