summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c14
1 files changed, 14 insertions, 0 deletions
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"));