]> git.sur5r.net Git - i3/i3/blobdiff - src/load_layout.c
Allow changing the layout of workspaces by storing it (Thanks mhcerri)
[i3/i3] / src / load_layout.c
index 795fb6d8ce516e86ecb9e40df40751bdae09b4a8..cce1a7127da9f660d4282e52cb8d521e743d6fa3 100644 (file)
@@ -211,6 +211,17 @@ static int json_string(void *ctx, const unsigned char *val, unsigned int len) {
                 json_node->layout = L_SPLITV;
             else LOG("Unhandled \"layout\": %s\n", buf);
             free(buf);
+        } else if (strcasecmp(last_key, "workspace_layout") == 0) {
+            char *buf = NULL;
+            sasprintf(&buf, "%.*s", (int)len, val);
+            if (strcasecmp(buf, "default") == 0)
+                json_node->workspace_layout = L_DEFAULT;
+            else if (strcasecmp(buf, "stacked") == 0)
+                json_node->workspace_layout = L_STACKED;
+            else if (strcasecmp(buf, "tabbed") == 0)
+                json_node->workspace_layout = L_TABBED;
+            else LOG("Unhandled \"workspace_layout\": %s\n", buf);
+            free(buf);
         } else if (strcasecmp(last_key, "last_split_layout") == 0) {
             char *buf = NULL;
             sasprintf(&buf, "%.*s", (int)len, val);