diff options
Diffstat (limited to 'notify.c')
| -rw-r--r-- | notify.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -34,6 +34,7 @@ notify_free(struct terminal *term, struct notification *notif) free(notif->icon_cache_id); free(notif->icon_symbolic_name); free(notif->icon_data); + free(notif->sound_name); free(notif->xdg_token); free(notif->stdout_data); @@ -77,7 +78,7 @@ write_icon_file(const void *data, size_t data_sz, int *fd, char **filename, LOG_DBG("wrote icon data to %s", name); *filename = xstrdup(name); - *symbolic_name = xasprintf("file://%s", *filename); + *symbolic_name = xstrjoin("file://", *filename); return true; } @@ -421,9 +422,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, " + "sound-name=%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", notif->sound_name, + track_notification ? "yes" : "no"); xassert(title != NULL); if (title == NULL) @@ -463,13 +467,16 @@ notify_notify(struct terminal *term, struct notification *notif) } if (!spawn_expand_template( - &term->conf->desktop_notifications.command, 10, + &term->conf->desktop_notifications.command, 12, (const char *[]){ "app-id", "window-title", "icon", "title", "body", "category", - "urgency", "expire-time", "replace-id", "action-argument"}, + "urgency", "muted", "sound-name", "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, + notif->muted ? "true" : "false", + notif->sound_name != NULL ? notif->sound_name : "", expire_time, replaces_id_str, /* Custom expansion below, since we need to expand to multiple arguments */ @@ -542,6 +549,7 @@ notify_notify(struct terminal *term, struct notification *notif) notif->icon_data = NULL; notif->icon_data_sz = 0; notif->icon_path = NULL; + notif->sound_name = NULL; notif->icon_fd = -1; notif->stdout_fd = -1; struct notification *new_notif = &tll_back(term->active_notifications); |
