aboutsummaryrefslogtreecommitdiff
path: root/sway/config/bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config/bar.c')
-rw-r--r--sway/config/bar.c14
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);
}
}