Fix colors in i3bar (Thanks julien)
i3bar previously used get_colorpixel on strings without the leading # (ff0000 instead of #ff0000). Since it uses libi3’s get_colorpixel now we needed to update a few places.
This commit is contained in:
parent
91ae73b1f6
commit
ada4857ad2
10
docs/ipc
10
docs/ipc
|
@ -475,7 +475,7 @@ verbose (boolean)::
|
||||||
Should the bar enable verbose output for debugging? Defaults to false.
|
Should the bar enable verbose output for debugging? Defaults to false.
|
||||||
colors (map)::
|
colors (map)::
|
||||||
Contains key/value pairs of colors. Each value is a color code in hex,
|
Contains key/value pairs of colors. Each value is a color code in hex,
|
||||||
formatted rrggbb (like used in HTML).
|
formatted #rrggbb (like in HTML).
|
||||||
|
|
||||||
The following colors can be configured at the moment:
|
The following colors can be configured at the moment:
|
||||||
|
|
||||||
|
@ -516,10 +516,10 @@ urgent_workspace_text/urgent_workspace_bar::
|
||||||
"workspace_buttons": true,
|
"workspace_buttons": true,
|
||||||
"verbose": false,
|
"verbose": false,
|
||||||
"colors": {
|
"colors": {
|
||||||
"background": "c0c0c0",
|
"background": "#c0c0c0",
|
||||||
"statusline": "00ff00",
|
"statusline": "#00ff00",
|
||||||
"focused_workspace_text": "ffffff",
|
"focused_workspace_text": "#ffffff",
|
||||||
"focused_workspace_bg": "000000"
|
"focused_workspace_bg": "#000000"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--------------
|
--------------
|
||||||
|
|
|
@ -294,16 +294,16 @@ void init_colors(const struct xcb_color_strings_t *new_colors) {
|
||||||
do { \
|
do { \
|
||||||
colors.name = get_colorpixel(new_colors->name ? new_colors->name : def); \
|
colors.name = get_colorpixel(new_colors->name ? new_colors->name : def); \
|
||||||
} while (0)
|
} while (0)
|
||||||
PARSE_COLOR(bar_fg, "FFFFFF");
|
PARSE_COLOR(bar_fg, "#FFFFFF");
|
||||||
PARSE_COLOR(bar_bg, "000000");
|
PARSE_COLOR(bar_bg, "#000000");
|
||||||
PARSE_COLOR(active_ws_fg, "888888");
|
PARSE_COLOR(active_ws_fg, "#888888");
|
||||||
PARSE_COLOR(active_ws_bg, "222222");
|
PARSE_COLOR(active_ws_bg, "#222222");
|
||||||
PARSE_COLOR(inactive_ws_fg, "888888");
|
PARSE_COLOR(inactive_ws_fg, "#888888");
|
||||||
PARSE_COLOR(inactive_ws_bg, "222222");
|
PARSE_COLOR(inactive_ws_bg, "#222222");
|
||||||
PARSE_COLOR(urgent_ws_fg, "FFFFFF");
|
PARSE_COLOR(urgent_ws_fg, "#FFFFFF");
|
||||||
PARSE_COLOR(urgent_ws_bg, "900000");
|
PARSE_COLOR(urgent_ws_bg, "#900000");
|
||||||
PARSE_COLOR(focus_ws_fg, "FFFFFF");
|
PARSE_COLOR(focus_ws_fg, "#FFFFFF");
|
||||||
PARSE_COLOR(focus_ws_bg, "285577");
|
PARSE_COLOR(focus_ws_bg, "#285577");
|
||||||
#undef PARSE_COLOR
|
#undef PARSE_COLOR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ EOL (\r?\n)
|
||||||
<BAR_COLORS>active_workspace { BAR_DOUBLE_COLOR; return TOK_BAR_COLOR_ACTIVE_WORKSPACE; }
|
<BAR_COLORS>active_workspace { BAR_DOUBLE_COLOR; return TOK_BAR_COLOR_ACTIVE_WORKSPACE; }
|
||||||
<BAR_COLORS>inactive_workspace { BAR_DOUBLE_COLOR; return TOK_BAR_COLOR_INACTIVE_WORKSPACE; }
|
<BAR_COLORS>inactive_workspace { BAR_DOUBLE_COLOR; return TOK_BAR_COLOR_INACTIVE_WORKSPACE; }
|
||||||
<BAR_COLORS>urgent_workspace { BAR_DOUBLE_COLOR; return TOK_BAR_COLOR_URGENT_WORKSPACE; }
|
<BAR_COLORS>urgent_workspace { BAR_DOUBLE_COLOR; return TOK_BAR_COLOR_URGENT_WORKSPACE; }
|
||||||
<BAR_COLOR>#[0-9a-fA-F]+ { yy_pop_state(); yylval.string = sstrdup(yytext+1); return HEXCOLOR; }
|
<BAR_COLOR>#[0-9a-fA-F]+ { yy_pop_state(); yylval.string = sstrdup(yytext); return HEXCOLOR; }
|
||||||
<BAR,BAR_COLORS,BAR_MODE,BAR_POSITION>[a-zA-Z]+ { yylval.string = sstrdup(yytext); return WORD; }
|
<BAR,BAR_COLORS,BAR_MODE,BAR_POSITION>[a-zA-Z]+ { yylval.string = sstrdup(yytext); return WORD; }
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue