Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons?
Date: Tue, 12 Aug 2014 23:33:50
Message-Id: CADPrc83sjPEBFR9P=fiGGtbA3ui6znnGG-MCjNgUvedccF8-Gg@mail.gmail.com
In Reply to: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons? by Johannes Geiss
On Mon, Aug 11, 2014 at 5:05 AM, Johannes Geiss <johannes.geiss@×××.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

Replies

Subject Author
Re: [gentoo-user] XFCE4: How cab I disable Restart and Shut down buttons? Johannes Geiss <johannes.geiss@×××.de>