aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-18 17:43:03 +0100
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-18 18:27:44 +0100
commitede27eabc53dc926aa1932c2a58c06def1000f86 (patch)
tree4d734e99a6163d846423c79a2d7ff04070018e78 /sway/commands.c
parentde219f6bec432e98e419591f6accd516402c0182 (diff)
Reload swaybar/swaybg on config reload.
This works by tracking the pids of the child processes in the related output container and terminating the processes and spawning new ones on a config reload. Should solve: #347
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 24d56052..13bc7dc2 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1094,6 +1094,15 @@ static struct cmd_results *cmd_reload(int argc, char **argv) {
}
if (!load_config(NULL)) return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config.");
+ int i;
+ swayc_t *cont = NULL;
+ for (i = 0; i < root_container.children->length; ++i) {
+ cont = root_container.children->items[i];
+ if (cont->type == C_OUTPUT) {
+ load_swaybars(cont, i);
+ }
+ }
+
arrange_windows(&root_container, -1, -1);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}