diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-08-04 12:16:56 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-08-04 12:20:35 +0000 |
| commit | 63492624918cd23a5efdd9b8a8b4f057da66d961 (patch) | |
| tree | 1e426fa797ec03ce3a00cb3c97f47cdf09b1de85 /notify.c | |
| parent | term: reload_fonts(): don't ignore return value of thrd_join() (diff) | |
osc: kitty notifications: implement s=silent
This implements part of the new 's' (sound) parameter; the 'silent'
value. When s=silent, we set the ${muted} template argument to
"true". It is intended to set the 'suppress-sound' hint:
notify-send --hint BOOLEAN:suppress-sound:${muted}
Diffstat (limited to 'notify.c')
| -rw-r--r-- | notify.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -421,9 +421,12 @@ notify_notify(struct terminal *term, struct notification *notif) ? "normal" : "critical"; LOG_DBG("notify: title=\"%s\", body=\"%s\", app-id=\"%s\", category=\"%s\", " - "urgency=\"%s\", icon=\"%s\", expires=%d, replaces=%u (tracking: %s)", + "urgency=\"%s\", icon=\"%s\", expires=%d, replaces=%u, muted=%s " + "(tracking: %s)", title, body, app_id, notif->category, urgency_str, icon_name_or_path, - notif->expire_time, replaces_id, track_notification ? "yes" : "no"); + notif->expire_time, replaces_id, + notif->muted ? "yes" : "no", + track_notification ? "yes" : "no"); xassert(title != NULL); if (title == NULL) @@ -463,14 +466,14 @@ notify_notify(struct terminal *term, struct notification *notif) } if (!spawn_expand_template( - &term->conf->desktop_notifications.command, 10, + &term->conf->desktop_notifications.command, 11, (const char *[]){ "app-id", "window-title", "icon", "title", "body", "category", - "urgency", "expire-time", "replace-id", "action-argument"}, + "urgency", "muted", "expire-time", "replace-id", "action-argument"}, (const char *[]){ app_id, term->window_title, icon_name_or_path, title, body, notif->category != NULL ? notif->category : "", urgency_str, - expire_time, replaces_id_str, + notif->muted ? "true" : "false", expire_time, replaces_id_str, /* Custom expansion below, since we need to expand to multiple arguments */ "${action-argument}"}, |
