aboutsummaryrefslogtreecommitdiffstats
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, 2 insertions, 12 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c
index ae9383d6..f83b37d1 100644
--- a/sway/config/bar.c
+++ b/sway/config/bar.c
@@ -12,6 +12,7 @@
12#include <strings.h> 12#include <strings.h>
13#include <signal.h> 13#include <signal.h>
14#include "sway/config.h" 14#include "sway/config.h"
15#include "sway/output.h"
15#include "stringop.h" 16#include "stringop.h"
16#include "list.h" 17#include "list.h"
17#include "log.h" 18#include "log.h"
@@ -218,17 +219,6 @@ void invoke_swaybar(struct bar_config *bar) {
218 close(filedes[1]); 219 close(filedes[1]);
219} 220}
220 221
221static bool active_output(const char *name) {
222 struct sway_container *cont = NULL;
223 for (int i = 0; i < root_container.children->length; ++i) {
224 cont = root_container.children->items[i];
225 if (cont->type == C_OUTPUT && strcasecmp(name, cont->name) == 0) {
226 return true;
227 }
228 }
229 return false;
230}
231
232void load_swaybars() { 222void load_swaybars() {
233 for (int i = 0; i < config->bars->length; ++i) { 223 for (int i = 0; i < config->bars->length; ++i) {
234 struct bar_config *bar = config->bars->items[i]; 224 struct bar_config *bar = config->bars->items[i];
@@ -236,7 +226,7 @@ void load_swaybars() {
236 if (bar->outputs) { 226 if (bar->outputs) {
237 for (int j = 0; j < bar->outputs->length; ++j) { 227 for (int j = 0; j < bar->outputs->length; ++j) {
238 char *o = bar->outputs->items[j]; 228 char *o = bar->outputs->items[j];
239 if (!strcmp(o, "*") || active_output(o)) { 229 if (!strcmp(o, "*") || output_by_name(o)) {
240 apply = true; 230 apply = true;
241 break; 231 break;
242 } 232 }