Skip to content

Commit 4f3d246

Browse files
committed
bashwelcometweak: fix GPU temp reading
On RasPI OS 11/12 (bullseye/bookworm) the `vcgencmd` command has moved completely to `/usr/bin`, while on Buster it's just a symlink from `/usr/bin/` to `/opt/vc/bin`. Remove the full path to the command and just check whether is't in our `$PATH` before running.
1 parent 1fd3bf5 commit 4f3d246

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scriptmodules/supplementary/bashwelcometweak.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function retropie_welcome() {
4444
cpuTempC=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000)) && cpuTempF=$((cpuTempC*9/5+32))
4545
fi
4646
47-
if [[ -f "/opt/vc/bin/vcgencmd" ]]; then
48-
if gpuTempC=$(/opt/vc/bin/vcgencmd measure_temp); then
47+
if [[ -n $(command -v vcgencmd) ]]; then
48+
if gpuTempC=$(vcgencmd measure_temp); then
4949
gpuTempC=${gpuTempC:5:2}
5050
gpuTempF=$((gpuTempC*9/5+32))
5151
else

0 commit comments

Comments
 (0)