Closed hashstat closed 4 years ago
Using buttonGroup
instead of _actionsItem
seems to do the job. (Not yet tested, but the extension seems to be running without any errors)
I can confirm - changing _actionsItem
to buttonGroup
seems to fix crash. I was able to suspend and resume after that.
could you open a pull request for this fix? is it possible it will work on older versions as well after the change?
@p91paul I'm busy for the next few days and from the quick look at the commit history I'm pretty sure it won't work with the older versions. Perhaps someone else could look into it and make a pull request?
Tried the aforementioned change but it won't work for me (running Arch):
sept. 27 19:46:19 mymachine gnome-shell[966]: JS ERROR: Error: No signal 'ConfirmedHibernate' on object 'Gjs_HibernateDialog'
_onHibernateClicked@/usr/share/gnome-shell/extensions/hibernate-status@dromi/extension.js:128:9
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
The suggested change worked for me on Arch. Easy application: (Don't forget to back up)
cd .local/share/gnome-shell/extensions/hibernate-status@dromi/
sed -i 's/_actionsItem/buttonGroup/g' ./extension.js
The suggested change worked for me on Arch. Easy application: (Don't forget to back up)
cd .local/share/gnome-shell/extensions/hibernate-status@dromi/ sed -i 's/_actionsItem/buttonGroup/g' ./extension.js
After this change the extension starts and hibernation button appears but it is not working. I get the same error reported by fthiery here https://github.com/arelange/gnome-shell-extension-hibernate-status/issues/34#issuecomment-536035528.
Same for me. After applying #34 (comment) the button came back to menu. But the button does not work - does nothing. Hibernation still works by systemctl hibernate -command. Hope someone fixes this error.
Sorry everyone, once the button was back I never tested it :man_facepalming: I'm in the same boat as everyone else, the button has returned but is non functional. (Button can't launch the confirmation modal)
EDIT: On Fedora 31, the change suggested in https://github.com/arelange/gnome-shell-extension-hibernate-status/issues/34#issuecomment-534977549 does not work, too. The hibernation dialog is not shown.
On Fedora 31, I applied the change suggested in https://github.com/arelange/gnome-shell-extension-hibernate-status/issues/34#issuecomment-534977549 and I am able to get the hybrid-sleep option (alt + button press) to work. Hibernate does nothing as others have reported. I see the following error in the logs:
JS ERROR: Error: No signal 'ConfirmedHibernate' on object 'Gjs_ModalDialog'
_onHibernateClicked@/home/aravindh/.local/share/gnome-shell/extensions/hibernate-status@dromi/extension.js:131:9
Yeah, the reason hybrid-sleep works but not hibernate is because the former doesn't pull up a dialogue box, it just runs the hybrid-sleep function right away.
I'm not familiar enough with how the modal logic works here so I can't fix it, but you can side-step it by disabling the dialogue box by replacing the contents of the _onHibernateClicked() function (line 128) with:
_onHibernateClicked() {
this.systemMenu.menu.itemActivated();
this._loginManagerHibernate();
}
I tested it and it works fine, but you of course don't get a dialogue box asking if you're sure you want to hibernate.
Here's a branch with these changes. Clone it, in the extension directory, run
glib-compile-schemas schemas
and then
cd ~/.local/share/gnome-shell/extensions
rm -Rf hibernate-status@dromi
ln -s (PATH TO YOUR CLONE) hibernate-status@dromi
@inducer do you mind opening a pull request? I can try merging it. Afterwards I'll need to regain maintainer status on e.g.o., but that's a different issue.
Nevermind, I did it. I will try to fix the dialog and to add backwards compatibility.
Done. I leave #38 open. @davidbailey00 is the maintainer on e.g.o., so we'll see if he will upload the new version there. Otherwise I will try and get it back and upload it myself.
FYI arch users, the AUR currently lacks glib-compile-schemas schemas but a patch has been made available: https://aur.archlinux.org/packages/gnome-shell-extension-hibernate-status-git/#comment-715669
I confirm that this fixes the issue, thanks to inducer !
The latest gnome-shell, version 3.34, breaks this great extension. Please let me know if I can help in some way.