make status_commands variable functional

This commit is contained in:
kolunmi 2023-02-18 21:02:08 -07:00
parent 23bf1d2bb0
commit d25242c299

6
dwlb.c
View File

@ -269,7 +269,6 @@ draw_text(char *text,
uint32_t color_ind = 0;
for (char *p = text; *p; p++) {
/* Check for color changes */
if (state == UTF8_ACCEPT) {
if (colors && (draw_fg || draw_bg)) {
while (color_ind < colors_l && p == colors[color_ind].start) {
@ -1017,6 +1016,7 @@ set_status(Bar *bar, char *text)
bar->status_colors_l = 0;
bar->status_buttons_l = 0;
if (status_commands) {
size_t str_pos = 0;
uint32_t codepoint;
uint32_t state = UTF8_ACCEPT;
@ -1096,8 +1096,10 @@ set_status(Bar *bar, char *text)
bar->status[str_pos++] = *p;
utf8decode(&state, &codepoint, *p);
}
bar->status[str_pos] = '\0';
} else {
snprintf(bar->status, sizeof bar->status, "%s", text);
}
}
static void