public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons?
  @ 2014-08-12 23:33 99% ` Canek Peláez Valdés
  0 siblings, 0 replies; 1+ results
From: Canek Peláez Valdés @ 2014-08-12 23:33 UTC (permalink / raw
  To: gentoo-user

On Mon, Aug 11, 2014 at 5:05 AM, Johannes Geiss <johannes.geiss@web.de> 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


^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-08-11 10:05     [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons? Johannes Geiss
2014-08-12 23:33 99% ` Canek Peláez Valdés

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox