Nvidia gpu temp

#1

Hi all, I finaly manage to pipe my Nvidia GTX 1050 gpu temperaure into i3blocks, thing that the default config won’t do I don’t know why.
For those who want to get on tip:

[gpu-temp]
label=
#command=nvidia-smi --format=nounits,csv,noheader --query-gpu=temperature.gpu | xargs echo
command=~/bin/gputemp.sh
interval=5
color=#8A9678

the script:

#!/bin/sh
if ! gputemp=$(nvidia-smi --format=nounits,csv,noheader --query-gpu=temperature.gpu | xargs echo); then
gputemp=0
fi
if [ “$gputemp” -gt 0 ]; then
echo “$gputemp”
else
echo “$gputemp”
fi

I didn’t test that in i3status or polybar but I’m pretty sure it’ll work.

4 Likes
#2

Thx for sharing your tips @archus , top job in there.

#3

Good work, thanks for sharing!