]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/child.c
Added background and border keys to the i3bar protocol.
[i3/i3] / i3bar / src / child.c
index 2b10be492b576281510fc20ce7bed9ebe4eedaf6..3570dde91ac6f9e1aa63c2bfc1bda53499a4747c 100644 (file)
@@ -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;