aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/status_line.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-10-12 20:59:45 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-10-14 13:33:12 +0100
commita29ee77411be3f3fe988617d91cc5bed603e3dcb (patch)
treea802fd48bb2ea28a8bf972b49ce1eec9f0d38447 /swaybar/status_line.c
parentswaybar: show hidden bar on urgency (diff)
downloadsway-a29ee77411be3f3fe988617d91cc5bed603e3dcb.tar.gz
sway-a29ee77411be3f3fe988617d91cc5bed603e3dcb.tar.zst
sway-a29ee77411be3f3fe988617d91cc5bed603e3dcb.zip
swaybar: send signal to status when hiding or showing bar
Diffstat (limited to 'swaybar/status_line.c')
-rw-r--r--swaybar/status_line.c14
1 files changed, 14 insertions, 0 deletions
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
122struct status_line *status_line_init(char *cmd) { 133struct 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