daitj / gnome-display-brightness-ddcutil

Display brightness slider for gnome shell using ddcutil backend
GNU General Public License v3.0
309 stars 38 forks source link

Extension doesn't load, gschemas.compiled: No such file or directory #153

Closed antonijn closed 1 month ago

antonijn commented 1 month ago

Describe the bug For versions 50 and later, the extension does not load for me. On extensions.gnome.org it shows a red "ERROR" indicator (see screenshot).

To Reproduce Remove any previously installed versions. Download the version 50 zip from extensions.gnome.org, unpack it to /usr/local/share/gnome-shell/extensions/, log out from GNOME, and log back in.

Delete cache file if it exists and try again N/A

Journal logs After clicking on the settings icon on extensions.gnome.org:

The settings of extension display-brightness-ddcutil@themightydeity.github.com had an error:

GLib.FileError: Failed to open file “/usr/local/share/gnome-shell/extensions/display-brightness-ddcutil@themightydeity.github.com/schemas/gschemas.compiled”: open() failed: No such file or directory

Stack trace:
  getSettings@resource:///org/gnome/Shell/Extensions/js/extensions/sharedInternals.js:100:53
  fillPreferencesWindow@file:///usr/local/share/gnome-shell/extensions/display-brightness-ddcutil@themightydeity.github.com/prefs.js:201:31
  _loadPrefs@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:41:18
  async*_init@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:26:14
  ExtensionPrefsDialog@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:17:4
  OpenExtensionPrefsAsync@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:139:33
  async*_handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35
  _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34
  _init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

Screenshots Screenshot from 2024-10-03 22-04-51

Desktop (please complete the following information):

Additional context N/A

daitj commented 1 month ago

Why are you installing extension to /usr/local/share/gnome-shell/extensions not ~/.local/share/gnome-shell/extensions?

After GNOME 44+, gschema is compiled during runtime by gnome shell, so it was removed from the extension automatically while publishing newer versions.

I am guessing there are some permission issue while creating that file since /usr/local/share/gnome-shell/extensions is most likely owned by root not the user using gnome shell.

I highly discourage this because an update to the extension will break this and you have to generate this again.

If you really want to install it at /usr/local/share/gnome-shell/extensions, you to run this as root to manually generate gschema file.

glib-compile-schemas /usr/local/share/gnome-shell/extensions/display-brightness-ddcutil@themightydeity.github.com/schemas
antonijn commented 1 month ago

I install to /usr/local/share/gnome-shell/extensions, because this is the canonical location for non-distribution-provided system-wide extensions. I share my computer with a non-technical person, who doesn't know what GNOME is, let alone ddcutil, but who would still like to control the display brightness. I do not want to manage/update GNOME extensions for both users, so I install all appropriate extensions system-wide using ansible.

It's a shame you will not be including gschemas.compiled, since all other extensions I use still include it for their GNOME 44+ versions. I guess I will be updating my ansible playbook to compile the schemas after each update.

daitj commented 1 month ago

I actually use gnome-extensions pack command to make the zip which has started to remove it once I updated to GNOME 47. I totally understand your use case, I am guessing other extensions also will have similar issue in the future. Perhaps you need to make GNOME developer aware of your situation as it is an important one.

antonijn commented 1 month ago

Ah, how odd! Thanks for letting me know, maybe I'll contact the GNOME developers, indeed.

daitj commented 1 month ago

Perhaps you need to install the zip using sudo gnome-extensions install file.zip, haven't tested it, not in the PC atm.

antonijn commented 1 month ago

Unfortunately that just installs it to ~root/.local/share/gnome-shell/extensions. Also, gnome-extensions can list --system extensions, but --system is not a valid option for gnome-extensions install.

antonijn commented 1 month ago

Okay, gnome-extensions gets it right using XDG_DATA_HOME=/usr/local/share gnome-extensions install file.zip.

Thanks for thinking along!

EDIT: Never mind, gnome-extensions messes up permissions and SELinux labels... Why GNOME has no proper way to install extensions from the command line is beyond me.

daitj commented 1 month ago

I think they need to patch the gnome-extensions install for your use case, which IMO is a valid use case, I am guessing that Fedora's GNOME package maintainers haven't tested it throughly yet with SELinux labels. Better yet --system install should work which probably has to be reported directly to GNOME developers.