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 80a36ac7..0509db23 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" @@ -38,3 +39,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; +} |