Gentoo Archives: gentoo-user

From: Johannes Geiss <johannes.geiss@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons?
Date: Wed, 13 Aug 2014 12:04:12
Message-Id: 20140813140347.14aaf1ad@mizar.aichberg.homenet.org
In Reply to: Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons? by "Canek Peláez Valdés"
1 On Tue, 12 Aug 2014 18:33:21 -0500
2 Canek Peláez Valdés <caneko@×××××.com> wrote:
3
4 > Assuming you want to disable the functionality for one user, this
5 > disables both the functionality *AND* the buttons (they show up grayed
6 > out):
7 >
8 > $ cat /etc/polkit-1/rules.d/10-no-restart-shutdown.rules
9 > polkit.addRule(function(action, subject) {
10 > if (subject.user == "myuser") {
11 > if (action.id.match("org.freedesktop.login1.power-off") ||
12 > action.id.match("org.freedesktop.login1.reboot")) {
13 > return polkit.Result.NO;
14 > }
15 > }
16 > });
17 >
18 > Of course, change "myuser" for the user you want to disable this. You
19 > can also use groups (subject.isInGroup("group")), or use "suspend" or
20 > "hibernate" instead of "reboot".
21 >
22
23 That worked. Thank you very much. Now I have disabled (greyed out) the
24 buttons for certain users. That's what I have looked for.
25
26 Bye
27 Johannes
28 --
29
30 ------//--------------------------------------------------------------
31 // Johannes R. Geiss Mac mini server and
32 \\ // OpenPandora user
33 --\X/-----------------------------------------------------------------