Review of "supergfxctl-gex" version 27

Details Page Preview

supergfxctl-gex is a gnome extension for supergfxctl (https://gitlab.com/asus-linux/supergfxctl).

Extension Homepage
https://gitlab.com/asus-linux/supergfxctl-gex

No comments.

Diff Against

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

All Versions

Previous Reviews on this Version

JustPerfection posted a review
You can use your own helper, that was just a recommendation. btw, please add url to the metadata.json (as mentioned in version 1 review and hasn't been addressed yet).
ZappeL posted a review
Ah thanks for the hint. Will add that as well!
ZappeL posted a review
Okay I sorted out everything you mentioned, except the DI thingy. Could you eventually be so kind and show me an example of howto use DI in a GJS extension scope? (btw. sorry for my stupid questions, I was long time off from this project and must get things sorted out.. -.-)
ZappeL posted a review
The following had changed (v24 -> v27): - renamed panel43 to panel (including a GS version switch for the toggle initialization) - shifted some helpers out of the main file (to have a more structured code) - changed the main-extension initialization sequence, so the panel gets initialized in any case (this caused some trouble in the past)
JustPerfection rejected
1. Do not remove empty lines between functions and classes. That can make the review process harder, which is against our rules: https://gjs.guide/extensions/review-guidelines/review-guidelines.html#code-must-not-be-obfuscated 2. We have `misc.spawn()`. You can also use that instead of creating your own custom function: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/a1cf24ba07b680482608b391b67babe731002a20/js/misc/util.js#L68 3. You are creating global in line 38 (extension.js) which is going to live there after disable. Just return instead of assigning it to any variable: ```js function init() { return new Extension(); } ```
ZappeL posted a review
I must say, that I'm a bit confused now. But for sure I'll adjust the code, but could you be so kind and give me some answers to the three points? 1. There weren't any emptylines in the past, could you please provide my a line-number where this happens? (I can't see a diffrence there to the versions below 27) 2. misc.spawn() is never used in this code. Do you mean the spawnCommandLine function (helpers), wich encapsulates the GLib.spawn_command_line_async() ? 3. Same as 1. this wasn't a problem in the past, is that a breaking change in GS 44? Maybe you can give me a hint on how I can access the extension instance then (or is it simply by using "Me")?
JustPerfection posted a review
1. I just catch that since you've posted those 3 new files. For example, between line 9 and 10 (modules/panel.js) should have a new line. 2. Yes, as mentioned, you can use `misc.spawn()` instead of that helper function (just a recommendation though). 3. Missed that before. Use dependency injection for `gpuModeToggle`.
ZappeL posted a review
Some addition to the "misc.spawn()" command. I think we need to use misc.spawnCommandline(), but there seems to be a bug in GJS as it calls "trySpawn" instead of "trySpawnCommandline". see: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/a1cf24ba07b680482608b391b67babe731002a20/js/misc/util.js#L84
JustPerfection posted a review
What do you mean by bug? `trySpawn` is a function in that module which is doing `GLib.spawn_async()`
ZappeL posted a review
The misc.util also contains a function called "trySpawnCommandline" (see: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/a1cf24ba07b680482608b391b67babe731002a20/js/misc/util.js#L158) which is not used inside the "spawnCommandline()" - as we need to spawn a commandline process.
JustPerfection posted a review
line 20 extension.js should be: ```js this.quickToggles = new Panel.gpuModeToggle(this.gpuModeIndicator); ``` line 33 (modules/panel.js) inside `construct`: ```js constructor(gpuModeIndicator) { // .. this._gpuModeIndicator = gpuModeIndicator; } ``` Now you don't need to access global inside `setIndicator` (line 152 modules/panel.js): ```js setIndicator () { // replace all `sgfxctlExtension.gpuModeIndicator` with `this._gpuModeIndicator` // replace all `sgfxctlExtension.quickToggles._lastState` with `this._lastState` // replace all `sgfxctlExtension.quickToggles._powerState` with `this._powerState` } ``` I wrote everything in this box without testing it myself. so test it before sending the package here :p
ZappeL posted a review
Many thanks! I'll take a look on that and of course I'm doing some testings before pushing v28. Btw. do you guys have a matrix odr irc server? (so I can reach out some devs directly?) Nvm. Again, many thanks for your input. I really appreciate it! (and it helped me a lot)
JustPerfection posted a review
Sure ;) - [GNOME Matrix Channel](https://matrix.to/#/#extensions:gnome.org) - IRC Bridge: irc://irc.gimpnet.org/shell-extensions