[wiki] [sites] [slstatus][patch][alsa] mute: change mute formatting || sewn

From: <git_AT_suckless.org>
Date: Sat, 12 Oct 2024 18:01:13 +0200

commit 183e74eee8040025b86e60feaeabad8c27caf36a
Author: sewn <sewn_AT_disroot.org>
Date: Sat Oct 12 19:00:01 2024 +0300

    [slstatus][patch][alsa] mute: change mute formatting

diff --git a/tools.suckless.org/slstatus/patches/alsa/slstatus-alsa-mute-1.0.diff b/tools.suckless.org/slstatus/patches/alsa/slstatus-alsa-mute-1.0.diff
index db70c19a..d8281c09 100644
--- a/tools.suckless.org/slstatus/patches/alsa/slstatus-alsa-mute-1.0.diff
+++ b/tools.suckless.org/slstatus/patches/alsa/slstatus-alsa-mute-1.0.diff
_AT_@ -1,14 +1,14 @@
-From 8375f197e9af7d219abe65cf0311ea16dea852f1 Mon Sep 17 00:00:00 2001
+From 36f56dcdccdf986dd9ddf090a5ae16165b3b23e0 Mon Sep 17 00:00:00 2001
 From: sewn <sewn_AT_disroot.org>
-Date: Thu, 31 Aug 2023 15:01:07 +0300
+Date: Sat, 12 Oct 2024 18:58:05 +0300
 Subject: [PATCH] volume: add mute support for ALSA
 
 ---
- components/volume.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ components/volume.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
 
 diff --git a/components/volume.c b/components/volume.c
-index 15c5a39..8636f61 100644
+index 15c5a39..eb56c47 100644
 --- a/components/volume.c
 +++ b/components/volume.c
 _AT_@ -193,7 +193,7 @@
_AT_@ -20,7 +20,7 @@ index 15c5a39..8636f61 100644
  
                  if ((err = snd_mixer_open(&mixer, 0))) {
                          warn("snd_mixer_open: %d", err);
-_AT_@ -229,13 +229,19 @@
+_AT_@ -229,13 +229,20 @@
                  if ((err = snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_MONO, &volume))) {
                          warn("snd_mixer_selem_get_playback_volume(): %d", err);
                  }
_AT_@ -37,10 +37,11 @@ index 15c5a39..8636f61 100644
                  snd_mixer_close(mixer);
  
 - return volume == -1 ? NULL : bprintf("%.0f", (volume-min)*100./(max-min));
-+ return !(sw1 || sw2) ? "mute" : volume == -1 ? NULL : bprintf("%.0f", (volume-min)*100./(max-min));
++ return volume == -1 ? NULL : bprintf("%s%.0f",
++ !(sw1 || sw2) ? "muted " : "", (volume-min)*100./(max-min));
          }
  #else
          #include <sys/soundcard.h>
 --
-2.42.0
+2.46.2
 
Received on Sat Oct 12 2024 - 18:01:13 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 12 2024 - 18:12:50 CEST