Review of "Auto Screen Brightness" version 1

Details Page Preview

Automatically switch the screen brightness depending on the power supply status

Extension Homepage
https://github.com/popov895/auto-screen-brightness

No comments.

FAQ

Files

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

All Versions

Version Status
18 Active
17 Active
16 Active
15 Active
14 Active
13 Active
12 Active
11 Active
10 Active
9 Active
8 Active
7 Active
6 Active
5 Active
4 Active
3 Active
2 Active
1 Active

Previous Reviews on this Version

JustPerfection rejected
Please don't call functions in global scope (line 10-14 `extension.js`): [EGO Review Guidelines: Initialization](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#only-use-initialization-for-static-resources) Move them to enable and null them out in disable.
popov895 posted a review
Thanks for review. loadInterfaceXML returns a string which describes the requested interface, see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/f0f15f26db4577c08157bbf2d6baacbd8b074c9b/js/misc/dbusUtils.js#L26. Gio.DBusProxy.makeProxyWrapper creates a reusable class that can use to create proxy, see https://gitlab.gnome.org/GNOME/gjs/-/blob/6beff4510dec9127408910a8952cfd424b3614c8/modules/core/overrides/Gio.js#L233. The same code can be found in the GNOME Shell, see https://gitlab.gnome.org/search?search=Gio.DBusProxy.makeProxyWrapper&project_id=546&search_code=true&repository_ref=main
popov895 posted a review
I mean, there's no object creation or anything like that.
JustPerfection posted a review
Global scope is the same as init and you are creating instance of objects in global scope (`PowerManagerProxy` and `BrightnessProxy`): As we stated in Review Guidelines: > Only use initialization for static resources > Extensions MUST NOT create any objects, connect any signals, add any main loop sources or modify GNOME Shell during initialization. Also, GNOME Shell is not like extensions since it doesn't have enable and disable. The point is, extensions should fully clean up on disable and doing that can break multiple rules: - [EGO Review Guidelines: Initialization](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#only-use-initialization-for-static-resources) - [EGO Review Guidelines: Destroy](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#destroy-all-objects)
JustPerfection active
Approved since we have a discussion about this in GNOME Matrix channel. From now on `Gio.DBusProxy.makeProxyWrapper` and `loadInterfaceXML` can be used on global scope.