diff options
author | Kinware AB <oss@kinware.com> | 2013-11-12 20:51:23 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-11-22 15:52:27 +0100 |
commit | 717484184f6e8a3bb38f50cc6fbe4fbfb3544cd9 (patch) | |
tree | 3bb8bfdab64761ce06dff14494a75bdcf2bd8bbd /i3status.c | |
parent | 98595f9f280f331d485b74afd9535723f495b071 (diff) |
Add support for path_exists directive.
Diffstat (limited to 'i3status.c')
-rw-r--r-- | i3status.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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")); |