tmux-plugins / tmux-cpu

Plug and play cpu percentage and icon indicator for Tmux.
MIT License
444 stars 68 forks source link

Raspberr Pi Temp #87

Open emibia opened 8 months ago

emibia commented 8 months ago

Hi there is no CPU temp for RPI.

I think can be done with:

echo "$(sensors)" | sed -e 's/^temp/Core /' | awk -v format="$cpu_temp_format$cpu_temp_unit" '/^Core [0-9]+/ {gsub("[0-9.]", "", $2); sum+=$3; n+=1 } END {printf(format, sum/n)}'.

and an IF in cpu_temp.sh, for RPI 4b is:

if grep -q "Raspberry" /proc/cpuinfo; then

Output from sensors:

rpi_volt-isa-0000
Adapter: ISA adapter
in0:              N/A

cpu_thermal-virtual-0
Adapter: Virtual device
temp1:        +53.6°C  (crit = +110.0°C)

gpio_fan-isa-0000
Adapter: ISA adapter
fan1:           0 RPM  (min =    0 RPM, max = 5000 RPM)

I can create a pull request.

travelingflwr commented 6 months ago

+1 for this. Changing Tccd to temp works for me so will watch for the update since TPM keeps refreshing the existing. :)