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

Advice for Ubuntu 24.04 users #122

Open Loping151 opened 2 months ago

Loping151 commented 2 months ago

refer to: https://www.reddit.com/r/Kubuntu/comments/1c2frkd/enabling_hibernation_on_2404/ cat

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.hibernate" ||
        action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
        action.id == "org.freedesktop.upower.hibernate" ||
        action.id == "org.freedesktop.login1.handle-hibernate-key" ||
        action.id == "org.freedesktop.login1.hibernate-ignore-inhibit")
    {
        return polkit.Result.YES;
    }
});

into /etc/polkit-1/rules.d/10-enable-hibernate.rules

I don't quite understand this as I'm just a user. Anyway it really helps to get this extension working.

ViBE-HU commented 1 month ago

I'm a noob too but this will have zero affects if you don't install polkitd-pkla on Ubuntu. And you have to because it is not installed by default. The article is Kubuntu/KDE related. May other Ubuntu flavours contains it but not Ubuntu.

Also the shared script won't enable hibernation in general. It is just a policy kit which is a set of rules and defines the requirements of showing the hibernate option in the system menu. So it won't fix or enable the actually bloody buggy hibernation function. Nowadays Ubuntu use swap file instead of a partition and even with the default parameters it is broken af. Not kidding.

If you want a properly working hibernation under Ubuntu 24.04 read the following article. It is detailed and I can confirm it is properly working atm. May it will become outdated if Canonical finally fix the hibernation related issues. But right now it is accurate.

Morikko commented 1 month ago

After the upgrade on vanilla Ubuntu with GNOME, I had this issue: systemctl hibernate error: "Call to Hibernate failed: Invalid argument" when doing systemctl hibernate.

The solution at comments #9 and 10, echo MAJ:MIN > /sys/power/resume worked for me. Then, hibernation triggered again and the buttons came back.