mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-12-23 05:22:53 +00:00
Merge pull request #19 from Baitinq/master
added nvidia_gpu_temp module
This commit is contained in:
commit
88628f81aa
1 changed files with 22 additions and 0 deletions
22
modules/nvidia_gpu_temp
Executable file
22
modules/nvidia_gpu_temp
Executable 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
|
Loading…
Reference in a new issue