From 717484184f6e8a3bb38f50cc6fbe4fbfb3544cd9 Mon Sep 17 00:00:00 2001 From: Kinware AB Date: Tue, 12 Nov 2013 20:51:23 +0100 Subject: Add support for path_exists directive. --- i3status.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'i3status.c') diff --git a/i3status.c b/i3status.c index 1b9c595..e2befbc 100644 --- a/i3status.c +++ b/i3status.c @@ -210,6 +210,13 @@ int main(int argc, char *argv[]) { CFG_END() }; + cfg_opt_t path_exists_opts[] = { + CFG_STR("path", NULL, CFGF_NONE), + CFG_STR("format", "%title: %status", CFGF_NONE), + CFG_CUSTOM_COLOR_OPTS, + CFG_END() + }; + cfg_opt_t wireless_opts[] = { CFG_STR("format_up", "W: (%quality at %essid, %bitrate) %ip", CFGF_NONE), CFG_STR("format_down", "W: down", CFGF_NONE), @@ -298,6 +305,7 @@ int main(int argc, char *argv[]) { CFG_STR_LIST("order", "{}", CFGF_NONE), CFG_SEC("general", general_opts, CFGF_NONE), CFG_SEC("run_watch", run_watch_opts, CFGF_TITLE | CFGF_MULTI), + CFG_SEC("path_exists", path_exists_opts, CFGF_TITLE | CFGF_MULTI), CFG_SEC("wireless", wireless_opts, CFGF_TITLE | CFGF_MULTI), CFG_SEC("ethernet", ethernet_opts, CFGF_TITLE | CFGF_MULTI), CFG_SEC("battery", battery_opts, CFGF_TITLE | CFGF_MULTI), @@ -481,6 +489,12 @@ int main(int argc, char *argv[]) { SEC_CLOSE_MAP; } + CASE_SEC_TITLE("path_exists") { + SEC_OPEN_MAP("path_exists"); + print_path_exists(json_gen, buffer, title, cfg_getstr(sec, "path"), cfg_getstr(sec, "format")); + SEC_CLOSE_MAP; + } + CASE_SEC_TITLE("disk") { SEC_OPEN_MAP("disk_info"); print_disk_info(json_gen, buffer, title, cfg_getstr(sec, "format")); -- cgit v1.2.3