aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-10 17:22:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-10 17:22:48 +0000
commit15d20af2a24664b09604f1ec5f121c38f1500c32 (patch)
tree34d9ab652f1c24399f098aafc5b80ad4de9e6016 /config.c
parentnotify: don’t emit notification when we’re focused (diff)
config: add ‘notify’ to possible values for ‘bell’ in foot.ini
When `bell=notify`, foot will trigger a desktop notification when it receives a BEL in an unfocused window.
Diffstat (limited to 'config.c')
-rw-r--r--config.c13
1 files changed, 8 insertions, 5 deletions
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 */