commit 183e74eee8040025b86e60feaeabad8c27caf36a
parent 8fb6c0bca43e2c6297bc500c73c788d3e186885c
Author: sewn <sewn@disroot.org>
Date: Sat, 12 Oct 2024 19:00:01 +0300
[slstatus][patch][alsa] mute: change mute formatting
Diffstat:
1 file changed, 9 insertions(+), 8 deletions(-)
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
@@ -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@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
@@ -193,7 +193,7 @@
@@ -20,7 +20,7 @@ index 15c5a39..8636f61 100644
if ((err = snd_mixer_open(&mixer, 0))) {
warn("snd_mixer_open: %d", err);
-@@ -229,13 +229,19 @@
+@@ -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);
}
@@ -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