diff options
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r-- | swaybar/bar.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index e1d594b4..433e2948 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include "swaybar/config.h" | 14 | #include "swaybar/config.h" |
15 | #include "swaybar/event_loop.h" | 15 | #include "swaybar/event_loop.h" |
16 | #include "swaybar/bar.h" | 16 | #include "swaybar/bar.h" |
17 | #include "swaybar/ipc.h" | ||
18 | #include "ipc-client.h" | ||
17 | #include "list.h" | 19 | #include "list.h" |
18 | #include "pango.h" | 20 | #include "pango.h" |
19 | #include "pool-buffer.h" | 21 | #include "pool-buffer.h" |
@@ -92,6 +94,10 @@ void bar_setup(struct swaybar *bar, | |||
92 | bar_init(bar); | 94 | bar_init(bar); |
93 | init_event_loop(); | 95 | init_event_loop(); |
94 | 96 | ||
97 | bar->ipc_socketfd = ipc_open_socket(socket_path); | ||
98 | bar->ipc_event_socketfd = ipc_open_socket(socket_path); | ||
99 | ipc_get_config(bar, bar_id); | ||
100 | |||
95 | assert(bar->display = wl_display_connect(NULL)); | 101 | assert(bar->display = wl_display_connect(NULL)); |
96 | 102 | ||
97 | struct wl_registry *registry = wl_display_get_registry(bar->display); | 103 | struct wl_registry *registry = wl_display_get_registry(bar->display); |
@@ -122,6 +128,11 @@ static void display_in(int fd, short mask, void *_bar) { | |||
122 | } | 128 | } |
123 | } | 129 | } |
124 | 130 | ||
131 | static void ipc_in(int fd, short mask, void *_bar) { | ||
132 | struct swaybar *bar = (struct swaybar *)_bar; | ||
133 | handle_ipc_event(bar); | ||
134 | } | ||
135 | |||
125 | void bar_run(struct swaybar *bar) { | 136 | void bar_run(struct swaybar *bar) { |
126 | add_event(wl_display_get_fd(bar->display), POLLIN, display_in, bar); | 137 | add_event(wl_display_get_fd(bar->display), POLLIN, display_in, bar); |
127 | while (1) { | 138 | while (1) { |