diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-14 14:30:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-14 14:30:52 +0200 |
commit | abde9d6627483256ccfd20bdeeaa52d7790b0426 (patch) | |
tree | a851a6f4f6356470123d5d870c5d12fb9de78f73 /sway/config | |
parent | dbb169bf1588b524bde8a2b7bfb83d5e2bb9b506 (diff) | |
parent | 2a0c7ebd43a82197754586de32deb3cdbbfa3cd9 (diff) | |
download | sway-abde9d6627483256ccfd20bdeeaa52d7790b0426.tar.xz |
Merge pull request #2808 from RedSoxFan/bar-subcommands
Fix bar subcommand handler structs and selection
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/bar.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c index c6899f57..5726e95b 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c @@ -226,13 +226,17 @@ static void invoke_swaybar(struct bar_config *bar) { close(filedes[1]); } +void load_swaybar(struct bar_config *bar) { + if (bar->pid != 0) { + terminate_swaybar(bar->pid); + } + wlr_log(WLR_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); + invoke_swaybar(bar); +} + void load_swaybars(void) { for (int i = 0; i < config->bars->length; ++i) { struct bar_config *bar = config->bars->items[i]; - if (bar->pid != 0) { - terminate_swaybar(bar->pid); - } - wlr_log(WLR_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); - invoke_swaybar(bar); + load_swaybar(bar); } } |