diff mbox series

[bug#47870,1/2] gnu: polkit-gnome: Add autostart .desktop file.

Message ID 1897089617.84042.1618815414259@office.mailbox.org
State Accepted
Headers show
Series [bug#47870,1/2] gnu: polkit-gnome: Add autostart .desktop file. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Brendan Tildesley April 19, 2021, 6:56 a.m. UTC
> 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

Comments

Leo Prikler April 19, 2021, 7:36 a.m. UTC | #1
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
diff mbox series

Patch

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