summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2022-04-27 20:52:48 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2022-04-27 20:52:48 +0200
commited43da3479c8a2ebbaf49262a1c97da9fabbef77 (patch)
treecbdf4bc3941eda058bbfea1d0f684d10554936d0
parent02f2f91c3dc97a25b9f2cd669e2082c3c7a86d3f (diff)
downloadlibnotify-ed43da3479c8a2ebbaf49262a1c97da9fabbef77.tar.gz
notify-send: Add explicit option to create transient notifications
-rw-r--r--tools/notify-send.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/notify-send.c b/tools/notify-send.c
index 04eb770..c992180 100644
--- a/tools/notify-send.c
+++ b/tools/notify-send.c
@@ -191,6 +191,7 @@ main (int argc, char *argv[])
static gint notification_id = 0;
static gboolean do_version = FALSE;
static gboolean hint_error = FALSE, show_error = FALSE;
+ static gboolean transient = FALSE;
static gboolean wait = FALSE;
static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT;
GOptionContext *opt_ctx;
@@ -215,6 +216,9 @@ main (int argc, char *argv[])
{"category", 'c', 0, G_OPTION_ARG_FILENAME, &type,
N_("Specifies the notification category."),
N_("TYPE[,TYPE...]")},
+ {"transient", 'e', 0, G_OPTION_ARG_NONE, &transient,
+ N_("Create a transient notification"),
+ NULL},
{"hint", 'h', 0, G_OPTION_ARG_FILENAME_ARRAY, &hints,
N_
("Specifies basic extra data to pass. Valid types are boolean, int, double, string, byte and variant."),
@@ -302,6 +306,11 @@ main (int argc, char *argv[])
notify_notification_set_timeout (notify, expire_timeout);
notify_notification_set_app_name (notify, app_name);
+ if (transient) {
+ notify_notification_set_hint (notify, "transient",
+ g_variant_new_boolean (TRUE));
+ }
+
g_free (body);
/* Set hints */