diff options
Diffstat (limited to 'swaybar/status_line.c')
-rw-r--r-- | swaybar/status_line.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c index ed6dc7c8..65d6c052 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c | |||
@@ -7,16 +7,16 @@ | |||
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | #include <wlr/util/log.h> | 9 | #include <wlr/util/log.h> |
10 | #include "loop.h" | ||
10 | #include "swaybar/bar.h" | 11 | #include "swaybar/bar.h" |
11 | #include "swaybar/config.h" | 12 | #include "swaybar/config.h" |
12 | #include "swaybar/i3bar.h" | 13 | #include "swaybar/i3bar.h" |
13 | #include "swaybar/event_loop.h" | ||
14 | #include "swaybar/status_line.h" | 14 | #include "swaybar/status_line.h" |
15 | #include "readline.h" | 15 | #include "readline.h" |
16 | 16 | ||
17 | static void status_line_close_fds(struct status_line *status) { | 17 | static void status_line_close_fds(struct status_line *status) { |
18 | if (status->read_fd != -1) { | 18 | if (status->read_fd != -1) { |
19 | remove_event(status->read_fd); | 19 | loop_remove_fd(status->bar->eventloop, status->read_fd); |
20 | close(status->read_fd); | 20 | close(status->read_fd); |
21 | status->read_fd = -1; | 21 | status->read_fd = -1; |
22 | } | 22 | } |
@@ -83,6 +83,17 @@ bool status_handle_readable(struct status_line *status) { | |||
83 | return true; | 83 | return true; |
84 | } | 84 | } |
85 | } | 85 | } |
86 | |||
87 | json_object *signal; | ||
88 | if (json_object_object_get_ex(header, "stop_signal", &signal)) { | ||
89 | status->stop_signal = json_object_get_int(signal); | ||
90 | wlr_log(WLR_DEBUG, "Setting stop signal to %d", status->stop_signal); | ||
91 | } | ||
92 | if (json_object_object_get_ex(header, "cont_signal", &signal)) { | ||
93 | status->cont_signal = json_object_get_int(signal); | ||
94 | wlr_log(WLR_DEBUG, "Setting cont signal to %d", status->cont_signal); | ||
95 | } | ||
96 | |||
86 | json_object_put(header); | 97 | json_object_put(header); |
87 | 98 | ||
88 | wl_list_init(&status->blocks); | 99 | wl_list_init(&status->blocks); |
@@ -121,6 +132,9 @@ bool status_handle_readable(struct status_line *status) { | |||
121 | 132 | ||
122 | struct status_line *status_line_init(char *cmd) { | 133 | struct status_line *status_line_init(char *cmd) { |
123 | struct status_line *status = calloc(1, sizeof(struct status_line)); | 134 | struct status_line *status = calloc(1, sizeof(struct status_line)); |
135 | status->stop_signal = SIGSTOP; | ||
136 | status->cont_signal = SIGCONT; | ||
137 | |||
124 | status->buffer_size = 8192; | 138 | status->buffer_size = 8192; |
125 | status->buffer = malloc(status->buffer_size); | 139 | status->buffer = malloc(status->buffer_size); |
126 | 140 | ||