i3bar: reinit colors on barconfig update

Allows bar colors to be updated on barconfig update events, such as with
the ipc command `reload`.
This commit is contained in:
Tony Crisci 2014-05-02 19:56:12 -04:00 committed by Michael Stapelberg
parent 4126c87daf
commit c3d46c9145
1 changed files with 5 additions and 0 deletions

View File

@ -159,6 +159,8 @@ void got_bar_config_update(char *event) {
if (found_id == NULL) if (found_id == NULL)
return; return;
free_colors(&(config.colors));
/* update the configuration with the received settings */ /* update the configuration with the received settings */
DLOG("Received bar config update \"%s\"\n", event); DLOG("Received bar config update \"%s\"\n", event);
bar_display_mode_t old_mode = config.hide_on_modifier; bar_display_mode_t old_mode = config.hide_on_modifier;
@ -167,6 +169,9 @@ void got_bar_config_update(char *event) {
reconfig_windows(true); reconfig_windows(true);
} }
init_colors(&(config.colors));
realloc_sl_buffer();
draw_bars(false); draw_bars(false);
} }