aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-28 19:41:31 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-28 19:41:31 +0200
commitc9b33846cb15555ee419c5e218ce16f05c589d26 (patch)
tree25b079c9a392b6194cbc99681d110898584f640a
parent3b42a09751eaecec637e40ca1c816092aab01181 (diff)
downloadxK-c9b33846cb15555ee419c5e218ce16f05c589d26.tar.gz
xK-c9b33846cb15555ee419c5e218ce16f05c589d26.tar.xz
xK-c9b33846cb15555ee419c5e218ce16f05c589d26.zip
degesch: add an option to beep on highlight
-rw-r--r--degesch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index 69fb927..9cbd3be 100644
--- a/degesch.c
+++ b/degesch.c
@@ -1443,6 +1443,10 @@ static struct config_schema g_config_behaviour[] =
.comment = "Don't leak messages from the server and global buffers",
.type = CONFIG_ITEM_BOOLEAN,
.default_ = "off" },
+ { .name = "beep_on_highlight",
+ .comment = "Beep when highlighted or on a new invisible PM",
+ .type = CONFIG_ITEM_BOOLEAN,
+ .default_ = "on" },
{}
};
@@ -2479,8 +2483,10 @@ log_formatter (struct app_context *ctx,
LIST_APPEND_WITH_TAIL (buffer->lines, buffer->lines_tail, line);
buffer->lines_count++;
- // TODO: beep if so configured and either the line is a highlight,
- // or the buffer is an inactive PM buffer
+ if (get_config_boolean (ctx->config.root, "behaviour.beep_on_highlight"))
+ if ((flags & BUFFER_LINE_HIGHLIGHT)
+ || (buffer->type == BUFFER_PM && buffer != ctx->current_buffer))
+ input_ding (&ctx->input);
if (buffer == ctx->current_buffer)
{