summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorjohannes karoff <johannes@karoff.net>2016-01-31 19:16:42 +0100
committerjohannes karoff <johannes@karoff.net>2016-01-31 19:39:29 +0100
commit6f4819f7a5055e5e3bbfe5ff5b6447d6e300df17 (patch)
tree7fcce456c628987240b0f85f270d46fea76ac64a /i3status.c
parent85329802b29406925bf1f1656de85daf892309f3 (diff)
add separator and separator_block_width as universal module options
fixes #104
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c34
1 files changed, 34 insertions, 0 deletions
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[] = {