HarlemSquirrel / gnome-shell-extension-sensory-perception

Displays CPU/GPU/mobo/disk temperatures, voltages and fan speeds
https://extensions.gnome.org/extension/1145/sensory-perception/
GNU General Public License v3.0
27 stars 11 forks source link

No values for fan speed and voltage #46

Open lemrm opened 2 years ago

lemrm commented 2 years ago

Describe the bug

in settings fan speed an voltage is enabled but section and values are not shown and nothing from:

journalctl --since="date '+%Y-%m-%d %H:%M'" -f | grep sensory-perception

To Reproduce

installed by chome-web-extension

Expected behavior

shown sections and values

Screenshots see below

Desktop (please complete the following information):

Additional context

Bildschirmfoto vom 2021-12-22 13-25-18

upower -i /org/freedesktop/UPower/devices/battery_BAT1 
  native-path:          BAT1
  vendor:               SAMSUNG Electronics
  model:                SR Real Battery
  serial:               123456789
  power supply:         yes
  updated:              Mi 22 Dez 2021 13:52:32 CET (89 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              20,6176 Wh
    energy-empty:        0 Wh
    energy-full:         29,562 Wh
    energy-full-design:  44,5704 Wh
    energy-rate:         13,6819 W
    voltage:             8,306 V
    time to full:        39,2 minutes
    percentage:          77%
    capacity:            62,9252%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (charge):
    1640177552  77,000  charging
  History (rate):
    1640177552  13,682  charging
acpi -V
Battery 0: Charging, 80%, 00:24:46 until charged
Battery 0: design capacity 5880 mAh, last full capacity 3500 mAh = 59%
Adapter 0: on-line
Thermal 0: ok, 59.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 99.0 degrees C
Thermal 0: trip point 1 switches to mode passive at temperature 97.0 degrees C
Thermal 1: active, 59.0 degrees C
Thermal 1: trip point 0 switches to mode critical at temperature 99.0 degrees C
Thermal 1: trip point 1 switches to mode passive at temperature 97.0 degrees C
Thermal 1: trip point 2 switches to mode active at temperature 71.0 degrees C
Thermal 1: trip point 3 switches to mode active at temperature 55.0 degrees C
Cooling 0: Processor 0 of 3
Cooling 1: Processor 0 of 3
Cooling 2: Fan 0 of 1
Cooling 3: Processor 0 of 3
Cooling 4: Processor 0 of 3
Cooling 5: intel_powerclamp no state information available
Cooling 6: Fan 0 of 1
Cooling 7: x86_pkg_temp no state information available
sensors
BAT1-acpi-0
Adapter: ACPI interface
in0:           8.32 V  
curr1:         1.58 A  

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +58.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +58.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +57.0°C  (high = +100.0°C, crit = +100.0°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +59.0°C  (crit = +99.0°C)
temp2:        +59.0°C  (crit = +99.0°C)
HarlemSquirrel commented 2 years ago

Hi @lemrm could you please share the output of running sensors in the terminal?

lemrm commented 2 years ago

Hi @lemrm could you please share the output of running sensors in the terminal?

... improved the bug report

HarlemSquirrel commented 2 years ago

Thank you for the quick update! This extension parses fan speed and voltage from sensors and I don't see that data in your sensors output.

You could try running sudo sensors-detect which will attempt to find sensors it can read for fan speed and voltage.

If that doesn't work, you may not have the kernel module(s) loaded that you need or such modules may not exist. More information on that can be found on the ArchLinux Wiki

lemrm commented 2 years ago

True, only shows voltage, no fan rpm at least. Is it possible to have something like

inxi -Bxxx

Battery:   ID-1: BAT1 charge: 25.8 Wh (97.0%) condition: 26.6/44.7 Wh (59.5%) volts: 8.3 min: 7.6 
           model: SAMSUNG Electronics SR Real Battery type: Li-ion serial: 123456789 status: Unknown cycles: 996

for health, cycles, current capacity and voltage?

HarlemSquirrel commented 2 years ago

Yeah that is something we could add as a new feature to be able to read from there as well.

I don't have time to add the feature myself but I welcome a pull request! 🙂

lemrm commented 2 years ago

never coded myself and I'm not familiar with git/collaboration/branches/merge and so on

lemrm commented 2 years ago

guide me, which file have to be changed? utilities.js? A new function?

HarlemSquirrel commented 2 years ago

Here is where we are reading fan and voltage now from sensors output

https://github.com/HarlemSquirrel/gnome-shell-extension-sensory-perception/blob/d422a3db828cabbe9426473a4269caa366748fa8/extension.js#L153-L159

https://github.com/HarlemSquirrel/gnome-shell-extension-sensory-perception/blob/d422a3db828cabbe9426473a4269caa366748fa8/utilities.js#L160-L194

I think we'd want to add new functions to read fan and voltage from inxi output in utilities.js and then add that to fanInfo and voltageInfo in extension.js

A friendly word of caution: writing GNOME JavaScript is not the easiest place to start coding. I suggest checking out some basic JavaScript tutorials first at https://www.freecodecamp.org/ and/or https://www.codecademy.com/ and then take a look at the GNOME guides.

I just added a new document on contributing that may help as well 😺