From 6f4819f7a5055e5e3bbfe5ff5b6447d6e300df17 Mon Sep 17 00:00:00 2001 From: johannes karoff Date: Sun, 31 Jan 2016 19:16:42 +0100 Subject: add separator and separator_block_width as universal module options fixes #104 --- i3status.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'i3status.c') diff --git a/i3status.c b/i3status.c index ec204e5..c8c5df0 100644 --- a/i3status.c +++ b/i3status.c @@ -53,6 +53,12 @@ #define CFG_CUSTOM_MIN_WIDTH_OPT \ CFG_PTR_CB("min_width", NULL, CFGF_NONE, parse_min_width, free) +#define CFG_CUSTOM_SEPARATOR_OPT \ + CFG_BOOL("separator", 0, CFGF_NODEFAULT) + +#define CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT \ + CFG_INT("separator_block_width", 0, CFGF_NODEFAULT) + /* socket file descriptor for general purposes */ int general_socket; @@ -304,6 +310,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t path_exists_opts[] = { @@ -313,6 +321,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t wireless_opts[] = { @@ -321,6 +331,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t ethernet_opts[] = { @@ -329,6 +341,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t ipv6_opts[] = { @@ -337,6 +351,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t battery_opts[] = { @@ -354,12 +370,16 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t time_opts[] = { CFG_STR("format", "%Y-%m-%d %H:%M:%S", CFGF_NONE), CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t tztime_opts[] = { @@ -368,12 +388,16 @@ int main(int argc, char *argv[]) { CFG_STR("format_time", NULL, CFGF_NONE), CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t ddate_opts[] = { CFG_STR("format", "%{%a, %b %d%}, %Y%N - %H", CFGF_NONE), CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t load_opts[] = { @@ -382,12 +406,16 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t usage_opts[] = { CFG_STR("format", "%usage", CFGF_NONE), CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t temp_opts[] = { @@ -397,6 +425,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t disk_opts[] = { @@ -408,6 +438,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t volume_opts[] = { @@ -419,6 +451,8 @@ int main(int argc, char *argv[]) { CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, + CFG_CUSTOM_SEPARATOR_OPT, + CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, CFG_END()}; cfg_opt_t opts[] = { -- cgit v1.2.3