Implement 'swap' command.

This patch introduces a new command 'swap' that swaps two containers so
that they assume each other's position and geometry.

fixes #917
This commit is contained in:
Ingo Bürk
2016-02-26 22:39:44 +01:00
parent 9bc504ebdb
commit 5f9a5e8d7d
13 changed files with 794 additions and 46 deletions

View File

@ -1976,6 +1976,39 @@ bindsym $mod+c move absolute position center
bindsym $mod+m move position mouse
-------------------------------------------------------
=== Swapping containers
Two containers can be swapped (i.e., move to each other's position) by using
the +swap+ command. They will assume the position and geometry of the container
they are swapped with.
The first container to participate in the swapping can be selected through the
normal command criteria process with the focused window being the usual
fallback if no criteria are specified. The second container can be selected
using one of the following methods:
+id+:: The X11 window ID of a client window.
+con_id+:: The i3 container ID of a container.
+mark+:: A container with the specified mark, see <<vim_like_marks>>.
Note that swapping does not work with all containers. Most notably, swapping
floating containers or containers that have a parent-child relationship to one
another does not work.
*Syntax*:
----------------------------------------
swap container with id|con_id|mark <arg>
----------------------------------------
*Examples*:
-----------------------------------------------------------------
# Swaps the focused container with the container marked »swapee«.
swap container with mark swapee
# Swaps container marked »A« and »B«
[con_mark="^A$"] swap container with mark B
-----------------------------------------------------------------
=== Sticky floating windows
If you want a window to stick to the glass, i.e., have it stay on screen even