[PATCH] services: xfce: Add xfce4-power-manager to polkit settings.

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • David Wilson
Owner
unassigned
Submitted by
David Wilson
Severity
normal

Debbugs page

David Wilson wrote 5 years ago
(address . guix-patches@gnu.org)
8465d5c7-af94-4e51-8874-8eab11492f5b@www.fastmail.com
Hi all!

This patch fixes an issue in the XFCE desktop service configuration which causes the polkit action for xfce4-power-manager to not be installed in /etc/polkit-1/actions. The lack of this file causes the user to be prompted for administrator credentials when they attempt to use their laptop's screen brightness keys.

The fix is to use a similar pattern to the GNOME service and add an 'xfce-polkit-settings' procedure which generates the list of XFCE packages that contain polkit actions to install. Now that this list contains 'xfce4-power-manager`, the polkit file 'org.xfce.power.policy' is installed correctly and the screen brightness keys work as intended.

Thanks!

David
Attachment: file
From ab45872546d34b6968d52829e58a3007b898c287 Mon Sep 17 00:00:00 2001
From: David Wilson <david@daviwil.com>
Date: Mon, 14 Oct 2019 20:54:13 -0700
Subject: [PATCH] services: xfce: Add xfce4-power-manager to polkit settings.

* gnu/services/desktop.scm (xfce-desktop-service-type): Add
xfce4-power-manager to polkit-service-type service extension via
new procedure 'xfce-polkit-settings'.
---
gnu/services/desktop.scm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index a32756e040..5a7f8be4bb 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
+;;; Copyright © 2019 David Wilson <david@daviwil.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -907,15 +908,21 @@ and extends polkit with the actions from @code{mate-settings-daemon}."
xfce-desktop-configuration
(xfce xfce-package (default xfce)))
+(define (xfce-polkit-settings config)
+ "Return the list of XFCE dependencies that provide polkit actions and
+rules."
+ (let ((xfce (xfce-package config)))
+ (map (lambda (name)
+ ((package-direct-input-selector name) xfce))
+ '("thunar"
+ "xfce4-power-manager"))))
+
(define xfce-desktop-service-type
(service-type
(name 'xfce-desktop)
(extensions
(list (service-extension polkit-service-type
- (compose list
- (package-direct-input-selector
- "thunar")
- xfce-package))
+ xfce-polkit-settings)
(service-extension profile-service-type
(compose list xfce-package))))
(default-value (xfce-desktop-configuration))
--
2.23.0
Danny Milosavljevic wrote 5 years ago
(name . David Wilson)(address . david@daviwil.com)(address . 37764-done@debbugs.gnu.org)
20191020120823.51b4df2c@scratchpost.org
Thanks! Pushed to guix master as commit 849af4ae1ba6d4d0b3da3d47fc29ce33b532e4da.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl2sMhcACgkQ5xo1VCww
uqULiAf/RM2CwBkU6yzlyBuCnaZiPNiuYlnIkm88pOpDUtcYyfrhWYe9onnFEuvO
5hza5httOV9+F1NjuBy94nW2C4LfYAXYv9a+2Va2ZodRTA0rPxQVwlloewRD+91S
PzhlkQPIYLW52JqydDsHM59qJNtAOopCP+Kv1blKB9aJZvr+u2oRCJr/Y5r35dHV
s6MQhWM9HCSMdhMcrJViWdJsG29St0NC2a0nbASRkO6Q4UMjWZxp0CRd2c41sI5d
vnMDkYXqC2UtYBoqM/WNpOrKOTVEv2MuNLAYH5H0qvA4+35tc5J+3yyK53EeJD4R
CjeAYGBlHUtd0xDlUVjqDygYSP/fgg==
=i0FH
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 37764@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 37764
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help