Make windows floating before moving them to origin workspace.
Use workspace name when appropriate.
Fixed issue with calculating the next free workspace. When the zencontainer is created, if the last window of a workspace is used to create it. The current workspace will be the zen workspace.
This script depends on i3list and i3var from i3ass.
When the command is triggered it will move the current window to a zen container. The zen container is a floating, tabbed, and zentered container on a clean workspace. If no zen container exist it will be created.
If the current window already is in the zen container it will get moved to the workspace it originally came from.
The previous version used two "ghost windows" to make a tiled container appear centered. But i figured why not use a floating container instead, script is a lot faster and experience better. Now it is also possible to set the height (also in percentage) of the container.
Available environment variables:
ZEN_WIDTH , ZEN_HEIGHT, ZEN_WORKSPACE, ZEN_VERBOSE
@benjaminvdb Great to hear you got it working. Yeah, I applied a patch to i3ass just before updating i3zen, so latest at least version: 2021.10.17.0 of i3ass is needed.
I like the feature you request, but it is a bit tricky to implement, since we need to count the number of windows on the current workspace. Which is possible, but tricky, i have some ideas. A simpler, rougher way to achieve the functionality. Would be to always move to a new workspace (current behavior). Then test if the old workspace still exist. If it doesn't we moved the last window from that workspace, and we simply move the centerzen container back to the workspace (thus creating it again, and destroying the new). I don't think the moving back and forth will be noticeable, since the workspace will appear identical (just the centerzen container).
Thanks for the feedback!