aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-04-02 14:06:04 -0400
committerTony Crisci <tony@dubstepdish.com>2018-04-02 14:06:04 -0400
commit2187684bd09928748f8b3a82c2e25e5ae82f5ae6 (patch)
treee70e2862280a410f8f0d617abc3539d6f0ae056e /sway/tree/output.c
parentb5d49cc4e86b5da5a3479c2d2a763be50184f75d (diff)
parent2a8985a3451f8be7e4b1eb21e3266e9f5b979b39 (diff)
downloadsway-2187684bd09928748f8b3a82c2e25e5ae82f5ae6.tar.xz
Merge branch 'wlroots' into split-containers
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 7248fd00..2331dc2b 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -1,3 +1,4 @@
+#include <strings.h>
#include "sway/tree/container.h"
#include "sway/tree/layout.h"
#include "sway/output.h"
@@ -37,3 +38,13 @@ struct sway_container *container_output_destroy(struct sway_container *output) {
container_destroy(output);
return &root_container;
}
+
+struct sway_container *output_by_name(const char *name) {
+ for (int i = 0; i < root_container.children->length; ++i) {
+ struct sway_container *output = root_container.children->items[i];
+ if (strcasecmp(output->name, name) == 0){
+ return output;
+ }
+ }
+ return NULL;
+}