Removing Sleep and hibernate options from Leave menu

Roderick Johnstone rmj at ast.cam.ac.uk
Tue Apr 5 16:15:54 UTC 2011


On 05/04/11 14:38, Kevin Kofler wrote:
> Roderick Johnstone wrote:
>> I used to be able to remove the Sleep and Hibernate options from the kde
>> Leave menu, systemwide, by having pm-is-supported do an "exit 1".
>>
>> However, after the kde 4.6.1 update this no longer stops the Sleep and
>> Hibernate items appearing. How would I remove these items systemwide  now?
> 
> You have to deny the org.freedesktop.upower.suspend and 
> org.freedesktop.upower.hibernate PolicyKit policies to your users.

Thanks, but I think I need a little more info, on the right way to do
this...

After reading some of the policykit docs and man pklocalauthority and a
few web pages I tried adding a file 10-xray.pkla with contents:

[Disable hibernate/suspend for all users]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend;org.freedesktop.upower.hibernate
ResultActive=no
ResultInactive=no
ResultAny=no

into /etc/polkit-1/localauthority/30-site.d, but that doesnt seem to
disable the hibernate/suspend buttons.

I also tried editting
/usr/share/polkit-1/actions/org.freedesktop.upower.policy and replacing

<allow_active>yes</allow_active>
with
<allow_active>no</allow_active>
in the <action id="org.freedesktop.upower.suspend">
section, but that doesnt work either.

Can you advise on the correct way to deny these policies to my users please?

Roderick




More information about the kde mailing list