From 7c6686221f328e9399eb679c246662c801b2356b Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 8 Oct 2020 19:55:32 +0200 Subject: bell: optionally render margins in red when receiving BEL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add anew config option, ‘bell=none|set-urgency’. When set to ‘set-urgency’, the margins will be painted in red (if the window did not have keyboard focus). This is intended as a cheap replacement for the ‘urgency’ hint, that doesn’t (yet) exist on Wayland. Closes #157 --- config.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index ff5d6c59..3bece45e 100644 --- a/config.c +++ b/config.c @@ -517,6 +517,20 @@ parse_section_main(const char *key, const char *value, struct config *conf, conf->pad_y = y; } + else if (strcmp(key, "bell") == 0) { + if (strcmp(value, "set-urgency") == 0) + conf->bell_set_urgency = true; + else if (strcmp(value, "none") == 0) + conf->bell_set_urgency = false; + else { + LOG_AND_NOTIFY_ERR( + "%s:%d: [default]: bell: " + "expected either 'set-urgency' or 'none'", path, lineno); + conf->bell_set_urgency = false; + return false; + } + } + else if (strcmp(key, "initial-window-mode") == 0) { if (strcmp(value, "windowed") == 0) conf->startup_mode = STARTUP_WINDOWED; @@ -1867,6 +1881,7 @@ config_load(struct config *conf, const char *conf_path, }, .pad_x = 2, .pad_y = 2, + .bell_set_urgency = false, .startup_mode = STARTUP_WINDOWED, .fonts = tll_init(), .scrollback = { -- cgit v1.3