From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] Fix XFCE shutdown/reboot via menu. Date: Wed, 25 Nov 2015 18:46:19 +0100 Message-ID: <87bnaiht04.fsf@elephly.net> References: <87vb8vqolg.fsf@elephly.net> <87fuzz5bs5.fsf@gnu.org> <87si3zqcy5.fsf@elephly.net> <87h9kbku6i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1e9M-0003AS-3O for guix-devel@gnu.org; Wed, 25 Nov 2015 12:46:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1e9K-00077Y-Sj for guix-devel@gnu.org; Wed, 25 Nov 2015 12:46:36 -0500 In-reply-to: <87h9kbku6i.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Here are two new patches. The first adds missing inputs to xfce-session and replaces the paths to the shutdown, pm-suspend, and pm-hibernate commands with the plain names. The second simply adds pkexec to the list of setuid programmes via ‘polkit-setuid-programs’. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-xfce-session-Enable-shutdown-reboot-menu-entries.patch >From dd10a2c30a6ef57b6d0bd9cecb263b731d6e1483 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 21 Nov 2015 17:47:00 +0100 Subject: [PATCH 1/2] gnu: xfce-session: Enable shutdown/reboot menu entries. * gnu/packages/xfce.scm (xfce-session)[inputs]: Add upower and polkit. [source]: Replace paths to "shutdown" with "halt" and "restart". --- gnu/packages/xfce.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm index a4987c1..e213fb6 100644 --- a/gnu/packages/xfce.scm +++ b/gnu/packages/xfce.scm @@ -35,6 +35,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages gnome) #:use-module (gnu packages pdf) + #:use-module (gnu packages polkit) #:use-module (gnu packages gstreamer) #:use-module (gnu packages linux) #:use-module (gnu packages photo) @@ -426,7 +427,16 @@ your system in categories, so you can quickly find and launch them.") "01kvbd09c06j20n155hracsgrq06rlmfgdywffjsvlwpn19m9j38")) (patches ;; See: https://bugzilla.xfce.org/show_bug.cgi?id=12282 - (list (search-patch "xfce4-session-fix-xflock4.patch"))))) + (list (search-patch "xfce4-session-fix-xflock4.patch"))) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "xfsm-shutdown-helper/main.c" + (("/sbin/shutdown -h now") "halt") + (("/sbin/shutdown -r now") "restart") + (("/usr/sbin/pm-suspend") "pm-suspend") + (("/usr/sbin/pm-hibernate") "pm-hibernate")) + #t)))) (build-system gnu-build-system) (arguments '(#:configure-flags @@ -436,6 +446,8 @@ your system in categories, so you can quickly find and launch them.") ("intltool" ,intltool))) (inputs `(("iceauth" ,iceauth) + ("upower" ,upower) + ("polkit" ,polkit) ("libsm" ,libsm) ("libwnck" ,libwnck-1) ("libxfce4ui" ,libxfce4ui))) -- 2.5.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-services-Add-pkexec-to-setuid-programs.patch >From e3050bed45d11d9dfc500c4f0d1b6132013f6b76 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 21 Nov 2015 22:40:22 +0100 Subject: [PATCH 2/2] services: Add pkexec to setuid programs. * gnu/services/desktop.scm (polkit-setuid-programs): Add pkexec to list of setuid programs. --- gnu/services/desktop.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 0b4ed56..694a8ed 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -381,7 +381,8 @@ site} for more information." (match-lambda (($ polkit) (list #~(string-append #$polkit - "/lib/polkit-1/polkit-agent-helper-1"))))) + "/lib/polkit-1/polkit-agent-helper-1") + #~(string-append #$polkit "/bin/pkexec"))))) (define polkit-service-type (service-type (name 'polkit) -- 2.5.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit While these patches enable the “Suspend”, “Shut Down”, and “Restart” fields of the account actions widget, they don’t actually cause the computer to suspend, shut down, or reboot. The X session is terminated, but we end up at the SLIM login screen again. I’ll try to investigate some more, but I don’t think there’s anything wrong with these patches. ~~ Ricardo --=-=-=--