1 |
On Mon, Aug 11, 2014 at 5:05 AM, Johannes Geiss <johannes.geiss@×××.de> wrote: |
2 |
> Hello there, |
3 |
> |
4 |
> I have XFCE4 and Systemd running and I want to know if it is possible |
5 |
> to disable or remove the buttons "Restart" and "Shut down" at the |
6 |
> logout dialog (xfce4-session-logout). |
7 |
> |
8 |
> If so, how? |
9 |
|
10 |
(Sorry I took so long, I was updating my system). |
11 |
|
12 |
You want to disable only the buttons, or the functionality? For one |
13 |
user, or several? |
14 |
|
15 |
Assuming you want to disable the functionality for one user, this |
16 |
disables both the functionality *AND* the buttons (they show up grayed |
17 |
out): |
18 |
|
19 |
$ cat /etc/polkit-1/rules.d/10-no-restart-shutdown.rules |
20 |
polkit.addRule(function(action, subject) { |
21 |
if (subject.user == "myuser") { |
22 |
if (action.id.match("org.freedesktop.login1.power-off") || |
23 |
action.id.match("org.freedesktop.login1.reboot")) { |
24 |
return polkit.Result.NO; |
25 |
} |
26 |
} |
27 |
}); |
28 |
|
29 |
Of course, change "myuser" for the user you want to disable this. You |
30 |
can also use groups (subject.isInGroup("group")), or use "suspend" or |
31 |
"hibernate" instead of "reboot". |
32 |
|
33 |
This works for any desktop that uses systemd (logind, technically) for |
34 |
session tracking: AFAIK, this should work for at least GNOME, Xfce, |
35 |
and KDE. |
36 |
|
37 |
Regards. |
38 |
-- |
39 |
Canek Peláez Valdés |
40 |
Profesor de asignatura, Facultad de Ciencias |
41 |
Universidad Nacional Autónoma de México |