Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons?

2014-08-13 Thread Johannes Geiss
On Tue, 12 Aug 2014 18:33:21 -0500
Canek Peláez Valdés  wrote:

> Assuming you want to disable the functionality for one user, this
> disables both the functionality *AND* the buttons (they show up grayed
> out):
> 
> $ cat /etc/polkit-1/rules.d/10-no-restart-shutdown.rules
> polkit.addRule(function(action, subject) {
> if (subject.user == "myuser") {
> if (action.id.match("org.freedesktop.login1.power-off") ||
> action.id.match("org.freedesktop.login1.reboot")) {
> return polkit.Result.NO;
> }
> }
> });
> 
> Of course, change "myuser" for the user you want to disable this. You
> can also use groups (subject.isInGroup("group")), or use "suspend" or
> "hibernate" instead of "reboot".
> 

That worked. Thank you very much. Now I have disabled (greyed out) the
buttons for certain users. That's what I have looked for.

Bye
Johannes
-- 

 --//--
  //Johannes R. Geiss   Mac mini server and
  \\ //OpenPandora user
 --\X/-



Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons?

2014-08-12 Thread Canek Peláez Valdés
On Mon, Aug 11, 2014 at 5:05 AM, Johannes Geiss  wrote:
> Hello there,
>
> I have XFCE4 and Systemd running and I want to know if it is possible
> to disable or remove the buttons "Restart" and "Shut down" at the
> logout dialog (xfce4-session-logout).
>
> If so, how?

(Sorry I took so long, I was updating my system).

You want to disable only the buttons, or the functionality? For one
user, or several?

Assuming you want to disable the functionality for one user, this
disables both the functionality *AND* the buttons (they show up grayed
out):

$ cat /etc/polkit-1/rules.d/10-no-restart-shutdown.rules
polkit.addRule(function(action, subject) {
if (subject.user == "myuser") {
if (action.id.match("org.freedesktop.login1.power-off") ||
action.id.match("org.freedesktop.login1.reboot")) {
return polkit.Result.NO;
}
}
});

Of course, change "myuser" for the user you want to disable this. You
can also use groups (subject.isInGroup("group")), or use "suspend" or
"hibernate" instead of "reboot".

This works for any desktop that uses systemd (logind, technically) for
session tracking: AFAIK, this should work for at least GNOME, Xfce,
and KDE.

Regards.
-- 
Canek Peláez Valdés
Profesor de asignatura, Facultad de Ciencias
Universidad Nacional Autónoma de México



[gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons?

2014-08-11 Thread Johannes Geiss
Hello there,

I have XFCE4 and Systemd running and I want to know if it is possible
to disable or remove the buttons "Restart" and "Shut down" at the
logout dialog (xfce4-session-logout).

If so, how?

Thanks for any information.

Bye
Johannes
-- 

 --//--
  //Johannes R. Geiss   Mac mini server and
  \\ //OpenPandora user
 --\X/-