aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index 23d6ac0d..da92030e 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -286,3 +286,28 @@ char *do_var_replacement(char *str) {
}
return str;
}
+
+struct workspace_output *wsop_find_workspace(const char *name) {
+ int i, len = config->workspace_outputs->length;
+ struct workspace_output *wsop;
+ for (i = 0; i < len; ++i) {
+ wsop = config->workspace_outputs->items[i];
+ if (strcasecmp(wsop->workspace, name) == 0) {
+ return wsop;
+ }
+ }
+ return NULL;
+}
+
+struct workspace_output *wsop_find_output(const char *name) {
+ int i, len = config->workspace_outputs->length;
+ struct workspace_output *wsop;
+ for (i = 0; i < len; ++i) {
+ wsop = config->workspace_outputs->items[i];
+ if (strcasecmp(wsop->output, name) == 0) {
+ return wsop;
+ }
+ }
+ return NULL;
+}
+