Skip to content

Commit

Permalink
Merge pull request #408 from corecoding/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
corecoding authored Feb 21, 2024
2 parents 6dd6dfa + 24c8efd commit 664b7ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
18 changes: 3 additions & 15 deletions helpers/subprocess.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import GLib from 'gi://GLib';
import Gio from 'gi://Gio';
const ByteArray = imports.byteArray;

var Decoder;
try {
Decoder = new TextDecoder('utf-8');
} catch(error) {}

// convert Uint8Array into a literal string
function convertUint8ArrayToString(contents) {
// Starting with Gnome 41, we use TextDecoder as ByteArray is deprecated
if (Decoder)
return Decoder.decode(contents).trim();

// Supports ByteArray on Gnome 40
// fixes #304, replaces invalid character
contents[contents.indexOf(208)] = 0;
return ByteArray.toString(contents).trim();
const decoder = new TextDecoder('utf-8');
return decoder.decode(contents).trim();
}

export function SubProcess(command) {
Expand Down Expand Up @@ -63,4 +51,4 @@ SubProcess.prototype.terminate = function() {
this.sub_process = null;
this.stdout.close_async(GLib.PRIORITY_LOW, null, null);
this.stdout = null;
};
};
30 changes: 15 additions & 15 deletions schemas/org.gnome.shell.extensions.vitals.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
<summary>Monitor processor</summary>
<description>Display processor information</description>
</key>
<key type="b" name="include-static-info">
<default>false</default>
<summary>Include processor static information</summary>
<description>Display processor static information that doesn't change</description>
</key>
<key type="b" name="show-system">
<default>true</default>
<summary>Monitor system</summary>
Expand Down Expand Up @@ -116,16 +111,6 @@
<summary>Battery slot to monitor</summary>
<description>Which numerical battery slot should vitals monitor</description>
</key>
<key type="b" name="show-gpu">
<default>false</default>
<summary>Monitor GPU</summary>
<description>Display GPU information (requires the nvidia-smi tool)</description>
</key>
<key type="b" name="include-static-gpu-info">
<default>false</default>
<summary>Include GPU static information</summary>
<description>Display GPU static information that doesn't change</description>
</key>
<key type="b" name="fixed-widths">
<default>true</default>
<summary>Use fixed widths in top bar</summary>
Expand All @@ -146,5 +131,20 @@
<summary>System Monitor command</summary>
<description>The command run when system monitor button is clicked</description>
</key>
<key type="b" name="include-static-info">
<default>false</default>
<summary>Include processor static information</summary>
<description>Display processor static information that doesn't change</description>
</key>
<key type="b" name="show-gpu">
<default>false</default>
<summary>Monitor GPU</summary>
<description>Display GPU information (requires the nvidia-smi tool)</description>
</key>
<key type="b" name="include-static-gpu-info">
<default>false</default>
<summary>Include GPU static information</summary>
<description>Display GPU static information that doesn't change</description>
</key>
</schema>
</schemalist>

0 comments on commit 664b7ad

Please sign in to comment.