diff --git a/docs/userguide b/docs/userguide index 96b36902..f7135c6a 100644 --- a/docs/userguide +++ b/docs/userguide @@ -1837,6 +1837,26 @@ bindsym $mod+x move workspace to output right bindsym $mod+x move container to output VGA1 -------------------------------------------------------- +=== Moving containers/workspaces to marks + +To move a container to another container with a specific mark (see <>), +you can use the following command. + +The window will be moved right after the marked container in the tree, i.e., it ends up +in the same position as if you had opened a new window when the marked container was +focused. If the mark is on a split container, the window will appear as a new child +after the currently focused child within that container. + +*Syntax*: +------------------------------------ +move window|container to mark +------------------------------------ + +*Example*: +-------------------------------------------------------- +for_window [instance="tabme"] move window to mark target +-------------------------------------------------------- + [[resizingconfig]] === Resizing containers/windows diff --git a/include/commands.h b/include/commands.h index 0f7e3635..ccb555a4 100644 --- a/include/commands.h +++ b/include/commands.h @@ -132,6 +132,12 @@ void cmd_mode(I3_CMD, char *mode); */ void cmd_move_con_to_output(I3_CMD, char *name); +/** + * Implementation of 'move [window|container] [to] mark '. + * + */ +void cmd_move_con_to_mark(I3_CMD, char *mark); + /** * Implementation of 'floating enable|disable|toggle' * diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec index 87db6cf0..8fe1f569 100644 --- a/parser-specs/commands.spec +++ b/parser-specs/commands.spec @@ -265,6 +265,7 @@ state RENAME_WORKSPACE_NEW_NAME: # move [ [px]] # move [window|container] [to] workspace [|next|prev|next_on_output|prev_on_output|current] # move [window|container] [to] output +# move [window|container] [to] mark # move [window|container] [to] scratchpad # move workspace to [output] # move scratchpad @@ -280,6 +281,8 @@ state MOVE: -> MOVE_WORKSPACE 'output' -> MOVE_TO_OUTPUT + 'mark' + -> MOVE_TO_MARK 'scratchpad' -> call cmd_move_scratchpad() direction = 'left', 'right', 'up', 'down' @@ -321,6 +324,10 @@ state MOVE_TO_OUTPUT: output = string -> call cmd_move_con_to_output($output) +state MOVE_TO_MARK: + mark = string + -> call cmd_move_con_to_mark($mark) + state MOVE_WORKSPACE_TO_OUTPUT: 'output' -> diff --git a/src/commands.c b/src/commands.c index 79071d6b..c81bafb7 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1169,6 +1169,14 @@ void cmd_move_con_to_output(I3_CMD, char *name) { ysuccess(true); } +/* + * Implementation of 'move [container|window] [to] mark '. + * + */ +void cmd_move_con_to_mark(I3_CMD, char *mark) { + ysuccess(true); +} + /* * Implementation of 'floating enable|disable|toggle' *