]> git.sur5r.net Git - i3/i3/commitdiff
add "move workspace next" and "move workspace prev"
authorNoe Rubinstein <noe.rubinstein@gmail.com>
Sun, 2 Oct 2011 15:55:19 +0000 (17:55 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 2 Oct 2011 21:03:47 +0000 (22:03 +0100)
some factorization would be better here, however I don't really know my
way around bison

src/cmdparse.y

index 252f6dff4c1511753336cb7913e0566d1b6766bf..da962cf46b6cbed45188a4a63ee34d6aa4e4c1b1 100644 (file)
@@ -715,6 +715,38 @@ move:
 
         tree_render();
     }
+    | TOK_MOVE TOK_WORKSPACE TOK_NEXT
+    {
+        owindow *current;
+
+        /* get the workspace */
+        Con *ws = workspace_next();
+
+        HANDLE_EMPTY_MATCH;
+
+        TAILQ_FOREACH(current, &owindows, owindows) {
+            printf("matching: %p / %s\n", current->con, current->con->name);
+            con_move_to_workspace(current->con, ws, true, false);
+        }
+
+        tree_render();
+    }
+    | TOK_MOVE TOK_WORKSPACE TOK_PREV
+    {
+        owindow *current;
+
+        /* get the workspace */
+        Con *ws = workspace_prev();
+
+        HANDLE_EMPTY_MATCH;
+
+        TAILQ_FOREACH(current, &owindows, owindows) {
+            printf("matching: %p / %s\n", current->con, current->con->name);
+            con_move_to_workspace(current->con, ws, true, false);
+        }
+
+        tree_render();
+    }
     | TOK_MOVE TOK_OUTPUT STR
     {
         owindow *current;