unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#47870] [PATCH 0/2] Autostart polkit-gnome in XFCE
@ 2021-04-18 13:13 Brendan Tildesley via Guix-patches via
  2021-04-18 13:17 ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Brendan Tildesley
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley via Guix-patches via @ 2021-04-18 13:13 UTC (permalink / raw)
  To: 47870

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

I noticed I couldn't edit NetworkManager settings in XFCE, and it turns it
there is no polkit authentication agent running. Every desktop seems to
have their own one, and XFCE seems to use polkit-gnome. Since it was 
abandoned by GNOME it isn't used for anything else. So I setup an autostart
desktop file just like how mate-polkit has one.
It feels a bit odd configuring the package with an embedded desktop file
just for XFCE. Perhaps it would be better to put it in a separate "xfce-autostart"
output or just put it into the xfce package instead of the polkit-gnome package.

What do you think?

[-- Attachment #2: Type: text/html, Size: 1264 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-18 13:13 [bug#47870] [PATCH 0/2] Autostart polkit-gnome in XFCE Brendan Tildesley via Guix-patches via
@ 2021-04-18 13:17 ` Brendan Tildesley
  2021-04-18 13:17   ` [bug#47870] [PATCH 2/2] gnu: xfce: Start polkit-gnome agent on login Brendan Tildesley
  2021-04-18 14:47   ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Leo Prikler
  0 siblings, 2 replies; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-18 13:17 UTC (permalink / raw)
  To: 47870

* gnu/packages/polkit.scm (polkit-gnome):
[inputs]: Source a translated .desktop file from Arch Linux.
[arguments]: Install the .desktop file into /etc/autostart and set
OnlyShowIn to XFCE so it will be autostarted only by XFCE.
[description]: Add a note clarifying that this package is currently only
used for XFCE, not GNOME.
---
 gnu/packages/polkit.scm | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm
index d868aceec2..1c5173921c 100644
--- a/gnu/packages/polkit.scm
+++ b/gnu/packages/polkit.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -183,12 +184,42 @@ easily with PolicyKit.")
                 "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p"))))
     (build-system gnu-build-system)
     (inputs `(("gtk+" ,gtk+)
-              ("polkit" ,polkit)))
+              ("polkit" ,polkit)
+              ("desktop-file"
+               ,(origin
+                  (method url-fetch)
+                  (uri
+                   (string-append
+                    "https://raw.githubusercontent.com/archlinux/svntogit-community/"
+                    "8963650797cfe0383ef510e9c0492b2cb22a2593/repos/community-x86_64/"
+                    "polkit-gnome-authentication-agent-1.desktop"))
+                  (sha256
+                   (base32
+                    "1rqy8jf01idaqnyrzjaapr7pzx8zg2x9kmw70n1p9cpalhiwfx2h"))))))
     (native-inputs `(("intltool"   ,intltool)
                      ("pkg-config" ,pkg-config)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-autostart-file
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (autostart-dir (string-append out "/etc/xdg/autostart"))
+                    (desktop (string-append
+                              autostart-dir
+                              "/polkit-gnome-authentication-agent-1.desktop")))
+               (mkdir-p autostart-dir)
+               (copy-file (assoc-ref inputs "desktop-file") desktop)
+               (substitute* desktop
+                 (("^Exec=.*")
+                  (string-append
+                   "Exec=" out "/libexec/polkit-gnome-authentication-agent-1\n"))
+                 ;; This will mean the agent will only be started in XFCE.
+                 (("^OnlyShowIn=.*") "OnlyShowIn=XFCE;\n"))))))))
     (synopsis "Legacy polkit authentication agent for GNOME")
-    (description "PolicyKit-gnome provides a D-Bus session bus service
-that is used to bring up authentication dialogs used for obtaining
-privileges.")
+    (description "PolicyKit-gnome provides a D-Bus session bus service that
+is used to bring up authentication dialogs used for obtaining privileges.
+PolicyKit-gnome is no longer used in GNOME but has become the default agent
+for XFCE.")
     (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
     (license lgpl2.0+)))
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 2/2] gnu: xfce: Start polkit-gnome agent on login.
  2021-04-18 13:17 ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Brendan Tildesley
