2010-07-23 04:43:43 +02:00
|
|
|
#include <stdio.h>
|
2010-07-23 05:04:13 +02:00
|
|
|
#include <i3/ipc.h>
|
2010-07-23 04:43:43 +02:00
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2010-07-26 23:51:51 +02:00
|
|
|
#include <stdlib.h>
|
2010-08-04 03:34:18 +02:00
|
|
|
#include <errno.h>
|
2010-07-23 04:43:43 +02:00
|
|
|
#include <ev.h>
|
|
|
|
|
2010-07-22 01:15:18 +02:00
|
|
|
#include "common.h"
|
2010-08-04 03:34:18 +02:00
|
|
|
|
2010-07-22 01:15:18 +02:00
|
|
|
int main(int argc, char **argv) {
|
2010-08-03 21:20:11 +02:00
|
|
|
main_loop = ev_default_loop(0);
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
init_xcb();
|
|
|
|
init_connection("/home/mero/.i3/ipc.sock");
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
subscribe_events();
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
|
|
|
|
i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
|
2010-07-23 05:04:13 +02:00
|
|
|
|
2010-08-04 03:34:18 +02:00
|
|
|
start_child("i3status");
|
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
ev_loop(main_loop, 0);
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-08-05 05:09:59 +02:00
|
|
|
kill_child();
|
2010-08-04 04:07:16 +02:00
|
|
|
|
|
|
|
FREE(statusline);
|
2010-07-26 23:51:51 +02:00
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
clean_xcb();
|
2010-08-05 05:09:59 +02:00
|
|
|
ev_default_destroy();
|
2010-07-30 03:11:54 +02:00
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
free_workspaces();
|
|
|
|
FREE_SLIST(outputs, i3_output);
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-08-03 21:20:11 +02:00
|
|
|
return 0;
|
2010-07-22 01:15:18 +02:00
|
|
|
}
|