isDipesh / gnome-shell-extension-sensors

Gnome shell extension: Shows CPU temperature, HDD temperature, voltage and fan RPM
https://motorscript.com/gnome-shell-extension-sensors/
161 stars 153 forks source link

parseHddTempOutput only listing first drive #103

Closed MisterGuinness closed 10 years ago

MisterGuinness commented 10 years ago

Firstly, thanks to all contributing to this extension. Monitoring helped me notice that the CPU fan speed dropped to zero due to my tinkering in the box causing some wiring to foul the fan blades. CPU overheating avoided! By way of thanks I humbly submit the following minor fix:

I have 3 drives, only the first was being listed. My interpretation of parseHddTempOutput is that the hddtemp output should be initially split by newlines if an instance of double-separator (double colon-space for me) was not found, in which case the indexOf method returns -1.

diff /run/media/mrg/sensors/gnome-shell-extension-sensors/src/utilities.js /home/mrg/.local/share/gnome-shell/extensions/temperature@xtranophilist/utilities.js 2>&1
162c162
<     if (txt.indexOf((sep+sep), txt.length - (sep+sep).length))

---
>     if (txt.indexOf((sep+sep), txt.length - (sep+sep).length)>=0)
adrianbroher commented 10 years ago

I agree with your interpretation. Thanks for providing this fix.