mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-09 22:19:45 +00:00
23 lines
335 B
Text
23 lines
335 B
Text
|
#!/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
|