From 15d20af2a24664b09604f1ec5f121c38f1500c32 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 10 Dec 2020 18:22:48 +0100 Subject: config: add ‘notify’ to possible values for ‘bell’ in foot.ini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When `bell=notify`, foot will trigger a desktop notification when it receives a BEL in an unfocused window. --- config.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 8ec72918..085c9f7e 100644 --- a/config.c +++ b/config.c @@ -483,14 +483,17 @@ parse_section_main(const char *key, const char *value, struct config *conf, else if (strcmp(key, "bell") == 0) { if (strcmp(value, "set-urgency") == 0) - conf->bell_is_urgent = true; + conf->bell_action = BELL_ACTION_URGENT; + else if (strcmp(value, "notify") == 0) + conf->bell_action = BELL_ACTION_NOTIFY; else if (strcmp(value, "none") == 0) - conf->bell_is_urgent = false; + conf->bell_action = BELL_ACTION_NONE; else { LOG_AND_NOTIFY_ERR( "%s:%d: [default]: bell: " - "expected either 'set-urgency' or 'none'", path, lineno); - conf->bell_is_urgent = false; + "expected either 'set-urgency', 'notify' or 'none'", + path, lineno); + conf->bell_action = BELL_ACTION_NONE; return false; } } @@ -1945,7 +1948,7 @@ config_load(struct config *conf, const char *conf_path, .pad_x = 2, .pad_y = 2, .bold_in_bright = false, - .bell_is_urgent = false, + .bell_action = BELL_ACTION_NONE, .startup_mode = STARTUP_WINDOWED, .fonts = {tll_init(), tll_init(), tll_init(), tll_init()}, .dpi_aware = true, /* Use DPI by default, not scale factor */ -- cgit v1.3