Round GPU temperature to an integer in stats.sh

A recent nvidia driver update (620.70.06) made nvidia-smi's
temperature.gpu query return a float (e.g. 59.91) instead of an
integer, which showed up unrounded in the bar's GPU pill.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
This commit is contained in:
nico
2026-11-15 00:48:48 +01:00
parent 06d2bd5ebb
commit 7b1a7794f0

View File

@@ -59,7 +59,7 @@ except Exception:
" 2>/dev/null) " 2>/dev/null)
[ -z "$temp" ] && temp="NA" [ -z "$temp" ] && temp="NA"
gpu_line=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounits 2>/dev/null | tr -d ' ' | tr ',' '|') gpu_line=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounits 2>/dev/null | tr -d ' ' | tr ',' '|' | awk -F'|' 'BEGIN{OFS="|"} {$2=int($2+0.5); print}')
[ -z "$gpu_line" ] && gpu_line="NA|NA|NA|NA" [ -z "$gpu_line" ] && gpu_line="NA|NA|NA|NA"
# Every real mounted filesystem (skips virtual/pseudo ones), root first so the # Every real mounted filesystem (skips virtual/pseudo ones), root first so the