arelange / gnome-shell-extension-hibernate-status Goto Github PK
View Code? Open in Web Editor NEWGnome Shell extension that adds a hibernate/hybrid suspend button in Status menu.
License: GNU General Public License v2.0
Gnome Shell extension that adds a hibernate/hybrid suspend button in Status menu.
License: GNU General Public License v2.0
After resuming from suspend or hibernate, the hibernate button doesn't do anything when pressed. In the extensions menu, the on/off switch is grayed out. It'll work again if I restart the gnome shell afterwards.
No Hibernate menu option and there is the following error
The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
Hi, I previously submitted a comment (that I deleted) referencing bug #1
As it turns out I'm using SecureBoot and it just simply doesn't work with that, but I was unaware of that limitation. Perhaps do a check for secureboot and notify the user that it won't work because that's enabled?
Maybe even instead, don't allow the user to turn the extension on if it doesn't pass that check?
It's not necessarily a bug in the extension so much as it was confusing to have to track down the cause of pressing the hibernate button and it not do anything at all.
I found this working URL that looks similar, though for an older Ubuntu version:
https://help.ubuntu.com/16.04/ubuntu-help/power-hibernate.html
Error: Expected an object of type GtkWidget for argument 'widget' but got type undefined
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
please help.
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
OS: Arch Linux
Gnome version: 3.36.3
PS: systemctl hibernate
works fine
The extension was working without any problems on Ubuntu 18.04 until recently it stopped working. I am doubting the latest Gnome update has caused this but I am not sure. Hibernate still works with
sudo systenctl hibernate
Gnome version: 3.28.2
Ubuntu version: 18.04.2 LTS
status button not working. Ubuntu 20.04.2 LTS and Gnome snaps 3-28-1804/145 3-34-1804/66
error message:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
Hi,
how can we install and enable this extension from command line?
I'm trying to install it with ansible.
Thanks a lot
When trying to install from the gnome extensions website it displays error and I see this in journalctl
JS ERROR: Extension hibernate-status@dromi: ImportError: No JS module 'prefs' found in search path
@/usr/share/gnome-shell/extensions/hibernate-status@dromi/extension.js:13:7
_callExtensionInit@resource:///org/gnome/shell/ui/extensionSystem.js:343:13
loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:277:22
callback@resource:///org/gnome/shell/ui/extensionDownloader.js:232:17
gotExtensionZipFile/<@resource:///org/gnome/shell/ui/extensionDownloader.js:99:13
OS: EndevourOS
Gnome: 3.34.3
Was working very well until I updated to Gnome 3.32. The button is still there, and alt-click will perform the hybrid sleep. However, when clicking the hibernate button regularly, nothing happens. The dialog box does not even pop up
This is the same issue that #26 was supposed to fix, however after updating I have not noticed any change.
Side-note "sudo systemctl hibernate" does work on my machine
Hi,
I've read that using Alt modifier, I can also select Hybrid Sleep. However, I don't understand how. I press alt then click on the hibernate button?
Archlinux
5.5.8-arch1-1
3.36.0
JS ERROR: Extension hibernate-status@dromi: TypeError:
this.systemMenu._createActionButton is not a function
enable@/home/tukm/.local/share/gnome-shell/extensions/hibernate-status@dromi/extension.js:180:49
enable@/home/tukm/.local/share/gnome-shell/extensions/hibernate-status@dromi/extension.js:242:15
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:160:32
loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:311:26
callback@resource:///org/gnome/shell/ui/extensionDownloader.js:204:39
gotExtensionZipFile/<@resource:///org/gnome/shell/ui/extensionDownloader.js:97:13
I have installed the extension but no button shows up in the menu.
Going through lg
the extension emitted no errors.
Branch master is now 3.34 compatible.
when i use the button my computer goes to a different (and undesirable) state than when running
systemctl hibernate
from the terminal.
I tried to understand whats going on in the code by couldn't really...
Anyway when I use the button I get the following error:
NMI received for unknown reason
Do you have a strange power saving mode enabled?
Dazed and confused, but trying to continue
I kind of goes in to hibernate state and when waking up in to a suspend state.
Should probably be easy to fix as I is just the final call that makes the mess
The extension has been working flawlessly on Ubuntu 19.04, until upgrade to latest version.
Since then, the hibernate icon has disappeared and on the "Installed Extensions" dashboard an "ERROR" button is displayed besides this entry.
I also tried to unistall and then reinstall the extension, but the error persists.
gnome-shell-extensions version: 3.32.0-1
This comes from journalctl:
nov 13 17:56:04 Home gnome-shell[2205]: Extension "hibernate-status@dromi" had error: TypeError: GObject.registerClass() used with invalid base class (is ModalDialog)
nov 13 17:56:04 Home gnome-software[3066]: State change on user/*/*/shell-extension/hibernate-status_dromi/* from available to installed is not OK
nov 13 17:56:04 Home gnome-software[3066]: hibernate-status_dromi has error: TypeError: GObject.registerClass() used with invalid base class (is ModalDialog)
The extension doesn't work on 3.38, apparently due to a gnome bug.
I reported it upstream: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3264
see comments in https://extensions.gnome.org/extension/755/hibernate-status-button/
It worked in previous version. But when updating or reinstalling new version, error occurs.
Using: Ubuntu 20.04.1 LTS
The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
Dear @arelange,
Does your extension support internationalisation, i.e. can I help translate the dialog windows into different languages?
Thank you!
Yours,
Robert
The extension was working flawlessly on Ubuntu 19.04 until last kernel upgrade to 5.0.0-20-generic.
Since the upgrade, the hibernate button is missing from the status menu, although the Installed Extensions dashboard is still showing it as "on".
Hibernation is no harmful action, so you shouldn't ask for confirmation at all. In general, it's best practise to ask for confirmation only when performing actions which can't be undone. If you stand on a confirmation dialog, a config option would be just great.
Dear @arelange,
Please apologise as this is clearly out of scope of this extension.
However, my question is related and I am seeking your advice.
When I close my laptop lid, my laptop turns into suspend (still draining battery).
I am wondering if GNOME has a feature that can send my laptop from this state of suspend into hibernation (no draining of battery) after X minutes or if a certain critical battery level has been reached.
Are you aware of such a feature?
Thank you!
received notification of new version. attempted update. result: ERROR displayed.
`The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
`
Hi !
I made this Gnome extension for my personal use but I do notre really use anymore. Since I realized many people were waiting it to be updated, I think it would be a good thing if someone else can maintain it (and make it avalaible more quickly for 3.18 !)
Apply now !
Please update with Gnome 3.28 support. The hibernate button does not do the function, and it seems to power off Ubuntu 18.04
Chromium with GNOME Shell integration shows me https://extensions.gnome.org/extension/755/hibernate-status-button/ as outdated:
This could also help answering to the comments below, as GNOME 3.20 is supported the latest since April in the git tree, but apparently not in the extensions catalogue.
Mentioning the currently uploaded version and supported GNOME versions in the description text would be helpful, too.
When clicking on the button, it ask me if I really want to hibernate, but after clicking yes, nothing happens. Same for the hybrid sleep.
There is not output in the journal.
The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
I tried hibernating on my Manjaro Mikah Gnome edition(3.36) with Swap partition for hibernation.
The system will go black and unresponsive but does not fully shut down(power button indicator LED is on) and cannot reboot via hitting the power button.
Manual shutdown via holding down the power button turns the machine off but turning it back on, the system refuses to boot and stays at the boot screen logo.
Second time booting success and can boot from the system.
Hi, I am using your extension on Arch, but unfortunately it doesn't work: when I push on the hibernate button it shutdown the computer instead of hibernate and when I ask for hybrid-suspend it simply suspend.
I well understood this is a GNOME problem who disabled by defalut the hibernate button (https://wiki.archlinux.org/index.php/GNOME).
I found a kind of solution for Arch, but I don't know how to apply it in you code. Pratically, with Arch, there is a program (https://wiki.archlinux.org/index.php/Uswsusp) that once installed allow, with the following commands:
s2disk
s2both
to hibernate or hybrid-hibernate the computer. So, this is my idea:
is it possible to link the hibernate button to the bash command s2disk
?
and another one: there is a way to avoid that it ask for password?
Thanks.
systemd supports an alternative to hybrid mode called suspend-then-hibernate
(systemclt suspend-then-hibernate)
It enters suspend immediately, but all programs a wake alarm after a configurable time, whereas if the system is not started normally prior, it will turn on the machine just to hibernate. This is commonly used in laptops but works in desktops as well. If hibernation and suspend works in the system, then suspend-then-hibernate will work as well.
The timer is configured here:
/etc/systemd/sleep.conf
[Sleep]
HibernateDelaySec=7200
(will suspend for 2 hours, and then wake up and hibernate)
Request: can you allow choosing via configuration to use suspend-then-hibernate instead of hybrid - and if possible regular suspend (gdm doesn't provide an option for this)
because the version from extensions.gnome.org did not work (knob was shown but without functionality) I upgraded to the version from guthub. After restart: no button, no hibernation-extension in Twek-Tool :-(
After I upgraded to Fedora 32, I get this error :
The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25 OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28 asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13 run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20 main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13 run@resource:///org/gnome/gjs/modules/script/package.js:222:19 start@resource:///org/gnome/gjs/modules/script/package.js:206:5 @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
[beapen@home-fedora ~]$ gnome-shell --version
GNOME Shell 3.36.1
Hibernate button appears in menu but does nothing when clicked after reenabling after disabling.
The error shown in lg is
TypeError:buttonGroup is undefined
System details:
OS: Ubuntu 20.04
Kernel: 5.4.0-26-generic
Gnome shell version: 3.36.1
Technical details:
The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
I use a ThinkPad X1 Extreme with current Ubuntu 19.10. Hibernation works pretty well since I created a swap partition slightly bigger then my amount of RAM (32 GB).
I can now
systemctl hibernate
And the system goes to sleeps and wakes up properly.
But there is no button. I crawled through many tutorials, most suggest the Gnome Extension H[ibernate Status Button][1]. This extension seems to be broken. It's settings looks like on the screenshot and it's automatically deactivated by the system.
So, how to get this button working on 19.10?
OS - Pop!_OS 20.10
GNOME version - 3.38.3
The settings of extension hibernate-status@dromi had an error:
Error: Expected an object of type GtkWidget for argument 'widget' but got type undefined
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
axel.sommerfeldt says that it works fine on GNOME 3.16 after 3.16
was added to metadata.json
. Please update it, I kinda need it. Thanks.
Hi!
I got the following message after updating to Gnome Shell version 3.33.90:
gnome-shell[2532]: JS WARNING: [/srv/home/michael/.local/share/gnome-shell/extensions/hibernate-status@dromi/extension.js 187]: reference to undefined property "_actionsItem"
gnome-shell[2532]: Extension "hibernate-status@dromi" had error: TypeError: this.systemMenu._actionsItem is undefined
CU
Michael
`The settings of extension hibernate-status@dromi had an error:
Error: Expected type object for Argument 'widget' but got type 'undefined'
Stack trace:
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:208:25
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
`
The buttons are not distributed regularly. It looks as if the new button is just "pushed between" these three buttons.
Additionally it would be more useful to have (as the last two right buttons):
The reason for this is easy: As currently the standby button is only shown in the alt mode (as it is GNOME's default) one can easier hibernate than standby. Usually, however, users are more likely to standby than to hibernate and hibernation is rather a rarely used "alternative".
If you decide to implement config options it would of course be useful to have a setting where you can configure the buttons in more details.
redacted
Looking glass reports the following error:
ImportError: No JS module "prefs" found in search path
I'm on Arch Linux with Gnome Shell 3.32.2 and the extension version is 030ccdf. The hibernate button doesn't show up in the status menu.
Any help would be appreciated. Please let me know if further details are needed.
The latest gnome-shell, version 3.34, breaks this great extension. Please let me know if I can help in some way.
Was working very well until I updated to Gnome 3.32. The button is still there, and alt-click will perform the hybrid sleep. However, when clicking the hibernate button regularly, nothing happens. The dialog box does not even pop up
Hi,
i'm using the extension from extensions.gnome.org site (version 4) with gnome-shell 3.12 and the hibernate button doesn't appear. I see in the gnome-session-GNOME.log the following line:
Gjs-Message: JS WARNING: [/home/USERNAME/.local/share/gnome-shell/extensions/hibernate-status@dromi/extension.js 209]: assignment to undeclared variable extension
To my understanding it means that it didn't succeed in creating an object from the Extension class and instantiate it.
thanks
because the version from extensions.gnome.org did not work (knob was shown but without functionality) I upgraded to the version from guthub. After restart: no button, no hibernation-extension in Twek-Tool :-(
My Suse system only had 8GB of Swap available, but 16GB system memory installed. Randomly the system had not bootet up, just got a black screen after hibernation.
Would be nice if your extension could check swap before entering hibernation. I dont know why linux does this check not by itself.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.