tmisu

Notification to stdout daemon
git clone https://git.inz.fi/tmisu/
Log | Files | Refs | README | LICENSE

commit 4719469dbb90299a718efad56b2443c73ac37fdb
parent b738b47cc474ffa512a4c9e0542a30db19b4c414
Author: Sweets <Sweets@users.noreply.github.com>
Date:   Sat,  4 Jul 2020 13:00:28 -0700

Change hint output location

Diffstat:
Mformat.c | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/format.c b/format.c @@ -23,6 +23,13 @@ void output_notification(gchar *app_name, guint32 replaces_id, gchar *app_icon, char *escaped_string = (char *)calloc(512, sizeof(char)); +#ifdef PRINT_JSON + + printf("{ \"app_name\": \"%s\",", escape_quotes(app_name, escaped_string)); + printf(" \"app_icon\": \"%s\",", escape_quotes(app_icon, escaped_string)); + printf(" \"replaces_id\": %u, \"timeout\": %d,", replaces_id, timeout); + printf(" \"hints\": { "); + const char *int_format = ", \"%s\": %d"; const char *uint_format = ", \"%s\": %u"; @@ -62,11 +69,7 @@ void output_notification(gchar *app_name, guint32 replaces_id, gchar *app_icon, } -#ifdef PRINT_JSON - - printf("{ \"app_name\": \"%s\",", escape_quotes(app_name, escaped_string)); - printf(" \"app_icon\": \"%s\",", escape_quotes(app_icon, escaped_string)); - printf(" \"replaces_id\": %u, \"timeout\": %d,", replaces_id, timeout); + printf(" },"); printf(" \"summary\": \"%s\",", escape_quotes(summary, escaped_string)); printf(" \"body\": \"%s\" }\n", escape_quotes(body, escaped_string));