GNU bug report logs - #73647
[PATCH] Add indicator-sound-switcher

Previous Next

Package: guix-patches;

Reported by: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>

Date: Sun, 6 Oct 2024 01:01:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 73647 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#73647; Package guix-patches. (Sun, 06 Oct 2024 01:01:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 06 Oct 2024 01:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
Subject: [PATCH] Add indicator-sound-switcher
Date: Sat,  5 Oct 2024 20:50:08 +0200
This commit adds indicator-sound-switcher.
Unfortunately, I couldn't figure out how to export the icons so
that the program (/GTK?) finds them so it shows only a default gray icon.
Besides that it works fine.

Change-Id: I75e5dde35abe0a95af7c11ab2abfbc368ec9dff7
---
 gnu/packages/wm.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 38cb8cc717..836b770c02 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -112,6 +112,7 @@ (define-module (gnu packages wm)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
@@ -3957,3 +3958,43 @@ (define-public wf-config
 configuration files of Wayifre.  It can set key and mouse bindings,
 configure input, and customize Wayfire plugins.")
     (license license:expat)))
+
+(define-public indicator-sound-switcher
+  (package
+    (name "indicator-sound-switcher")
+    (version "2.3.10.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/yktoo/indicator-sound-switcher")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0y52k56ww2327r7ywwdvld5lx85qmcy8yrpaxc5lim7w3jbf3s85"))))
+    (build-system python-build-system)
+    (native-inputs (list gettext-minimal gobject-introspection))
+    (inputs (list python-pygobject girara python-pulsectl pulseaudio))
+    (propagated-inputs (list libappindicator keybinder))
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'install 'patch-xdg-autostart
+                     (lambda* (#:key inputs outputs #:allow-other-keys)
+                       (let* ((pulseaudio (assoc-ref inputs "pulseaudio"))
+                              (pulse (string-append pulseaudio
+                                                    "/lib/libpulse.so.0")))
+                         (substitute* "setup.py"
+                           (("/etc/xdg/autostart")
+                            '"share/etc/xdg/autostart"))
+                         (substitute* "lib/indicator_sound_switcher/lib_pulseaudio.py"
+                           (("libpulse.so.0")
+                            pulse))))))))
+    (home-page "https://github.com/yktoo/indicator-sound-switcher")
+    (synopsis "Sound input/output selector indicator for Linux")
+    (description
+     "It shows an icon in the indicator area or the system tray
+(whatever is available in your desktop environment).
+The icon's menu allows you to switch the current sound input and output
+(i.e. source ports and sink ports in PulseAudio's terms, respectively) with just two clicks:")
+    (license license:gpl3)))

base-commit: 713f5562faf1acc02dc9e3f3a2d45dc39abbe9f1
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#73647; Package guix-patches. (Sun, 06 Oct 2024 20:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 73647 <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
To: 73647 <at> debbugs.gnu.org
Subject: Small oversight
Date: Sun, 6 Oct 2024 22:51:18 +0200
Actually, the icons work fine after logging in again. So it works 
exactly as I would expect it to and can IMHO be merged as it is.





Information forwarded to guix-patches <at> gnu.org:
bug#73647; Package guix-patches. (Sun, 20 Oct 2024 07:19:02 GMT) Full text and rfc822 format available.

Message #11 received at 73647 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> gmx.com>
To: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>,
 73647 <at> debbugs.gnu.org
Cc: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
Subject: Re: [bug#73647] [PATCH] Add indicator-sound-switcher
Date: Sun, 20 Oct 2024 09:13:59 +0200
Hi!

Below some review comments ;)

On 2024-10-05 20:50, Sebastian Willenbrink wrote:
> +(define-public indicator-sound-switcher
> +  (package
> +    (name "indicator-sound-switcher")
> +    (version "2.3.10.1")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/yktoo/indicator-sound-switcher")
> +             (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "0y52k56ww2327r7ywwdvld5lx85qmcy8yrpaxc5lim7w3jbf3s85"))))
> +    (build-system python-build-system)
> +    (native-inputs (list gettext-minimal gobject-introspection))
> +    (inputs (list python-pygobject girara python-pulsectl pulseaudio))
> +    (propagated-inputs (list libappindicator keybinder))
> +    (arguments
> +     (list
> +      #:phases #~(modify-phases %standard-phases
> +                   (add-before 'install 'patch-xdg-autostart
> +                     (lambda* (#:key inputs outputs #:allow-other-keys)
> +                       (let* ((pulseaudio (assoc-ref inputs "pulseaudio"))
> +                              (pulse (string-append pulseaudio
> +                                                    "/lib/libpulse.so.0")))

We rather use (search-input-file inputs "/lib/libpulse.so.0") now.
It's also shorter, so you can probably drop the let* and use that
directly in the substitute*

> +                         (substitute* "setup.py"
> +                           (("/etc/xdg/autostart")
> +                            '"share/etc/xdg/autostart"))
> +                         (substitute* "lib/indicator_sound_switcher/lib_pulseaudio.py"

This line is probably above 79 characters. Use the next line ;)

> +                           (("libpulse.so.0")
> +                            pulse))))))))
> +    (home-page "https://github.com/yktoo/indicator-sound-switcher")
> +    (synopsis "Sound input/output selector indicator for Linux")
> +    (description
> +     "It shows an icon in the indicator area or the system tray

Please use "This package" or its name instead of it.

> +(whatever is available in your desktop environment).
> +The icon's menu allows you to switch the current sound input and output
> +(i.e. source ports and sink ports in PulseAudio's terms, respectively) with just two clicks:")

This last line is too long and shouldn't end with :

> +    (license license:gpl3)))
>
> base-commit: 713f5562faf1acc02dc9e3f3a2d45dc39abbe9f1

You should also write a proper git commit message. There are templates
in guix's source etc/snippets folder if you use emacs (either tempel or
yasnippets). Or copy another gnu: Add [pkg] commit.

