diff options
author | Marco Hunsicker <i3@hunsicker.de> | 2014-03-01 09:55:29 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2014-03-01 10:21:11 +0100 |
commit | 7b021d3eb20c9bf63ad8fa54ae253add47e551f6 (patch) | |
tree | 41e2dec68b86a792082ad6c1ad256627abd73c4a /include/i3status.h | |
parent | 26faed4c2f2c23f17b0c9170a4a72bb018931ed8 (diff) |
i3status: Allow customization of module separator
This patch adds the ability to customize the separator that is placed
between modules.
Specifically this patch:
* adds the "separator" general directive
* moves the definition of the default separator for the different
output formats (excluding color formatting) to src/i3status.c
* updates the SEC_CLOSE_MAP macro to disable the separator for the
i3bar output format if the separator directive dictates so
* changes print_seperator() in src/output.c to take a separator
parameter in order to disable the output of the separator if
the separator is empty and to use the provided separator
otherwise
* updates the manpage to explain the new directive
Diffstat (limited to 'include/i3status.h')
-rw-r--r-- | include/i3status.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/i3status.h b/include/i3status.h index e1246b9..a6cd535 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -88,6 +88,11 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_TERM, O_NONE } output_format; #define SEC_CLOSE_MAP \ do { \ if (output_format == O_I3BAR) { \ + const char *_sep = cfg_getstr(cfg_general, "separator"); \ + if (strlen(_sep) == 0) {\ + yajl_gen_string(json_gen, (const unsigned char *)"separator", strlen("separator")); \ + yajl_gen_bool(json_gen, false); \ + } \ yajl_gen_map_close(json_gen); \ } \ } while (0) @@ -133,7 +138,7 @@ void die(const char *fmt, ...); bool slurp(const char *filename, char *destination, int size); /* src/output.c */ -void print_seperator(); +void print_seperator(const char *separator); char *color(const char *colorstr); char *endcolor() __attribute__ ((pure)); void reset_cursor(void); |