How can I open a new window in a specific workspace? My use case is that I'd my pdf viewer to always open in workspace 5, switch to that workspace, and focus the window.
I've tried the following solutions:
- assign [class="^Evince$"] "5: doc"
This works, but does not switch to workspace 5, nor focusses the new window. My workspace 5 is in tabbed layout, and new windows tend to open underneath the currently selected tab.
- write a script that starts the pdf viewer, then runs
i3-msg move container to workspace "5: doc"
i3-msg workspace "5: doc"
The trouble here is that depending on the currently focussed window and how long the pdf viewer takes to start, the wrong window is moved to workspace 5. I.e., there is no control over which window the i3-msg commands operate on. Note that there may be multiple instances with [class="^Evince$"], so I cannot simply use that.
best regards, Tom