void-packages/srcpkgs/pa-applet/patches/fix-volume-notification.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

27 lines
815 B
Diff

diff --git a/src/notifications.c b/src/notifications.c
index f5ac1f8..e366a12 100644
--- a/src/notifications.c
+++ b/src/notifications.c
@@ -7,6 +7,7 @@
*
*/
+#include <stdio.h>
#include <libnotify/notify.h>
#include "audio_status.h"
@@ -73,7 +74,13 @@ void notifications_flash(void)
notify_notification_set_hint_int32(notification, "value", (gint)as->volume);
// Update the notification icon
- notify_notification_update(notification, PROGRAM_NAME, NULL, icon_name);
+ char vol_text[5];
+ if (as->muted) {
+ snprintf(vol_text, 5, "mute");
+ } else {
+ snprintf(vol_text, 5, "%3.0f%%", as->volume);
+ }
+ notify_notification_update(notification, PROGRAM_NAME, vol_text, icon_name);
// Show the notification
notify_notification_show(notification, NULL);