arelange / gnome-shell-extension-hibernate-status

Gnome Shell extension that adds a hibernate/hybrid suspend button in Status menu.
GNU General Public License v2.0
151 stars 54 forks source link

Can't enable extension on GNOME 45 #110

Closed jugendhacker closed 8 months ago

jugendhacker commented 8 months ago

The extensions application does not let me enable it on GNOME 45, because of this.systemMenu is undefined

Possibly related to #106

asfernandes commented 8 months ago

It also still shows as incompatible for me in https://extensions.gnome.org/extension/755/hibernate-status-button/ Using Ubuntu 23.10 here.

p91paul commented 8 months ago

Duplicate of #109

jugendhacker commented 8 months ago

@p91paul IMHO this is not a duplicate of #109, as this issue here is about a actual bug that prevents me from using the extension rather than it not being on extensions.gnome.org (which 109 seems to be about)

p91paul commented 8 months ago

@jugendhacker how did you install? I just assumed it was from extensions.gnome.org, but if you installed manually the code from here (and the extension tool didn't force update you) then something is wrong and I will reopen. Please try disabling other extensions to rule out extensions incompatibilities, as I've seen the extension mostly working, at least to the point of showing the hibernate entries in the menu.

lobothiago commented 8 months ago

I'm getting the same error @jugendhacker mentioned when he opened this issue. Installed manually to GNOME 45.

image

lobothiago commented 8 months ago

I was able to make this work locally by delaying the initialization of the extension until Main.panel.statusArea.quickSettings._system becomes available. Here's an explanation of why the issue happens in the first place: https://discourse.gnome.org/t/main-panel-statusarea-quicksettings-system-is-undefined/16827

Here's my PR: https://github.com/arelange/gnome-shell-extension-hibernate-status/pull/113

I've never written gnome-shell extensions, so my fix might not follow some best practice - if that's the case, feel free to scratch it and do it appropriately :)