added nvidia_gpu_temp module

This commit is contained in:
Your Name 2020-10-22 00:09:15 +01:00
parent 71f3fd8a77
commit e941dcc3ae

22
modules/nvidia_gpu_temp Executable file
View file

@ -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