* workspaces. Everything else (creating the bars, showing the right workspace-
* buttons and more) is taken care of by the event-drivenness of the code */
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
+
+ free_colors(&(config.colors));
parse_config_json(reply);
/* Now we can actually use 'config', so let's subscribe to the appropriate
/* Resolve color strings to colorpixels and save them, then free the strings. */
init_colors(&(config.colors));
- free_colors(&(config.colors));
/* The name of this function is actually misleading. Even if no command is
* specified, this function initiates the watchers to listen on stdin and
}
}
+/*
+ * Called, when a mode-event arrives (i3 changed binding mode).
+ *
+ */
+void got_mode_event(char *event) {
+ DLOG("Got Mode Event!\n");
+ parse_mode_json(event);
+ draw_bars(false);
+}
+
+
/* Data-structure to easily call the reply-handlers later */
handler_t event_handlers[] = {
&got_workspace_event,
- &got_output_event
+ &got_output_event,
+ &got_mode_event
};
/*
*/
void subscribe_events(void) {
if (config.disable_ws) {
- i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"output\" ]");
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"output\", \"mode\" ]");
} else {
- i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"workspace\", \"output\" ]");
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[ \"workspace\", \"output\", \"mode\" ]");
}
}