i3/i3bar/src/main.c

38 lines
653 B
C
Raw Normal View History

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