diff options
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/bar.c | 4 | ||||
-rw-r--r-- | swaybar/status_line.c | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index 6894383d..f636f0c9 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c | |||
@@ -396,6 +396,10 @@ bool determine_bar_visibility(struct swaybar *bar, bool moving_layer) { | |||
396 | destroy_layer_surface(output); | 396 | destroy_layer_surface(output); |
397 | } | 397 | } |
398 | } | 398 | } |
399 | wlr_log(WLR_DEBUG, "Sending %s signal to status command", | ||
400 | visible ? "cont" : "stop"); | ||
401 | kill(bar->status->pid, | ||
402 | visible ? bar->status->cont_signal : bar->status->stop_signal); | ||
399 | } | 403 | } |
400 | return visible; | 404 | return visible; |
401 | } | 405 | } |
diff --git a/swaybar/status_line.c b/swaybar/status_line.c index ed6dc7c8..000609ce 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c | |||
@@ -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 | ||