Introduce a config directive 'binding_mode' in the 'bar' config, pass it through the IPC and parse it in i3bar.
This commit is contained in:
@ -106,6 +106,9 @@ struct xcb_colors_t {
|
||||
uint32_t focus_ws_bg;
|
||||
uint32_t focus_ws_fg;
|
||||
uint32_t focus_ws_border;
|
||||
uint32_t binding_mode_bg;
|
||||
uint32_t binding_mode_fg;
|
||||
uint32_t binding_mode_border;
|
||||
};
|
||||
struct xcb_colors_t colors;
|
||||
|
||||
@ -374,6 +377,18 @@ void init_colors(const struct xcb_color_strings_t *new_colors) {
|
||||
PARSE_COLOR(focus_ws_border, "#4c7899");
|
||||
#undef PARSE_COLOR
|
||||
|
||||
#define PARSE_COLOR_FALLBACK(name, fallback) \
|
||||
do { \
|
||||
colors.name = new_colors->name ? get_colorpixel(new_colors->name) : colors.fallback; \
|
||||
} while (0)
|
||||
|
||||
/* For the binding mode indicator colors, we don't hardcode a default.
|
||||
* Instead, we fall back to urgent_ws_* colors. */
|
||||
PARSE_COLOR_FALLBACK(binding_mode_fg, urgent_ws_fg);
|
||||
PARSE_COLOR_FALLBACK(binding_mode_bg, urgent_ws_bg);
|
||||
PARSE_COLOR_FALLBACK(binding_mode_border, urgent_ws_border);
|
||||
#undef PARSE_COLOR_FALLBACK
|
||||
|
||||
init_tray_colors();
|
||||
xcb_flush(xcb_connection);
|
||||
}
|
||||
|
Reference in New Issue
Block a user