commit d9620deeb02f1390cca683eb65763a06c9e2cc9b
parent 3cbe5027ed4f83281f3dfa71857374accf4f45f9
Author: Sweets <Sweets@users.noreply.github.com>
Date: Sun, 26 Apr 2020 21:39:00 -0700
Add: delimiter option in config
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/config.h b/config.h
@@ -1,4 +1,6 @@
+#define DEBUG
// #define RECEIVE_ACTIONS
// #define RECEIVE_APP_ICON
// #define RECEIVE_REPLACES_ID
// #define RECEIVE_EXPIRE_TIMEOUT
+#define OUTPUT_DELIMITER ","
diff --git a/format.c b/format.c
@@ -14,17 +14,18 @@ void output_notification(gchar *app_name, guint32 replaces_id, gchar *app_icon,
strcat(string, app_name);
#ifdef RECEIVE_APP_ICON
- sprintf(string, "%s\n%s", string, app_icon);
+ sprintf(string, "%s%s%s", string, OUTPUT_DELIMITER, app_icon);
#endif
/* TODO: actions */
/* TODO: hints */
#ifdef RECEIVE_REPLACES_ID
- sprintf(string, "%s\n%lu", string, replaces_id);
+ sprintf(string, "%s%s%lu", string, OUTPUT_DELIMITER, replaces_id);
#endif
- sprintf(string, "%s\n%d\n%s\n%s", string, timeout, summary, body);
+ sprintf(string, "%s%s%d%s%s%s%s", string, OUTPUT_DELIMITER,
+ timeout, OUTPUT_DELIMITER, summary, OUTPUT_DELIMITER, body);
printf("%s\n", string);
fflush(stdout);