The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
2

Move any container directly where the last split was done

asked 2014-02-03 22:06:41 +0000

Spheerys gravatar image

When I am on a workspace and I want to move a container, I don't like to move it with top/right/bottom/left move bindkeys (to much moves for me!!).

I prefer to do like this :

  1. I make the split somewhere
  2. I make floated the container I want to move
  3. I immediatly make it unfloated (and it goes to the right place, where I made the split)

But I'm looking for a way to make the step 2 and 3 with one bindkey (on one step).

Is it possible ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2014-02-04 06:11:45 +0000

Adaephon gravatar image

updated 2015-10-07 14:03:30 +0000

Yes.

First use mark to save, where the last split happened. Just chain it to your normal split commands:

bindsym $mod+h split horizontal; mark lastsplit
bindsym $mod+v split vertical; mark lastsplit

Now you can move a window to the mark by one of these two methods, depending on your version of i3:

  • Since version 4.11 you can use the following to move to a mark.

    bindsym $mod+m move window to mark lastsplit
    
  • for older versions there is no direct way to move a window to a split. But there is a workaround using the scratchpad:

    When 'unfloating' a window, i3 drops it where it would also create a new window: just next to the focused (and tiled) one. So the window with the last split has to be focused immediately before disabling floating:

    bindsym $mod+m mark movethis; move scratchpad; [con_mark="^lastsplit$"] focus; [con_mark="^movethis$"] scratchpad show, floating disable
    

Now, on $mod+m the currently focused window will be moved to the last split. You can even move multiple windows to the same split.

Also, some binding to just set the mark, without splitting could come in handy.

edit flag offensive delete link more

Comments

There is an error : ``` ERROR: Expected one of these tokens: 'class', 'instance', 'window_role', 'con_id', 'id', 'con_mark', 'title', 'urgent', ']' ERROR: Your command: mark movethis; floating enable; [con_mark="^lastsplit$"] focus; [con_mark="^movethis$] focus, floating disable ```

Spheerys gravatar imageSpheerys ( 2014-02-04 10:01:07 +0000 )edit

It's missing a quote. The correct line is : ``` bindsym $mod+m mark movethis; floating enable; [con_mark="^lastsplit$"] focus; [con_mark="^movethis$"] focus, floating disable ```

Spheerys gravatar imageSpheerys ( 2014-02-04 16:16:48 +0000 )edit

@Spheerys: Thanks, I fixed it.

Adaephon gravatar imageAdaephon ( 2014-02-04 21:21:47 +0000 )edit

Question Tools

Stats

Asked: 2014-02-03 22:06:41 +0000

Seen: 268 times

Last updated: Oct 07