Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[object GjsModule byteArray]% #4

Closed
sneakingJ opened this issue May 29, 2020 · 4 comments
Closed

[object GjsModule byteArray]% #4

sneakingJ opened this issue May 29, 2020 · 4 comments

Comments

@sneakingJ
Copy link

Recently it doesn't show me the percentage number anymore but instead the text in the title.

@sneakingJ
Copy link
Author

Maybe it's this problem: paradoxxxzero/gnome-shell-system-monitor-applet#520

@sneakingJ
Copy link
Author

sneakingJ commented Jun 25, 2020

I applied the fix locally and it works. You just have to add some lines to the readFile function:

function readFile(deviceId, fileName) {
    let filePath = GLib.build_filenamev([POWER_DIR_PATH, DEVICE_PREFIX + deviceId, fileName]);
    let file = Gio.File.new_for_path(filePath);
    let out = file.load_contents(null);
    let value = out[1];
    if (value) {
        if (!ByteArray.toString(value).match(/GjsModule byteArray/)) {
            return ByteArray.toString(value).replace("\n", "");
        }
        return parseInt(value);
    }

    return "";
}

@thankjura
Copy link
Owner

Hmm. What your gnome-shell version?

@sneakingJ
Copy link
Author

Hmm. What your gnome-shell version?

GNOME Shell 3.28.4

bluet added a commit to bluet/gnome-shell-system-monitor-applet that referenced this issue Apr 6, 2021
… on Ubuntu 18.04

add backward support for Gnome 3.28 , fix NaN temperature and disk IO on Ubuntu 18.04 . 

related issues: paradoxxxzero#520 paradoxxxzero#526 paradoxxxzero#594 paradoxxxzero#597 paradoxxxzero#601  thankjura/ds4battery#4  
I don't have dedicated GPU to test paradoxxxzero#592 but it should be possible to fix in the same way.

inspired by @shemgp and @EBoisseauSierra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants