From e941dcc3ae626c4f9d3ca1d9a2ef5ab8a281289f Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 22 Oct 2020 00:09:15 +0100 Subject: [PATCH] added nvidia_gpu_temp module --- modules/nvidia_gpu_temp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 modules/nvidia_gpu_temp diff --git a/modules/nvidia_gpu_temp b/modules/nvidia_gpu_temp new file mode 100755 index 0000000..5fc26e7 --- /dev/null +++ b/modules/nvidia_gpu_temp @@ -0,0 +1,22 @@ +#!/bin/bash + +# Gets temperature of the GPU +# Dependencies: nvidia drivers and nvidia-settings + +PREFIX=' ' +FIRE=' ' + +WARNING_LEVEL=80 + +get_gputemp() +{ + GPU_TEMP="$(nvidia-settings -q gpucoretemp -t | head -n 1)" + + if [ "$GPU_TEMP" -ge $WARNING_LEVEL ]; then + PREFIX="$FIRE$PREFIX" + fi + + echo "$PREFIX$GPU_TEMP°C" +} + +get_gputemp