Score:0

How to enable the hibernate in the system menu on Ubuntu 21.04

cn flag

no matter what I try to put in the file /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla but I can't get the hibernate items being displayed.

My hibernation works fine if loaded with a sudo systemctl hibernate.

The most recent configuration I added is as follow, though when I reloaded the system before I noticed the file content was wiped out. But here I leave the benefit of the doubt as I'm not sure I did save.

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes

Any advice?

Andrea Moro avatar
cn flag
Am I right that these extension lean on the browser and works with a combination on JavaScript?
br flag
You can download it n install. Yes it's a javascript
Andrea Moro avatar
cn flag
Any other native solution? It seems like a kind of hack
br flag
For putting anything in system menu.. only extensions are the way. If you have your own script then you can add a system menu item and when you click it, it can call your script. I belive nothing wrong with gnome extension hibernate menu. All gnome extensions from that website are checked for any attacks.
Andrea Moro avatar
cn flag
It's not that I'm fearing an attack, rather than it's a browser based solution. I don't understand why is so difficult to have an entry in that menu and why the pkla files are not read as intended
br flag
"Browser baded solution"??? No
br flag
https://extensions.gnome.org/extension/755/hibernate-status-button/
br flag
https://askubuntu.com/q/1260527/739431
Andrea Moro avatar
cn flag
Well, I can see some .js file on the repository, that's why I thought it was a browser based stuff. So I take it as a no, it's an independent piece of tech?
Andrea Moro avatar
cn flag
Ok I got the confusion. It's the extensions that can installed from a website like the snap apps.
br flag
No.. extension is a way of tweaking gnome-shell. No other way to tweak gnome-shell. From the website you download a zip file. From the zip file you can install extension with a command line.
br flag
If you have a script that can do hibernation, I can provide you a sample extension that adds menu item in system menu. When you click that it can call your script. You can put what ever text you want in the menu item.
br flag
https://wiki.gnome.org/Projects/GnomeShell/Extensions#
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.