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.
This commit is contained in:
Daniel Eklöf 2020-12-10 18:22:48 +01:00
parent 1d8410b7ae
commit 15d20af2a2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
7 changed files with 45 additions and 17 deletions

View file

@ -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 */