wok view libnotify/stuff/print-and-replace-id-v3.patch @ rev 23169
updated mediainfo (19.04 -> 19.09)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Mar 18 09:07:11 2020 +0100 (2020-03-18) |
parents | |
children |
line source
1 https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/257135/comments/10
2 https://launchpadlibrarian.net/105791133/print-and-replace-id-v3.patch
4 Index: libnotify-0.7.5/tools/notify-send.c
5 ===================================================================
6 --- libnotify-0.7.5.orig/tools/notify-send.c 2011-10-14 11:24:15.000000000 +1300
7 +++ libnotify-0.7.5/tools/notify-send.c 2012-05-22 22:15:43.370979671 +1200
8 @@ -130,6 +130,8 @@
9 static char *icons = NULL;
10 static char **n_text = NULL;
11 static char **hints = NULL;
12 + static gboolean print_id = FALSE;
13 + static gint replace_id = 0;
14 static gboolean do_version = FALSE;
15 static gboolean hint_error = FALSE;
16 static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT;
17 @@ -159,6 +161,10 @@
18 N_
19 ("Specifies basic extra data to pass. Valid types are int, double, string and byte."),
20 N_("TYPE:NAME:VALUE")},
21 + {"print-id", 'p', 0, G_OPTION_ARG_NONE, &print_id,
22 + N_ ("Print the notification ID."), NULL},
23 + {"replace-id", 'r', 0, G_OPTION_ARG_INT, &replace_id,
24 + N_ ("The ID of the notification to replace."), N_("REPLACE_ID")},
25 {"version", 'v', 0, G_OPTION_ARG_NONE, &do_version,
26 N_("Version of the package."),
27 NULL},
28 @@ -233,6 +239,9 @@
30 g_free (body);
32 + if (replace_id)
33 + g_object_set (notify, "id", replace_id, NULL);
34 +
35 /* Set hints */
36 if (hints != NULL) {
37 gint i = 0;
38 @@ -272,6 +281,12 @@
39 if (!hint_error)
40 notify_notification_show (notify, NULL);
42 + if (print_id) {
43 + gint id;
44 + g_object_get (notify, "id", &id, NULL);
45 + g_printf ("%d\n", id);
46 + }
47 +
48 g_object_unref (G_OBJECT (notify));
50 notify_uninit ();