aboutsummaryrefslogtreecommitdiffstats
path: root/modules/nvidia_gpu_temp
blob: 5fc26e7237bce8986238e28895f26d7999005daf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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