1

I often find myself wanting to move the entire content of one workspace into another. My current method is to—

  1. spam my hotkey for focus parent until I think I've selected the top-level container, then
  2. press my hotkey for move container to workspace $NUM.

However, I often underestimate how nested my layout is, and didn't press focus parent enough times, so I end up moving only part of the windows. It's frustrating.

How can I be sure I've selected the top-level container?


To be clear, I don't want only to be able to move the whole content of a workspace into another, but to get the full generality of running arbitrary commands with the top-level container selected.

  • 1
    seems like the kind of thing a specialty ipc script would be good for. see i3ipc-py and its example scripts. – quixotic Jan 22 '18 at 7:16
0

If I understand correctly, I think you are asking the wrong question. You should not move everything to another workspace, but rename your workspace. You can define a hotkey for this, e.g.

bindsym $alt+s exec i3-input -F 'rename workspace to "%s"' -P 'Destination: '

I realize now that this works only if your other workspace is empty. Is that the case?

  • This is very helpful, but doesn't answer the question fully. The target workspace isn't necessarily empty. – Anko Jan 17 '18 at 13:19
  • Sorry if I was unclear. I'll edit the question to clarify. – Anko Jan 17 '18 at 13:20
  • @Anko No, I think you were clear from the beginning, I just didn't connect all the dots. In this case I cannot help you, I'm afraid! – pfnuesel Jan 17 '18 at 14:35
0

I don't think there's an elegant solution for this problem. As a workaround you could simply repeat the focus parent command before moving the container to make sure you have the top-level container focused. E.g. something like

bindsym $mod+t focus parent, focus parent, focus parent, focus parent

Depending on how nested your layouts get, you might want to repeat it some more to be reasonably sure you have selected the top-level container.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.