diff --git a/Sensors@claudiux/files/Sensors@claudiux/CHANGELOG.md b/Sensors@claudiux/files/Sensors@claudiux/CHANGELOG.md index 849e80dfe45..2a9304e71a2 100644 --- a/Sensors@claudiux/files/Sensors@claudiux/CHANGELOG.md +++ b/Sensors@claudiux/files/Sensors@claudiux/CHANGELOG.md @@ -1,3 +1,7 @@ +### v4.0.3~20250126 + * Improved code. Greater stability. + * Change of Fan symbol. + ### v4.0.2~20250116 * mainloopTools library: improvements. diff --git a/Sensors@claudiux/files/Sensors@claudiux/applet.js b/Sensors@claudiux/files/Sensors@claudiux/applet.js index 3585c00bd26..e0182b9b014 100644 --- a/Sensors@claudiux/files/Sensors@claudiux/applet.js +++ b/Sensors@claudiux/files/Sensors@claudiux/applet.js @@ -8,7 +8,6 @@ const {AppletSettings} = imports.ui.settings; //const Gettext = imports.gettext; const Extension = imports.ui.extension; // Needed to reload this applet const ModalDialog = imports.ui.modalDialog; -const Lang = imports.lang; //util const {spawnCommandLineAsyncIO, spawnCommandLineAsync, spawnCommandLine, unref} = require("./lib/util"); //to-string @@ -51,7 +50,7 @@ const {SensorsReaper} = require("./lib/sensorsReaper"); const ENABLED_APPLETS_KEY = "enabled-applets"; const C_TEMP = '⦿'; //'🌡' -const C_FAN = '🤂'; +const C_FAN = '𖣘'; //'🤂' const C_VOLT = '🗲'; //'🔌' const C_INTRU = '⮿'; const DEFAULT_APPLET_LABEL = [C_TEMP, C_FAN, C_VOLT, C_INTRU]; @@ -213,14 +212,14 @@ class SensorsApplet extends Applet.TextApplet { spawnCommandLineAsync("/bin/bash -c 'cd %s && chmod 755 *.py *.sh'".format(SCRIPTS_DIR), null, null); this.sudo_or_wheel = "none"; - let subProcess = spawnCommandLineAsyncIO("/bin/bash -c 'groups'", Lang.bind(this, (out, err, exitCode) => { + let subProcess = spawnCommandLineAsyncIO("/bin/bash -c 'groups'", (out, err, exitCode) => { if (exitCode == 0) { let groups = out.trim().split(' '); if (groups.indexOf("wheel") > -1) this.sudo_or_wheel = "wheel"; if (groups.indexOf("sudo") > -1) this.sudo_or_wheel = "sudo"; } subProcess.send_signal(9); - })); + }); // Detect language for numeric format: this.num_lang = this._get_lang(); @@ -531,7 +530,7 @@ class SensorsApplet extends Applet.TextApplet { let _temp; //~ if (disk["value"]) //~ _temp = disk["value"]; - let subProcess = spawnCommandLineAsyncIO(command, Lang.bind (this, function(stdout, stderr, exitCode) { + let subProcess = spawnCommandLineAsyncIO(command, (stdout, stderr, exitCode) => { if (exitCode === 0) { //~ this._temp[_disk_name] = stdout; @@ -556,7 +555,7 @@ class SensorsApplet extends Applet.TextApplet { } } subProcess.send_signal(9); - })); + }); } } } @@ -564,7 +563,7 @@ class SensorsApplet extends Applet.TextApplet { populate_temp_disks_in_settings() { let command = SCRIPTS_DIR+"/get_disk_list.sh"; var temp_disks = this.temp_disks; - let subProcess = spawnCommandLineAsyncIO(command, Lang.bind(this, function(stdout, stderr, exitCode) { + let subProcess = spawnCommandLineAsyncIO(command, (stdout, stderr, exitCode) => { if (exitCode === 0) { let out = stdout.trim(); let disks = out.split(" "); @@ -579,7 +578,7 @@ class SensorsApplet extends Applet.TextApplet { this.temp_disks = temp_disks }; subProcess.send_signal(9); - })) + }); } populate_fan_sensors_in_settings(force = true) { @@ -1311,7 +1310,6 @@ class SensorsApplet extends Applet.TextApplet { // Button suspend let suspend_switch = new PopupMenu.PopupSwitchMenuItem(_("Suspend Sensors"), this.suspended); - //~ suspend_switch.connect("toggled", Lang.bind(this, function() { suspend_switch.connect("toggled", () => { this.menu.toggle(); this.suspended = !this.suspended; @@ -1675,10 +1673,10 @@ class SensorsApplet extends Applet.TextApplet { _on_disktemp_button_pressed() { let subProcess = spawnCommandLineAsyncIO( "/bin/bash -c '%s/pkexec_make_smartctl_usable_by_sudoers.sh %s'".format(SCRIPTS_DIR, this.sudo_or_wheel), - Lang.bind(this, (out, err, exitCode) => { + (out, err, exitCode) => { this.s.setValue("disktemp_is_user_readable", this.is_disktemp_user_readable()); subProcess.send_signal(9); - })); + }); } //~ check_disktemp_user_readable(force=false) { diff --git a/Sensors@claudiux/files/Sensors@claudiux/lib/sensorsReaper.js b/Sensors@claudiux/files/Sensors@claudiux/lib/sensorsReaper.js index b2dbbe35e2e..d88d88a8857 100644 --- a/Sensors@claudiux/files/Sensors@claudiux/lib/sensorsReaper.js +++ b/Sensors@claudiux/files/Sensors@claudiux/lib/sensorsReaper.js @@ -1,7 +1,6 @@ const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; // Needed for file infos //const Util = imports.misc.util; -const Lang = imports.lang; const Signals = imports.signals; const Cinnamon = imports.gi.Cinnamon; const Util = require("./lib/util"); @@ -80,7 +79,7 @@ class SensorsReaper { this.sensors_command = this.sensors_program + " -u"; this.sensors_is_json_compatible = false; let command = "%s -v".format(this.sensors_program); - let subProcess = Util.spawnCommandLineAsyncIO(command, Lang.bind(this, function(stdout, stderr, exitCode) { + let subProcess = Util.spawnCommandLineAsyncIO(command, (stdout, stderr, exitCode) => { if (exitCode === 0) { let output = stdout; if (typeof stdout === "object") output = to_string(stdout); @@ -88,7 +87,7 @@ class SensorsReaper { this.applet.sensors_version = sensors_version; } subProcess.send_signal(9); - })); + }); } return this.sensors_command; } else { @@ -113,7 +112,7 @@ class SensorsReaper { if (this.nvidia_smi_program) { let command = `${this.nvidia_smi_program} --version`; let subProcess = Util.spawnCommandLineAsyncIO(command, - Lang.bind(this, function (stdout, stderr, exitCode) { + (stdout, stderr, exitCode) => { if (exitCode === 0) { let output = stdout; if (typeof stdout === "object") @@ -131,7 +130,7 @@ class SensorsReaper { } // Test the command because Nvidia doesn't guarantee backwards compatability let testProcess = Util.spawnCommandLineAsyncIO(this.nvidia_smi_command, - Lang.bind(this, function (stdout, stderr, exitCode) { + (stdout, stderr, exitCode) => { if (exitCode != 0) { global.logError(`Nvidia SMI call failed with code ${exitCode}: ${stdout}, ${stderr}`) global.log(`Incompatible Nvidia SMI: ${this.nvidia_smi_program} v${this.nvidia_smi_version} `); @@ -142,12 +141,10 @@ class SensorsReaper { global.log(`Nvidia SMI v${this.nvidia_smi_version} command: ${this.nvidia_smi_command}`); } testProcess.send_signal(9); - }) - ); + }); subProcess.send_signal(9); } - }) - ); + }); return this.nvidia_smi_command; } else { @@ -164,7 +161,7 @@ class SensorsReaper { //if (this.in_fahrenheit) //command += "f"; // The -f option of sensors is full of bugs !!! if (this.sensors_command != undefined) { - let subProcess = Util.spawnCommandLineAsyncIO(this.sensors_command, Lang.bind (this, function(stdout, stderr, exitCode) { + let subProcess = Util.spawnCommandLineAsyncIO(this.sensors_command, (stdout, stderr, exitCode) => { if (exitCode === 0) { if (this.sensors_is_json_compatible) this._sensors_reaped(stdout); @@ -173,14 +170,14 @@ class SensorsReaper { } //Util.unref(subProcess); subProcess.send_signal(9); - })); + }); } } reap_nvidia_smi() { if (this.nvidia_smi_command != undefined) { - let subProcess = Util.spawnCommandLineAsyncIO(this.nvidia_smi_command, Lang.bind(this, function (stdout, stderr, exitCode) { + let subProcess = Util.spawnCommandLineAsyncIO(this.nvidia_smi_command, (stdout, stderr, exitCode) => { if (exitCode === 0) { let results = {}; @@ -203,7 +200,7 @@ class SensorsReaper { global.logError(`Nvidia SMI call failed with code ${exitCode}: ${stdout}, ${stderr}`); } subProcess.send_signal(9); - })); + }); } } diff --git a/Sensors@claudiux/files/Sensors@claudiux/metadata.json b/Sensors@claudiux/files/Sensors@claudiux/metadata.json index c60ff993162..7d7f60b7219 100644 --- a/Sensors@claudiux/files/Sensors@claudiux/metadata.json +++ b/Sensors@claudiux/files/Sensors@claudiux/metadata.json @@ -2,7 +2,7 @@ "uuid": "Sensors@claudiux", "name": "Sensors Monitor", "description": "Displays the values of many computer sensors concerning Temperatures (CPU - GPU - Power Supply), Fan Speed, Voltages, Intrusions. Notifies you with color changes when a value reaches or exceeds its limit.", - "version": "4.0.2", + "version": "4.0.3", "max-instances": 1, "cinnamon-version": [ "3.8", diff --git a/Sensors@claudiux/files/Sensors@claudiux/settings-schema.json b/Sensors@claudiux/files/Sensors@claudiux/settings-schema.json index 9eda372539e..1699130a216 100644 --- a/Sensors@claudiux/files/Sensors@claudiux/settings-schema.json +++ b/Sensors@claudiux/files/Sensors@claudiux/settings-schema.json @@ -31,7 +31,7 @@ }, "page_Fans": { "type": "page", - "title": "🤂 Fan", + "title": "𖣘 Fan", "sections": [ "section_fanDisplay", "section_fanOptions",