@ 2021-04-18 13:17   ` Brendan Tildesley
  2021-04-18 14:47   ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Leo Prikler
  1 sibling, 0 replies; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-18 13:17 UTC (permalink / raw)
  To: 47870

 * gnu/packages/xfce.scm (xfce): Add polkit-gnome to the union package
 so that /polkit-gnome-authentication-agent-1 will be started on
 login. This fixes users not being able to edit NetworkManager settings
 due to there not being any polkit authentication agent running.
---
 gnu/packages/xfce.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index ffac62af9e..fd8a2f12c5 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -974,6 +974,7 @@ on your desktop.")
        ("gtk-xfce-engine"      ,gtk-xfce-engine)
        ("hicolor-icon-theme"   ,hicolor-icon-theme)
        ("ristretto"            ,ristretto)
+       ("polkit-gnome"         ,polkit-gnome)
        ("shared-mime-info"     ,shared-mime-info)
        ("thunar"               ,thunar)
        ("thunar-volman"        ,thunar-volman)
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-18 13:17 ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Brendan Tildesley
  2021-04-18 13:17   ` [bug#47870] [PATCH 2/2] gnu: xfce: Start polkit-gnome agent on login Brendan Tildesley
@ 2021-04-18 14:47   ` Leo Prikler
  2021-04-18 15:15     ` Brendan Tildesley
  1 sibling, 1 reply; 16+ messages in thread
From: Leo Prikler @ 2021-04-18 14:47 UTC (permalink / raw)
  To: Brendan Tildesley, 47870

Hi Brendan,

Am Sonntag, den 18.04.2021, 23:17 +1000 schrieb Brendan Tildesley:
> * gnu/packages/polkit.scm (polkit-gnome):
> [inputs]: Source a translated .desktop file from Arch Linux.
> [arguments]: Install the .desktop file into /etc/autostart and set
> OnlyShowIn to XFCE so it will be autostarted only by XFCE.
> [description]: Add a note clarifying that this package is currently
> only
> used for XFCE, not GNOME.
> ---
>  gnu/packages/polkit.scm | 39 +++++++++++++++++++++++++++++++++++----
>  1 file changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm
> index d868aceec2..1c5173921c 100644
> --- a/gnu/packages/polkit.scm
> +++ b/gnu/packages/polkit.scm
> @@ -6,6 +6,7 @@
>  ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
> +;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -183,12 +184,42 @@ easily with PolicyKit.")
>                  "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10
> p"))))
>      (build-system gnu-build-system)
>      (inputs `(("gtk+" ,gtk+)
> -              ("polkit" ,polkit)))
> +              ("polkit" ,polkit)
> +              ("desktop-file"
> +               ,(origin
> +                  (method url-fetch)
> +                  (uri
> +                   (string-append
> +                    "
> https://raw.githubusercontent.com/archlinux/svntogit-community/"
> +                    "8963650797cfe0383ef510e9c0492b2cb22a2593/repos/
> community-x86_64/"
> +                    "polkit-gnome-authentication-agent-1.desktop"))
> +                  (sha256
> +                   (base32
> +                    "1rqy8jf01idaqnyrzjaapr7pzx8zg2x9kmw70n1p9cpalhi
> wfx2h"))))))
Instead of sourcing the desktop file from a really obscure location,
would it be possible to express this in terms of `make-desktop-entry-
file'?  This also has the added advantage, that it could be inlined
into the phase.
>      (native-inputs `(("intltool"   ,intltool)
>                       ("pkg-config" ,pkg-config)))
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'install-autostart-file
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (autostart-dir (string-append out
> "/etc/xdg/autostart"))
> +                    (desktop (string-append
> +                              autostart-dir
> +                              "/polkit-gnome-authentication-agent-
> 1.desktop")))
> +               (mkdir-p autostart-dir)
> +               (copy-file (assoc-ref inputs "desktop-file") desktop)
> +               (substitute* desktop
> +                 (("^Exec=.*")
> +                  (string-append
> +                   "Exec=" out "/libexec/polkit-gnome-
> authentication-agent-1\n"))
> +                 ;; This will mean the agent will only be started in
> XFCE.
> +                 (("^OnlyShowIn=.*") "OnlyShowIn=XFCE;\n"))))))))
See above.
>      (synopsis "Legacy polkit authentication agent for GNOME")
> -    (description "PolicyKit-gnome provides a D-Bus session bus
> service
> -that is used to bring up authentication dialogs used for obtaining
> -privileges.")
> +    (description "PolicyKit-gnome provides a D-Bus session bus
> service that
> +is used to bring up authentication dialogs used for obtaining
> privileges.
> +PolicyKit-gnome is no longer used in GNOME but has become the
> default agent
> +for XFCE.")
Is that so?  Even if this holds for GNOME 40, it's not true for Guix'
GNOME until wip-gnome is merged, or does 3.34 already use something
else?
>      (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
>      (license lgpl2.0+)))

Regards,
Leo





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-18 14:47   ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Leo Prikler
@ 2021-04-18 15:15     ` Brendan Tildesley
  2021-04-18 15:52       ` Leo Prikler
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-18 15:15 UTC (permalink / raw)
  To: 47870; +Cc: Leo Prikler


> On 04/18/2021 4:47 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> 
>  
> Hi Brendan,
> 
[...]
> Instead of sourcing the desktop file from a really obscure location,
> would it be possible to express this in terms of `make-desktop-entry-
> file'?  This also has the added advantage, that it could be inlined
> into the phase.

I did this because the file has many translations, so it would be a lot
of lines: https://raw.githubusercontent.com/archlinux/svntogit-community/packages/polkit-gnome/trunk/polkit-gnome-authentication-agent-1.desktop
I was just trying to source it so translations weren't duplicated.

[...]
> > +PolicyKit-gnome is no longer used in GNOME but has become the
> > default agent
> > +for XFCE.")
> Is that so?  Even if this holds for GNOME 40, it's not true for Guix'
> GNOME until wip-gnome is merged, or does 3.34 already use something
> else?
It's much older than that. I think it was used for Gnome 2 and long since 
discarded. The release is years old and the repo untouched for 3 years.

On second thought perhaps another option is just to use the MATE polkit
agent instead? I tested it for changing network manager and it worked
just the same, only the GUI looks slightly different. I was searching
 What do you think?




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-18 15:15     ` Brendan Tildesley
@ 2021-04-18 15:52       ` Leo Prikler
  2021-04-19  6:56         ` Brendan Tildesley
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Prikler @ 2021-04-18 15:52 UTC (permalink / raw)
  To: Brendan Tildesley, 47870

Hi,

Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > On 04/18/2021 4:47 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > wrote:
> > 
> >  
> > Hi Brendan,
> > 
> [...]
> > Instead of sourcing the desktop file from a really obscure
> > location,
> > would it be possible to express this in terms of `make-desktop-
> > entry-
> > file'?  This also has the added advantage, that it could be inlined
> > into the phase.
> 
> I did this because the file has many translations, so it would be a
> lot
> of lines: 
> https://raw.githubusercontent.com/archlinux/svntogit-community/packages/polkit-gnome/trunk/polkit-gnome-authentication-agent-1.desktop
> I was just trying to source it so translations weren't duplicated.
> 
> [...]
I still think we'd prefer to keep our own copy.  If not as code, then
perhaps as aux-file?

> > > +PolicyKit-gnome is no longer used in GNOME but has become the
> > > default agent
> > > +for XFCE.")
> > Is that so?  Even if this holds for GNOME 40, it's not true for
> > Guix'
> > GNOME until wip-gnome is merged, or does 3.34 already use something
> > else?
> It's much older than that. I think it was used for Gnome 2 and long
> since 
> discarded. The release is years old and the repo untouched for 3
> years.
Ah, thanks for clearing that up.
> On second thought perhaps another option is just to use the MATE
> polkit
> agent instead? I tested it for changing network manager and it worked
> just the same, only the GUI looks slightly different. I was searching
>  What do you think?
If it works for XFCE, why not?  Given that polkit-gnome has no
dependents other than itself, should we perhaps also look into removing
it?

Regards,
Leo





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-18 15:52       ` Leo Prikler
@ 2021-04-19  6:56         ` Brendan Tildesley
  2021-04-19  7:36           ` Leo Prikler
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-19  6:56 UTC (permalink / raw)
  To: 47870; +Cc: Leo Prikler

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


> On 04/18/2021 5:52 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> 
>  
> Hi,
> 
> Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > > On 04/18/2021 4:47 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > > wrote:
[...]
> > On second thought perhaps another option is just to use the MATE
> > polkit
> > agent instead? I tested it for changing network manager and it worked
> > just the same, only the GUI looks slightly different. I was searching
> >  What do you think?
> If it works for XFCE, why not?  Given that polkit-gnome has no
> dependents other than itself, should we perhaps also look into removing
> it?
> 
One issue is that mate-polkit's .desktop file has the line OnlyShowIn=MATE;
This prevents it from being launched in any other desktop. When multiple 
desktops are installed all these files sit in /run/current-desktop/profile/etc/
and rely these lines to make them not appear in other desktops.

I made a couple patches [attached] that adds XFCE to the the .desktop's OnlyShowIn.
It's a little ugly though. 
> Regards,
> Leo

[-- Attachment #2: 0002-gnu-xfce-Start-mate-polkit-agent-on-login.patch --]
[-- Type: text/x-patch, Size: 1317 bytes --]

From 835d0748ca4c0738d777aed8f895622759ea4f8d Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 16:45:15 +1000
Subject: [PATCH 2/2] gnu: xfce: Start mate-polkit agent on login.

* gnu/packages/xfce.scm (xfce): Add mate-polkit to the xfce union
package. This will cause the authentication agent to be run on login.
This fixes users in XFCE not being able to edit NetworkManager settings.
---
 gnu/packages/xfce.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 38240d7b9f..786a8cf243 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages inkscape)
   #:use-module (gnu packages libcanberra)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages mate)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages photo)
@@ -971,6 +972,7 @@ on your desktop.")
        ("gnome-icon-theme"     ,gnome-icon-theme)
        ("gtk-xfce-engine"      ,gtk-xfce-engine)
        ("hicolor-icon-theme"   ,hicolor-icon-theme)
+       ("mate-polkit"          ,mate-polkit)
        ("ristretto"            ,ristretto)
        ("shared-mime-info"     ,shared-mime-info)
        ("thunar"               ,thunar)
-- 
2.31.1


[-- Attachment #3: 0001-gnu-polkit-mate-Enable-autostarting-in-XFCE.patch --]
[-- Type: text/x-patch, Size: 1949 bytes --]

From ef20e6422cea8089a4ecf2e7b0293c27bc71a56b Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 16:37:55 +1000
Subject: [PATCH 1/2] gnu: polkit-mate: Enable autostarting in XFCE.

* gnu/packages/mate.scm (polkit-mate): Add XFCE to the OnlyShowIn field
of the autostart .desktop file so it will be started by XFCE too. This
is for the same of making polkit-mate the de facto agent for XFCE in
Guix, since XFCE does not have it's own official one.

One downside of this is that since all these .desktop files end up in
/run/current-system/profile/etc/, if a user for some reasons wants to have
MATE installed, plus an XFCE that doesn't include mate-polkit, this cause
XFCE to start it anyway. Not sure if that is a big deal.
---
 gnu/packages/mate.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/mate.scm b/gnu/packages/mate.scm
index 44420147a3..1a8a268cc9 100644
--- a/gnu/packages/mate.scm
+++ b/gnu/packages/mate.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
 ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1511,6 +1512,14 @@ MATE Desktop to monitor your system resources and usage.")
        ("gtk+" ,gtk+)
        ("gdk-pixbuf" ,gdk-pixbuf)
        ("polkit" ,polkit)))
+    ;; This will allow mate-polkit to be used with XFCE too.
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-desktop-for-xfce
+           (lambda _
+             (substitute* "src/polkit-mate-authentication-agent-1.desktop.in.in"
+                 (("MATE;") "MATE;XFCE;")))))))
     (home-page "https://mate-desktop.org/")
     (synopsis "DBus specific service for MATE")
     (description
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19  6:56         ` Brendan Tildesley
@ 2021-04-19  7:36           ` Leo Prikler
  2021-04-19 11:02             ` Brendan Tildesley
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Prikler @ 2021-04-19  7:36 UTC (permalink / raw)
  To: Brendan Tildesley, 47870

Hi Brendan,

Am Montag, den 19.04.2021, 08:56 +0200 schrieb Brendan Tildesley:
> > On 04/18/2021 5:52 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > wrote:
> > 
> >  
> > Hi,
> > 
> > Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > > > On 04/18/2021 4:47 PM Leo Prikler <
> > > > leo.prikler@student.tugraz.at>
> > > > wrote:
> [...]
> > > On second thought perhaps another option is just to use the MATE
> > > polkit
> > > agent instead? I tested it for changing network manager and it
> > > worked
> > > just the same, only the GUI looks slightly different. I was
> > > searching
> > >  What do you think?
> > If it works for XFCE, why not?  Given that polkit-gnome has no
> > dependents other than itself, should we perhaps also look into
> > removing
> > it?
> > 
> One issue is that mate-polkit's .desktop file has the line
> OnlyShowIn=MATE;
> This prevents it from being launched in any other desktop. When
> multiple 
> desktops are installed all these files sit in /run/current-
> desktop/profile/etc/
> and rely these lines to make them not appear in other desktops.
> 
> I made a couple patches [attached] that adds XFCE to the the
> .desktop's OnlyShowIn.
> It's a little ugly though. 
This may potentially be bikeshedding, but what about defining a
(potentially hidden) package, that inherits from mate-polkit (call it
mate-polkit-for-xfce) and installs a .desktop file, that replaces MATE
with XFCE?  Ah, well, you'd also have to move the desktop file to a
different location for there not to be a name clash.

Other than that, the contents of your patches LGTM, but the ChangeLog
is on a pretty verbose end.  For instance, the message for 0001 should
likely be rewritten as:

----
gnu: polkit-mate: Enable autostarting in XFCE.

Add XFCE to the OnlyShowIn field of the autostart .desktop file so it
will be started by XFCE as well.  This is for the same of making
polkit-mate the de facto polkit agent for XFCE in Guix, since XFCE does
not ship its own.

A potential downside might be, that this desktop file ends up in the
current system profile and can therefore be seen in XFCE
configurations, that did not ask for it.

* gnu/packages/mate.scm (polkit-mate)[#:phases]: Add 'patch-desktop-
for-xfce'.
----

You could also write significantly shorter commit messages, since
"Enable autostarting in XFCE" already tells you everything the patch
does.

Regards, Leo





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19  7:36           ` Leo Prikler
@ 2021-04-19 11:02             ` Brendan Tildesley
  2021-04-19 11:12               ` Leo Prikler
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-19 11:02 UTC (permalink / raw)
  To: 47870; +Cc: Leo Prikler

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


> On 04/19/2021 9:36 AM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> 
>  
> Hi Brendan,
> 
> Am Montag, den 19.04.2021, 08:56 +0200 schrieb Brendan Tildesley:
> > > On 04/18/2021 5:52 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > > wrote:
> > > 
> > >  
> > > Hi,
> > > 
> > > Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > > > > On 04/18/2021 4:47 PM Leo Prikler <
> > > > > leo.prikler@student.tugraz.at>
> > > > > wrote:
> > [...]
> > > > On second thought perhaps another option is just to use the MATE
> > > > polkit
> > > > agent instead? I tested it for changing network manager and it
> > > > worked
> > > > just the same, only the GUI looks slightly different. I was
> > > > searching
> > > >  What do you think?
> > > If it works for XFCE, why not?  Given that polkit-gnome has no
> > > dependents other than itself, should we perhaps also look into
> > > removing
> > > it?
> > > 
> > One issue is that mate-polkit's .desktop file has the line
> > OnlyShowIn=MATE;
> > This prevents it from being launched in any other desktop. When
> > multiple 
> > desktops are installed all these files sit in /run/current-
> > desktop/profile/etc/
> > and rely these lines to make them not appear in other desktops.
> > 
> > I made a couple patches [attached] that adds XFCE to the the
> > .desktop's OnlyShowIn.
> > It's a little ugly though. 
> This may potentially be bikeshedding, but what about defining a
> (potentially hidden) package, that inherits from mate-polkit (call it
> mate-polkit-for-xfce) and installs a .desktop file, that replaces MATE
> with XFCE?  Ah, well, you'd also have to move the desktop file to a
> different location for there not to be a name clash.
> 

I think it's good to think about. This way makes it more self contained.

> Other than that, the contents of your patches LGTM, but the ChangeLog
> is on a pretty verbose end.  For instance, the message for 0001 should
> likely be rewritten as:
> 
> ----
> gnu: polkit-mate: Enable autostarting in XFCE.
> 
> Add XFCE to the OnlyShowIn field of the autostart .desktop file so it
> will be started by XFCE as well.  This is for the same of making
> polkit-mate the de facto polkit agent for XFCE in Guix, since XFCE does
> not ship its own.
> 
> A potential downside might be, that this desktop file ends up in the
> current system profile and can therefore be seen in XFCE
> configurations, that did not ask for it.
> 
> * gnu/packages/mate.scm (polkit-mate)[#:phases]: Add 'patch-desktop-
> for-xfce'.
> ----
> 
> You could also write significantly shorter commit messages, since
> "Enable autostarting in XFCE" already tells you everything the patch
> does.
> 
> Regards, Leo
Yeah I suck at commit messages. I've attached new patches doing it this way
and confirmed it worked in a VM.

[-- Attachment #2: 0001-gnu-Add-xfce-mate-polkit-autostart.patch --]
[-- Type: text/x-patch, Size: 2787 bytes --]

From 9eab32585fb16b41f2158ad21b43a032ca3c914d Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 18:26:31 +1000
Subject: [PATCH 1/2] gnu: Add xfce-mate-polkit-autostart.

gnu/packages/xfce.scm (xfce-mate-polkit-autostart) New symbol.
---
 gnu/packages/xfce.scm | 45 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 38240d7b9f..c7ba6218f1 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages inkscape)
   #:use-module (gnu packages libcanberra)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages mate)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages photo)
@@ -948,6 +949,50 @@ menubar and the window decorations are hidden) that helps you to save space
 on your desktop.")
     (license gpl2+)))
 
+(define-public xfce-mate-polkit-autostart
+  (package
+    (name "xfce-mate-polkit-autostart")
+    (version "1")
+    (inputs `(("mate-polkit" ,mate-polkit)))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'unpack)
+         (delete 'bootstrap)
+         (delete 'patch-usr-bin-file)
+         (delete 'patch-source-shebangs)
+         (delete 'configure)
+         (delete 'patch-generated-file-shebangs)
+         (delete 'check)
+         (delete 'install)
+         (delete 'patch-shebangs)
+         (delete 'strip)
+         (delete 'validate-runpath)
+         (delete 'validate-documentation-location)
+         (delete 'delete-info-dir-file)
+         (delete 'patch-dot-desktop-files)
+         (delete 'install-license-files)
+         (delete 'reset-gzip-timestamps)
+         (delete 'compress-documentation)
+         (replace 'build
+           (lambda _
+             (let* ((mate-polkit (assoc-ref %build-inputs "mate-polkit"))
+                    (out (assoc-ref %outputs "out"))
+                    (dir (string-append out "/etc/xdg/autostart"))
+                    (desktop (string-append
+                              dir "/xfce4-polkit-mate-authentication-agent-1.desktop")))
+               (mkdir-p dir)
+               (copy-file (string-append
+                           mate-polkit "/etc/xdg/autostart/"
+                           "polkit-mate-authentication-agent-1.desktop")
+                          desktop)
+               (substitute* desktop
+                 (("^X-MATE.*") "")
+                 (("MATE") "XFCE"))))))))
+    (source #f) (home-page #f) (synopsis #f) (description #f) (license #f)
+    (properties `((hidden? . #t)))))
+
 (define-public xfce
   (package
     (name "xfce")
-- 
2.31.1


[-- Attachment #3: 0002-gnu-xfce-Add-xfce-mate-polkit-autostart-to-inputs.patch --]
[-- Type: text/x-patch, Size: 928 bytes --]

From d18093a93f34f7d134a6f97e58aa4abaadbe33a6 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 20:16:05 +1000
Subject: [PATCH 2/2] gnu: xfce: Add xfce-mate-polkit-autostart to inputs.

* gnu/packages/xfce.scm (xfce):[inputs]: Add xfce-mate-polkit-autostart.
---
 gnu/packages/xfce.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index c7ba6218f1..974259306e 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -1016,6 +1016,7 @@ on your desktop.")
        ("gnome-icon-theme"     ,gnome-icon-theme)
        ("gtk-xfce-engine"      ,gtk-xfce-engine)
        ("hicolor-icon-theme"   ,hicolor-icon-theme)
+       ("xfce-mate-polkit-autostart" ,xfce-mate-polkit-autostart)
        ("ristretto"            ,ristretto)
        ("shared-mime-info"     ,shared-mime-info)
        ("thunar"               ,thunar)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19 11:02             ` Brendan Tildesley
@ 2021-04-19 11:12               ` Leo Prikler
  2021-04-19 11:26                 ` Brendan Tildesley
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Prikler @ 2021-04-19 11:12 UTC (permalink / raw)
  To: Brendan Tildesley, 47870

Hi Brendan,

Am Montag, den 19.04.2021, 13:02 +0200 schrieb Brendan Tildesley:
> gnu/packages/xfce.scm (xfce-mate-polkit-autostart) New symbol.
Scheme doesn't have symbols, it has variables.

> +(define-public xfce-mate-polkit-autostart
> +  (package
> +    (name "xfce-mate-polkit-autostart")
> +    (version "1")
> +    (inputs `(("mate-polkit" ,mate-polkit)))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'unpack)
> +         (delete 'bootstrap)
> +         (delete 'patch-usr-bin-file)
> +         (delete 'patch-source-shebangs)
> +         (delete 'configure)
> +         (delete 'patch-generated-file-shebangs)
> +         (delete 'check)
> +         (delete 'install)
> +         (delete 'patch-shebangs)
> +         (delete 'strip)
> +         (delete 'validate-runpath)
> +         (delete 'validate-documentation-location)
> +         (delete 'delete-info-dir-file)
> +         (delete 'patch-dot-desktop-files)
> +         (delete 'install-license-files)
> +         (delete 'reset-gzip-timestamps)
> +         (delete 'compress-documentation)
> +         (replace 'build
> +           (lambda _
> +             (let* ((mate-polkit (assoc-ref %build-inputs "mate-
> polkit"))
> +                    (out (assoc-ref %outputs "out"))
> +                    (dir (string-append out "/etc/xdg/autostart"))
> +                    (desktop (string-append
> +                              dir "/xfce4-polkit-mate-
> authentication-agent-1.desktop")))
> +               (mkdir-p dir)
> +               (copy-file (string-append
> +                           mate-polkit "/etc/xdg/autostart/"
> +                           "polkit-mate-authentication-agent-
> 1.desktop")
> +                          desktop)
> +               (substitute* desktop
> +                 (("^X-MATE.*") "")
> +                 (("MATE") "XFCE"))))))))
> +    (source #f) (home-page #f) (synopsis #f) (description #f)
> (license #f)
> +    (properties `((hidden? . #t)))))
That's a pretty large package description for something rather trivial.
Would the following work instead?

  (package/inherit mate-polkit
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-desktop-for-xfce
           (lambda _
             (substitute* "src/polkit-mate-authentication-agent-
1.desktop.in.in"
                 (("MATE;") "XFCE;"))))))))

Regards,
Leo





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19 11:12               ` Leo Prikler
@ 2021-04-19 11:26                 ` Brendan Tildesley
  2021-04-19 12:01                   ` Leo Prikler
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-19 11:26 UTC (permalink / raw)
  To: 47870; +Cc: Leo Prikler


> On 04/19/2021 1:12 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> 
>  
> Hi Brendan,
> 

> That's a pretty large package description for something rather trivial.
> Would the following work instead?
> 
>   (package/inherit mate-polkit
>     (arguments
>      `(#:phases
>        (modify-phases %standard-phases
>          (add-after 'unpack 'patch-desktop-for-xfce
>            (lambda _
>              (substitute* "src/polkit-mate-authentication-agent-
> 1.desktop.in.in"
>                  (("MATE;") "XFCE;"))))))))
> 
> Regards,
> Leo
Uhh ok it's simpler source code but now we're building it twice,
potentially having two copies of it and the .desktop file will have
the same filename and thus conflict if both desktops are installed.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19 11:26                 ` Brendan Tildesley
@ 2021-04-19 12:01                   ` Leo Prikler
  2021-04-19 13:30                     ` Brendan Tildesley
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Prikler @ 2021-04-19 12:01 UTC (permalink / raw)
  To: Brendan Tildesley, 47870

Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
> > On 04/19/2021 1:12 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > wrote:
> > 
> >  
> > Hi Brendan,
> > 
> > That's a pretty large package description for something rather
> > trivial.
> > Would the following work instead?
> > 
> >   (package/inherit mate-polkit
> >     (arguments
> >      `(#:phases
> >        (modify-phases %standard-phases
> >          (add-after 'unpack 'patch-desktop-for-xfce
> >            (lambda _
> >              (substitute* "src/polkit-mate-authentication-agent-
> > 1.desktop.in.in"
> >                  (("MATE;") "XFCE;"))))))))
> > 
> > Regards,
> > Leo
> Uhh ok it's simpler source code but now we're building it twice,
> potentially having two copies of it and the .desktop file will have
> the same filename and thus conflict if both desktops are installed.
Oh, right, I was missing the part, in which we rename it.
W.r.t. "building it twice", that's only if you have both mate-polkit
and the new one in your profile, in which case I guess it would be
tolerable.  If you're using just MATE or just XFCE you'll build one or
the other.

FWIW, there is also xfce-polkit [1], but it was last updated 2020 with
the latest release in 2018 (which is still more recent than 2011,
though).  WDYT?

[1] https://github.com/ncopa/xfce-polkit





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19 12:01                   ` Leo Prikler
@ 2021-04-19 13:30                     ` Brendan Tildesley
  2021-04-19 13:47                       ` Leo Prikler
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-19 13:30 UTC (permalink / raw)
  To: 47870; +Cc: Leo Prikler


> On 04/19/2021 2:01 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> 
>  
> Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
> > > On 04/19/2021 1:12 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > > wrote:
> > > 
> > >  
> > > Hi Brendan,
> > > 
> > > That's a pretty large package description for something rather
> > > trivial.
> > > Would the following work instead?
> > > 
> > >   (package/inherit mate-polkit
> > >     (arguments
> > >      `(#:phases
> > >        (modify-phases %standard-phases
> > >          (add-after 'unpack 'patch-desktop-for-xfce
> > >            (lambda _
> > >              (substitute* "src/polkit-mate-authentication-agent-
> > > 1.desktop.in.in"
> > >                  (("MATE;") "XFCE;"))))))))
> > > 
> > > Regards,
> > > Leo
> > Uhh ok it's simpler source code but now we're building it twice,
> > potentially having two copies of it and the .desktop file will have
> > the same filename and thus conflict if both desktops are installed.
> Oh, right, I was missing the part, in which we rename it.
> W.r.t. "building it twice", that's only if you have both mate-polkit
> and the new one in your profile, in which case I guess it would be
> tolerable.  If you're using just MATE or just XFCE you'll build one or
> the other.
> 
> FWIW, there is also xfce-polkit [1], but it was last updated 2020 with
> the latest release in 2018 (which is still more recent than 2011,
> though).  WDYT?
> 
> [1] https://github.com/ncopa/xfce-polkit

Yeah I saw these but there is next to zero information on them.
I packaged it and it seems worse. It doesn't even have OK/Cancel buttons
for mouse operation in the password entry dialogue. It uses libxfce4ui
and has "xfce" in the name but otherwise doesn't seem any more or less
suitable for xfce than other agents.

At this point I just want to pick one and get it done with. If you like
I can make mate-polkit like your suggestion but rename the desktop file
so it doesn't conflict.


Debian's package says this on gnome-polkit:
"This implementation was originally designed for GNOME 2, but most GNOME-based desktop environments, including GNOME 3, GNOME Flashback, and MATE, have their own built-in PolicyKit agents and no longer use this one. The remaining users of this implementation are Cinnamon, XFCE and Unity. "




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19 13:30                     ` Brendan Tildesley
@ 2021-04-19 13:47                       ` Leo Prikler
  2021-04-21  5:31                         ` Brendan Tildesley
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Prikler @ 2021-04-19 13:47 UTC (permalink / raw)
  To: Brendan Tildesley, 47870

Hi,

Am Montag, den 19.04.2021, 15:30 +0200 schrieb Brendan Tildesley:
> > On 04/19/2021 2:01 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > wrote:
> > 
> >  
> > Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
> > > > On 04/19/2021 1:12 PM Leo Prikler <
> > > > leo.prikler@student.tugraz.at>
> > > > wrote:
> > > > 
> > > >  
> > > > Hi Brendan,
> > > > 
> > > > That's a pretty large package description for something rather
> > > > trivial.
> > > > Would the following work instead?
> > > > 
> > > >   (package/inherit mate-polkit
> > > >     (arguments
> > > >      `(#:phases
> > > >        (modify-phases %standard-phases
> > > >          (add-after 'unpack 'patch-desktop-for-xfce
> > > >            (lambda _
> > > >              (substitute* "src/polkit-mate-authentication-
> > > > agent-
> > > > 1.desktop.in.in"
> > > >                  (("MATE;") "XFCE;"))))))))
> > > > 
> > > > Regards,
> > > > Leo
> > > Uhh ok it's simpler source code but now we're building it twice,
> > > potentially having two copies of it and the .desktop file will
> > > have
> > > the same filename and thus conflict if both desktops are
> > > installed.
> > Oh, right, I was missing the part, in which we rename it.
> > W.r.t. "building it twice", that's only if you have both mate-
> > polkit
> > and the new one in your profile, in which case I guess it would be
> > tolerable.  If you're using just MATE or just XFCE you'll build one
> > or
> > the other.
> > 
> > FWIW, there is also xfce-polkit [1], but it was last updated 2020
> > with
> > the latest release in 2018 (which is still more recent than 2011,
> > though).  WDYT?
> > 
> > [1] https://github.com/ncopa/xfce-polkit
> 
> Yeah I saw these but there is next to zero information on them.
> I packaged it and it seems worse. It doesn't even have OK/Cancel
> buttons
> for mouse operation in the password entry dialogue. It uses
> libxfce4ui
> and has "xfce" in the name but otherwise doesn't seem any more or
> less
> suitable for xfce than other agents.
Fair enough, so it's either gnome or mate for XFCE.

> At this point I just want to pick one and get it done with. If you
> like
> I can make mate-polkit like your suggestion but rename the desktop
> file
> so it doesn't conflict.
It's your choice, what you want to implement:
1. gnome-polkit with an added desktop file (but please use an aux file
or make-desktop-file-entry instead of an origin pointing into the
aether)
2. mate-polkit-for-xfce with the renamed desktop file.
3. something completely else

I know that waiting long for your patch to be upstreamed can be
frustrating, but I'm not here to tease you; rather I want to ensure,
that whatever you do ends up not as a quick and dirty fix, but a proper
package.

> Debian's package says this on gnome-polkit:
> "This implementation was originally designed for GNOME 2, but most
> GNOME-based desktop environments, including GNOME 3, GNOME Flashback,
> and MATE, have their own built-in PolicyKit agents and no longer use
> this one. The remaining users of this implementation are Cinnamon,
> XFCE and Unity. "
Hmm, in that case keeping gnome-polkit around longer might be desirable
if people want to port Cinnamon or Unity.  What does Debian's desktop
file look like and could we port it over?

Regards,
Leo





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-19 13:47                       ` Leo Prikler
@ 2021-04-21  5:31                         ` Brendan Tildesley
  2021-04-21  8:44                           ` bug#47870: " Leo Prikler
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Tildesley @ 2021-04-21  5:31 UTC (permalink / raw)
  To: Leo Prikler, 47870

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


> On 04/19/2021 3:47 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
[...]
> Fair enough, so it's either gnome or mate for XFCE.
> 
> > At this point I just want to pick one and get it done with. If you
> > like
> > I can make mate-polkit like your suggestion but rename the desktop
> > file
> > so it doesn't conflict.
> It's your choice, what you want to implement:
> 1. gnome-polkit with an added desktop file (but please use an aux file
> or make-desktop-file-entry instead of an origin pointing into the
> aether)
> 2. mate-polkit-for-xfce with the renamed desktop file.
> 3. something completely else

I made a patch for mate-polkit-for-xfce.



> > Debian's package says this on gnome-polkit:
> > "This implementation was originally designed for GNOME 2, but most
> > GNOME-based desktop environments, including GNOME 3, GNOME Flashback,
> > and MATE, have their own built-in PolicyKit agents and no longer use
> > this one. The remaining users of this implementation are Cinnamon,
> > XFCE and Unity. "
> Hmm, in that case keeping gnome-polkit around longer might be desirable
> if people want to port Cinnamon or Unity.  What does Debian's desktop
> file look like and could we port it over?

It has OnlyShowIn=XFCE;Unity;X-Cinnamon;

It also applies four patches of course
0001-Select-the-current-user-to-authenticate-with-by-defa.patch
0002-Auth-dialog-Make-the-label-wrap-at-70-chars.patch
0003-Get-user-icon-from-accountsservice-instead-of-lookin.patch
0004-Use-fresh-X11-timestamps-when-displaying-authenticat.patch
http://deb.debian.org/debian/pool/main/p/policykit-1-gnome/policykit-1-gnome_0.105-7.debian.tar.xz

[-- Attachment #2: 0001-gnu-Add-mate-polkit-for-xfce.patch --]
[-- Type: text/x-patch, Size: 2064 bytes --]

From eb7c6275699e9e8615ac8abf0cef768d96fe9da0 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 18:26:31 +1000
Subject: [PATCH 1/2] gnu: Add mate-polkit-for-xfce.

gnu/packages/xfce.scm (mate-polkit-for-xfce) New variable.
---
 gnu/packages/xfce.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 38240d7b9f..6d272a74ac 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,6 +49,7 @@
   #:use-module (gnu packages inkscape)
   #:use-module (gnu packages libcanberra)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages mate)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages photo)
@@ -948,6 +950,23 @@ menubar and the window decorations are hidden) that helps you to save space
 on your desktop.")
     (license gpl2+)))
 
+(define-public mate-polkit-for-xfce
+  (package/inherit mate-polkit
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'patch-desktop
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((a (string-append
+                        (assoc-ref outputs "out") "/etc/xdg/autostart/"
+                        "polkit-mate-authentication-agent-"))
+                    (b (string-append a "1.desktop"))
+                    (c (string-append a "for-xfce-1.desktop")))
+               (substitute* b (("MATE;") "XFCE;"))
+               ;; To avoid a conflict if both MATE and XFCE are installed.
+               (rename-file b c)))))))
+    (properties `((hidden? . #t)))))
+
 (define-public xfce
   (package
     (name "xfce")
-- 
2.31.1


[-- Attachment #3: 0002-gnu-xfce-Autostart-mate-polkit.patch --]
[-- Type: text/x-patch, Size: 889 bytes --]

From ccfd8c55472d9af3050d27c9b151d12323d728ce Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 20:16:05 +1000
Subject: [PATCH 2/2] gnu: xfce: Autostart mate-polkit.

* gnu/packages/xfce.scm (xfce):[inputs]: Add mate-polkit-for-xfce.
---
 gnu/packages/xfce.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 6d272a74ac..0d38649024 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -990,6 +990,7 @@ on your desktop.")
        ("gnome-icon-theme"     ,gnome-icon-theme)
        ("gtk-xfce-engine"      ,gtk-xfce-engine)
        ("hicolor-icon-theme"   ,hicolor-icon-theme)
+       ("mate-polkit-for-xfce" ,mate-polkit-for-xfce)
        ("ristretto"            ,ristretto)
        ("shared-mime-info"     ,shared-mime-info)
        ("thunar"               ,thunar)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* bug#47870: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
  2021-04-21  5:31                         ` Brendan Tildesley
@ 2021-04-21  8:44                           ` Leo Prikler
  0 siblings, 0 replies; 16+ messages in thread
From: Leo Prikler @ 2021-04-21  8:44 UTC (permalink / raw)
  To: Brendan Tildesley, 47870-done

Hi,

Am Mittwoch, den 21.04.2021, 07:31 +0200 schrieb Brendan Tildesley:
> > On 04/19/2021 3:47 PM Leo Prikler <leo.prikler@student.tugraz.at>
> > wrote:
> [...]
> > Fair enough, so it's either gnome or mate for XFCE.
> > 
> > > At this point I just want to pick one and get it done with. If
> > > you
> > > like
> > > I can make mate-polkit like your suggestion but rename the
> > > desktop
> > > file
> > > so it doesn't conflict.
> > It's your choice, what you want to implement:
> > 1. gnome-polkit with an added desktop file (but please use an aux
> > file
> > or make-desktop-file-entry instead of an origin pointing into the
> > aether)
> > 2. mate-polkit-for-xfce with the renamed desktop file.
> > 3. something completely else
> 
> I made a patch for mate-polkit-for-xfce.
> 
Thanks.  I've pushed them with some slight changes.
> 
> > > Debian's package says this on gnome-polkit:
> > > "This implementation was originally designed for GNOME 2, but
> > > most
> > > GNOME-based desktop environments, including GNOME 3, GNOME
> > > Flashback,
> > > and MATE, have their own built-in PolicyKit agents and no longer
> > > use
> > > this one. The remaining users of this implementation are
> > > Cinnamon,
> > > XFCE and Unity. "
> > Hmm, in that case keeping gnome-polkit around longer might be
> > desirable
> > if people want to port Cinnamon or Unity.  What does Debian's
> > desktop
> > file look like and could we port it over?
> 
> It has OnlyShowIn=XFCE;Unity;X-Cinnamon;
> 
> It also applies four patches of course
> 0001-Select-the-current-user-to-authenticate-with-by-defa.patch
> 0002-Auth-dialog-Make-the-label-wrap-at-70-chars.patch
> 0003-Get-user-icon-from-accountsservice-instead-of-lookin.patch
> 0004-Use-fresh-X11-timestamps-when-displaying-authenticat.patch
> http://deb.debian.org/debian/pool/main/p/policykit-1-gnome/policykit-1-gnome_0.105-7.debian.tar.xz
That still looks reasonable imo.  If at some point you're dissatisfied
with MATE's polkit agent, feel free to package it.

Regards,
Leo





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-04-21  8:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 13:13 [bug#47870] [PATCH 0/2] Autostart polkit-gnome in XFCE Brendan Tildesley via Guix-patches via
2021-04-18 13:17 ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Brendan Tildesley
2021-04-18 13:17   ` [bug#47870] [PATCH 2/2] gnu: xfce: Start polkit-gnome agent on login Brendan Tildesley
2021-04-18 14:47   ` [bug#47870] [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file Leo Prikler
2021-04-18 15:15     ` Brendan Tildesley
2021-04-18 15:52       ` Leo Prikler
2021-04-19  6:56         ` Brendan Tildesley
2021-04-19  7:36           ` Leo Prikler
2021-04-19 11:02             ` Brendan Tildesley
2021-04-19 11:12               ` Leo Prikler
2021-04-19 11:26                 ` Brendan Tildesley
2021-04-19 12:01                   ` Leo Prikler
2021-04-19 13:30                     ` Brendan Tildesley
2021-04-19 13:47                       ` Leo Prikler
2021-04-21  5:31                         ` Brendan Tildesley
2021-04-21  8:44                           ` bug#47870: " Leo Prikler

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