elementary / default-settings

Default settings for elementary OS
GNU General Public License v3.0
39 stars 28 forks source link

Allow user to access DBus Hibernation method #162

Closed hotsezus closed 3 years ago

hotsezus commented 4 years ago

This PR adds polkit rule to let user see and use hibernation and hybrid sleep buttons from here wingpanel-indicator-session

Based on https://www.freedesktop.org/software/polkit/docs/0.105/pklocalauthority.8.html (yes, old polkit version), we can manipulate user permissions to DBus methods via .plka files placed in /etc/polkit-1/localauthority/10-vendor.d directory. Also, there is a package that solves the same problem, so we can refer to it https://packages.ubuntu.com/bionic/policykit-desktop-privileges

Feature is coming with:

  1. https://github.com/elementary/switchboard-plug-power/pull/171
  2. https://github.com/elementary/wingpanel-indicator-session/pull/102
worldofpeace commented 4 years ago

Isn't this the ancient way to do polkit rules?

hotsezus commented 4 years ago

@worldofpeace yes, it's a little bit deprecated. But it seems like methods described in documentation of newer polkit versions are not working. If anyone can suggest a better solution, i'd really like to hear it. This was just the best method for me

hotsezus commented 4 years ago

Our polkit verion is 0.105 based on

$ pkaction --version

output

pkaction version 0.105

so link to documentation mentioned in my first comment is relevant. Also as some kind of reference we can use this post on askubuntu.com

hotsezus commented 4 years ago

@danrabbit @cassidyjames don't know who and what exactly should do to make this pass to master but i'd like to hear your comments on this hibernation feature

cassidyjames commented 3 years ago

Copypasted from https://github.com/elementary/wingpanel-indicator-session/pull/102#issuecomment-783576608 for context:

So I believe Hibernate was disabled in Ubuntu was because it does not work with Secure Boot and the kernel's Lockdown mode. Since we want to support secure boot and don't necessarily want differing experiences on devices with and without secure boot, I don't know that we want to pursue re-enabling hibernation downstream from Ubuntu, until that can be resolved—which is being worked on, but not yet complete.

See this blog post from Matthew Garrett for more info: https://mjg59.dreamwidth.org/55845.html