* ipc.c: Communicating with i3
*
*/
+#include "common.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sanitizer/lsan_interface.h>
#endif
-#include "common.h"
-
ev_io *i3_connection;
const char *sock_path;
*
*/
void got_output_reply(char *reply) {
+ DLOG("Clearing old output configuration...\n");
+ free_outputs();
+
DLOG("Parsing outputs JSON...\n");
parse_outputs_json(reply);
DLOG("Reconfiguring windows...\n");
kick_tray_clients(o_walk);
}
+ if (!config.disable_ws) {
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+ }
+
draw_bars(false);
}
init_colors(&(config.colors));
start_child(config.command);
- FREE(config.command);
}
/* Data structure to easily call the reply handlers later */
/* update the configuration with the received settings */
DLOG("Received bar config update \"%s\"\n", event);
+ char *old_command = config.command ? sstrdup(config.command) : NULL;
bar_display_mode_t old_mode = config.hide_on_modifier;
parse_config_json(event);
if (old_mode != config.hide_on_modifier) {
init_xcb_late(config.fontname);
init_colors(&(config.colors));
+ /* restart status command process */
+ if (old_command && strcmp(old_command, config.command) != 0) {
+ kill_child();
+ start_child(config.command);
+ }
+ free(old_command);
+
draw_bars(false);
}