Added background and border keys to the i3bar protocol.
This patch adds two new status block keys, background and border, which define the respective colors for the status block. If not specified, the current behavior is kept, e.g., no background / border will be drawn. If the status block is marked urgent, the urgent color is prioritized. fixes #2022
This commit is contained in:
@ -75,6 +75,8 @@ static void clear_statusline(struct statusline_head *head, bool free_resources)
|
||||
FREE(first->name);
|
||||
FREE(first->instance);
|
||||
FREE(first->min_width_str);
|
||||
FREE(first->background);
|
||||
FREE(first->border);
|
||||
}
|
||||
|
||||
TAILQ_REMOVE(head, first, blocks);
|
||||
@ -205,6 +207,14 @@ static int stdin_string(void *context, const unsigned char *val, size_t len) {
|
||||
sasprintf(&(ctx->block.color), "%.*s", len, val);
|
||||
return 1;
|
||||
}
|
||||
if (strcasecmp(ctx->last_map_key, "background") == 0) {
|
||||
sasprintf(&(ctx->block.background), "%.*s", len, val);
|
||||
return 1;
|
||||
}
|
||||
if (strcasecmp(ctx->last_map_key, "border") == 0) {
|
||||
sasprintf(&(ctx->block.border), "%.*s", len, val);
|
||||
return 1;
|
||||
}
|
||||
if (strcasecmp(ctx->last_map_key, "markup") == 0) {
|
||||
ctx->block.pango_markup = (len == strlen("pango") && !strncasecmp((const char *)val, "pango", strlen("pango")));
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user