diff options
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r-- | sway/tree/output.c | 11 |
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 @@ | |||
1 | #include <strings.h> | ||
1 | #include "sway/tree/container.h" | 2 | #include "sway/tree/container.h" |
2 | #include "sway/tree/layout.h" | 3 | #include "sway/tree/layout.h" |
3 | #include "sway/output.h" | 4 | #include "sway/output.h" |
@@ -37,3 +38,13 @@ struct sway_container *container_output_destroy(struct sway_container *output) { | |||
37 | container_destroy(output); | 38 | container_destroy(output); |
38 | return &root_container; | 39 | return &root_container; |
39 | } | 40 | } |
41 | |||
42 | struct sway_container *output_by_name(const char *name) { | ||
43 | for (int i = 0; i < root_container.children->length; ++i) { | ||
44 | struct sway_container *output = root_container.children->items[i]; | ||
45 | if (strcasecmp(output->name, name) == 0){ | ||
46 | return output; | ||
47 | } | ||
48 | } | ||
49 | return NULL; | ||
50 | } | ||