unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] Fix XFCE shutdown/reboot via menu.
Date: Wed, 25 Nov 2015 18:46:19 +0100	[thread overview]
Message-ID: <87bnaiht04.fsf@elephly.net> (raw)
In-Reply-To: <87h9kbku6i.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

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’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-xfce-session-Enable-shutdown-reboot-menu-entries.patch --]
[-- Type: text/x-patch, Size: 2127 bytes --]

From dd10a2c30a6ef57b6d0bd9cecb263b731d6e1483 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-services-Add-pkexec-to-setuid-programs.patch --]
[-- Type: text/x-patch, Size: 967 bytes --]

From e3050bed45d11d9dfc500c4f0d1b6132013f6b76 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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-configuration> 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


[-- Attachment #4: Type: text/plain, Size: 386 bytes --]


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

  reply	other threads:[~2015-11-25 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 16:55 [PATCH] Fix XFCE shutdown/reboot via menu Ricardo Wurmus
2015-11-21 20:37 ` Ludovic Courtès
2015-11-21 21:06   ` Ricardo Wurmus
2015-11-24 20:40     ` Ludovic Courtès
2015-11-25 17:46       ` Ricardo Wurmus [this message]
2015-11-28 14:14         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnaiht04.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).