Results 1 to 4 of 4

Thread: Removing suspend/hibernate from KDE menu

  1. #1

    Default Removing suspend/hibernate from KDE menu

    I'm using OpenSuse 13.1 with KDE and have been trying to remove the suspend & hibernate options from the KDE menu. What I've tried so far:
    • PolicyKit files in /usr/share/polkit-1/actions (changing allow_active for all permissions related to suspend/hibernate to "no")
    • Adding related policies (e.g. org.freedesktop.login1.suspend) to /etc/polkit-defaults-privs.local
    • Replacing pm-is-supported with a script that does just "exit 1"


    Despite doing this the options are still there and I can still suspend the system as a regular user.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,363
    Blog Entries
    3

    Default Re: Removing suspend/hibernate from KDE menu

    I'm not sure why you think it matters.

    I am managing to never hibernate or suspend. I simply avoid using those menu items.
    openSUSE Leap 15.1; KDE Plasma 5;

  3. #3

    Default Re: Removing suspend/hibernate from KDE menu

    Quote Originally Posted by draeklae View Post
    IPolicyKit files in /usr/share/polkit-1/actions (changing allow_active for all permissions related to suspend/hibernate to "no")
    Do _not_ edit the files in /usr/share/polkit-1/actions!
    Most changes have no effect anyway, and your changes are lost when installing updates.

    Adding related policies (e.g. org.freedesktop.login1.suspend) to /etc/polkit-defaults-privs.local
    Set "org.freedesktop.login1.suspend-multiple-sessions" to no as well there.

    And you have to run "set_polkit_default_privs" afterwards to create the actual polkit rules files.

    These lines in /etc/polkit-defaults-privs.local make the "Suspend" entry disappear in the KDE menu here and also prohibit "systemctl suspend":
    Code:
    org.freedesktop.upower.suspend no
    org.freedesktop.login1.suspend no
    org.freedesktop.login1.suspend-multiple-sessions no
    I'm not sure what uses upower, but better add it as well if you want to get rid of suspend completely.

    For hibernate it should be similar.

    Replacing pm-is-supported with a script that does just "exit 1"
    pm-utils are obsolete and not even available in Factory anymore.
    Nowadays systemd-logind takes care of suspend/hibernate. It does use pm-utils though if it is installed.

    And KDE doesn't call a script to check whether suspend/hibernate is available, but asks logind via DBUS.
    Last edited by wolfi323; 18-Jul-2014 at 09:31.

  4. #4

    Wink Re: Removing suspend/hibernate from KDE menu

    Quote Originally Posted by wolfi323 View Post
    Do _not_ edit the files in /usr/share/polkit-1/actions! Most changes have no effect anyway, and your changes are lost when installing updates. Set "org.freedesktop.login1.suspend-multiple-sessions" to no as well there. And you have to run "set_polkit_default_privs" afterwards to create the actual polkit rules files. These lines in /etc/polkit-defaults-privs.local make the "Suspend" entry disappear in the KDE menu here and also prohibit "systemctl suspend":
    Code:
    org.freedesktop.upower.suspend no org.freedesktop.login1.suspend no org.freedesktop.login1.suspend-multiple-sessions no
    I'm not sure what uses upower, but better add it as well if you want to get rid of suspend completely. For hibernate it should be similar. pm-utils are obsolete and not even available in Factory anymore. Nowadays systemd-logind takes care of suspend/hibernate. It does use pm-utils though if it is installed. And KDE doesn't call a script to check whether suspend/hibernate is available, but asks logind via DBUS.
    Works like a charm! Thanks so much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •