Added configuration directive for 'move [container|window] [to] mark <str>'

This commit is contained in:
Ingo Bürk 2015-04-12 17:30:31 +02:00
parent 8a608ee63a
commit 9613a0744d
4 changed files with 41 additions and 0 deletions

View File

@ -1837,6 +1837,26 @@ bindsym $mod+x move workspace to output right
bindsym $mod+x move container to output VGA1 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 <<vim_like_marks>>),
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 <mark>
------------------------------------
*Example*:
--------------------------------------------------------
for_window [instance="tabme"] move window to mark target
--------------------------------------------------------
[[resizingconfig]] [[resizingconfig]]
=== Resizing containers/windows === Resizing containers/windows

View File

@ -132,6 +132,12 @@ void cmd_mode(I3_CMD, char *mode);
*/ */
void cmd_move_con_to_output(I3_CMD, char *name); void cmd_move_con_to_output(I3_CMD, char *name);
/**
* Implementation of 'move [window|container] [to] mark <str>'.
*
*/
void cmd_move_con_to_mark(I3_CMD, char *mark);
/** /**
* Implementation of 'floating enable|disable|toggle' * Implementation of 'floating enable|disable|toggle'
* *

View File

@ -265,6 +265,7 @@ state RENAME_WORKSPACE_NEW_NAME:
# move <direction> [<pixels> [px]] # move <direction> [<pixels> [px]]
# move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current] # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
# move [window|container] [to] output <str> # move [window|container] [to] output <str>
# move [window|container] [to] mark <str>
# move [window|container] [to] scratchpad # move [window|container] [to] scratchpad
# move workspace to [output] <str> # move workspace to [output] <str>
# move scratchpad # move scratchpad
@ -280,6 +281,8 @@ state MOVE:
-> MOVE_WORKSPACE -> MOVE_WORKSPACE
'output' 'output'
-> MOVE_TO_OUTPUT -> MOVE_TO_OUTPUT
'mark'
-> MOVE_TO_MARK
'scratchpad' 'scratchpad'
-> call cmd_move_scratchpad() -> call cmd_move_scratchpad()
direction = 'left', 'right', 'up', 'down' direction = 'left', 'right', 'up', 'down'
@ -321,6 +324,10 @@ state MOVE_TO_OUTPUT:
output = string output = string
-> call cmd_move_con_to_output($output) -> 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: state MOVE_WORKSPACE_TO_OUTPUT:
'output' 'output'
-> ->

View File

@ -1169,6 +1169,14 @@ void cmd_move_con_to_output(I3_CMD, char *name) {
ysuccess(true); ysuccess(true);
} }
/*
* Implementation of 'move [container|window] [to] mark <str>'.
*
*/
void cmd_move_con_to_mark(I3_CMD, char *mark) {
ysuccess(true);
}
/* /*
* Implementation of 'floating enable|disable|toggle' * Implementation of 'floating enable|disable|toggle'
* *