mirror of
https://github.com/swaywm/sway.git
synced 2025-11-07 13:29:56 -05:00
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
This commit is contained in:
parent
de219f6bec
commit
ede27eabc5
5 changed files with 125 additions and 44 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue