Git Product home page Git Product logo

Comments (8)

lemrm avatar lemrm commented on July 19, 2024 1

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

... improved the bug report

from gnome-shell-extension-sensory-perception.

HarlemSquirrel avatar HarlemSquirrel commented on July 19, 2024 1

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! 🙂

from gnome-shell-extension-sensory-perception.

lemrm avatar lemrm commented on July 19, 2024 1

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

from gnome-shell-extension-sensory-perception.

HarlemSquirrel avatar HarlemSquirrel commented on July 19, 2024

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

from gnome-shell-extension-sensory-perception.

HarlemSquirrel avatar HarlemSquirrel commented on July 19, 2024

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

from gnome-shell-extension-sensory-perception.

lemrm avatar lemrm commented on July 19, 2024

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?

from gnome-shell-extension-sensory-perception.

lemrm avatar lemrm commented on July 19, 2024

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

from gnome-shell-extension-sensory-perception.

HarlemSquirrel avatar HarlemSquirrel commented on July 19, 2024

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

if (DisplayFanRPM){
fanInfo = Utilities.parseSensorsOutput(sensorsOutput,Utilities.parseFanRPMLine);
fanInfo = fanInfo.filter(Utilities.filterFan);
}
if (DisplayVoltage){
voltageInfo = Utilities.parseSensorsOutput(sensorsOutput,Utilities.parseVoltageLine);
}

function parseFanRPMLine(label, value) {
let sensor = undefined;
if(label != undefined && value != undefined) {
const curValue = value.trim().split(' ')[0];
// does the current value look like a fan rpm line?
if(curValue.indexOf("RPM", curValue.length - "RPM".length) !== -1) {
sensor = new Array();
let r;
sensor['label'] = label.trim();
sensor['rpm'] = parseFloat(curValue.split(' ')[0]);
sensor['min'] = (r = /min=(\d{1,5})/.exec(value)) ? parseFloat(r[1]) : undefined;
}
}
return sensor;
}
function parseVoltageLine(label, value) {
let sensor = undefined;
if(label != undefined && value != undefined) {
const regex = /\s+([\d\.]+)\s+(m?V)\s+\(min\s+\=\s+\+([\d\.]+)\sV,\smax\s\=\s+\+([\d\.]+)/;
const matchValue = value.match(regex);
// does the current value look like a voltage line?
if(matchValue) {
sensor = new Array();
sensor['label'] = label;
sensor['volt'] = parseFloat(matchValue[1]);
sensor['min'] = parseFloat(matchValue[3]);
sensor['max'] = parseFloat(matchValue[4]);
if(matchValue[2] == "mV") {
sensor['volt'] = sensor['volt'] / 1000.0;
}
}
}
return sensor;
}

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 😺

from gnome-shell-extension-sensory-perception.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.