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
155 stars 56 forks source link

Hibernate button doesn't work on ArchLinux (& suggest fix) #18

Closed Clockris closed 6 years ago

Clockris commented 6 years ago

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.

p91paul commented 6 years ago

what about the "systemctl hibernate" command? does it work for you? does it require a password?

rypz79 commented 6 years ago

I have a similar problem with Ubuntu 18.04 under GNOME 3.28.2

sudo systemctl hibernate doesn't resume from hibernation it comes back to the login screen to start a new session.

sudo s2disk & sudo pm-hibernate works like a charm it takes a snapshot compresses it , hibernates and resumes the session without going through the login screen. It uses the uswsusp module instead of the default systemctl. The problem is that the extension is bind to the systemctl and I can't make it work (tried numerous askubuntu threads).

Both ways doesn't require a password (swap partition is not encrypted) but both resume through GRUB (dual-boot system).

Is there a way to bind this extension with either of the commands above ? is there a way to bind it to a shortcut key (e.g. H) ?

Thanks

p91paul commented 6 years ago

The problem with all those commands is sudo: I don't want the extension to require inserting a password to hibernate. systemctl hibernate works without sudo on my system: I don't think the same applies to s2disk and pm-hibernate. This extension does not use systemctl directly, but I suspect it goes through systemd somehow.

As for the shortcut I suggest you bind a key to a custom command through system settings (can you still do that in latest gnome? I hope so), no need to go through the extension.

p91paul commented 6 years ago

I could add an option to let the user choose a custom hibernate command however.

rypz79 commented 6 years ago

@p91paul I think solved it. look here.

And yes there is an option in gnome-control-center to assign a custom shortcut for hibernation as explained here

TNX

p91paul commented 6 years ago

is it working only systemctl hibernate or also this extension now?

rypz79 commented 6 years ago

Of course also with the extension. Otherwise I wouldn't had the motivation to fix the systemctl call. I had hibernation working with uswsusp.

p91paul commented 6 years ago

Ok wonderful. I'll add the link to the extension homepage.