I don't see other lints but for some reason the build is blocked for
x86-64-linux on QA.

--
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#73647; Package guix-patches. (Sun, 20 Oct 2024 09:03:01 GMT) Full text and rfc822 format available.

Message #14 received at 73647 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>,
 73647 <at> debbugs.gnu.org
Cc: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
Subject: Re: [bug#73647] [PATCH] Add indicator-sound-switcher
Date: Sun, 20 Oct 2024 11:01:56 +0200
> +    (arguments
> +     (list
> +      #:phases #~(modify-phases %standard-phases
> +                   (add-before 'install 'patch-xdg-autostart
> +                     (lambda* (#:key inputs outputs #:allow-other-keys)

You also don't need outputs here.

-- 
Best regards,
Nicolas Graves




Information forwarded to sebastian.willenbrink <at> gmail.com, ngraves <at> gmx.com, ngraves <at> ngraves.fr, guix-patches <at> gnu.org:
bug#73647; Package guix-patches. (Tue, 12 Nov 2024 13:01:02 GMT) Full text and rfc822 format available.

Message #17 received at 73647 <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
To: 73647 <at> debbugs.gnu.org
Cc: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
Subject: [PATCH] gnu: Add indicator-sound-switcher.
Date: Tue, 12 Nov 2024 13:58:59 +0100
* gnu/packages/wm.scm (indicator-sound-switcher): New variable.

Change-Id: I013091cca83fc96c47b5a7ebe5ccfc7db1354ff1
---
 gnu/packages/wm.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 836d4b6c04..61f8d4a310 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -112,6 +112,7 @@ (define-module (gnu packages wm)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
@@ -3969,3 +3970,41 @@ (define-public wf-config
 configuration files of Wayifre.  It can set key and mouse bindings,
 configure input, and customize Wayfire plugins.")
     (license license:expat)))
+
+(define-public indicator-sound-switcher
+  (package
+    (name "indicator-sound-switcher")
+    (version "2.3.10.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/yktoo/indicator-sound-switcher")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0y52k56ww2327r7ywwdvld5lx85qmcy8yrpaxc5lim7w3jbf3s85"))))
+    (build-system python-build-system)
+    (native-inputs (list gettext-minimal gobject-introspection))
+    (inputs (list python-pygobject girara python-pulsectl pulseaudio))
+    (propagated-inputs (list libappindicator keybinder))
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'install 'patch-xdg-autostart
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "setup.py"
+                         (("/etc/xdg/autostart")
+                          '"share/etc/xdg/autostart"))
+                       (substitute*
+                           "lib/indicator_sound_switcher/lib_pulseaudio.py"
+                         (("libpulse.so.0")
+                          (search-input-file inputs "/lib/libpulse.so.0"))))))))
+    (home-page "https://github.com/yktoo/indicator-sound-switcher")
+    (synopsis "Sound input/output selector indicator for Linux")
+    (description
+     "indicator-sound-switcher shows an icon in the indicator area or the system
+tray (whatever is available in your desktop environment). The icon's menu allows
+you to switch the current sound input and output (i.e. source ports and sink
+ports in PulseAudio's terms, respectively) with just two clicks.")
+    (license license:gpl3)))

base-commit: 40625c213ad2007f70117518a7cc290d367e652a
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#73647; Package guix-patches. (Tue, 12 Nov 2024 13:07:02 GMT) Full text and rfc822 format available.

Message #20 received at 73647 <at> debbugs.gnu.org (full text, mbox):

From: Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
To: 73647 <at> debbugs.gnu.org
Cc: Nicolas Graves <ngraves <at> ngraves.fr>, Nicolas Graves <ngraves <at> gmx.com>,
 Sebastian Willenbrink <sebastian.willenbrink <at> gmail.com>
Subject: Re: [PATCH] Add indicator-sound-switcher
Date: Tue, 12 Nov 2024 14:05:02 +0100
Hi!

Here is the new patch. Took some time for me to get around to it.

I'm still a bit confused by the mail/patch-based workflow so I hope I 
didn't mess anything up. I assume amending the commit is the correct way 
to go. Or should I have created a separate commit with only the new changes?

Best regards,
Sebastian





This bug report was last modified 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.