Greetings to those who have made headway setting up sway… I’m trying to see if I can make the transition from i3wm and the jury is still out. Here’s my latest challenge:
Tl;dr: How do you start up sway with various programs opened across various workspaces, but not be stuck with these assignments for the entire session?
In i3wm you can set up a program to open during logon in a particular workspace (via autostart configs). That program can subsequently be opened by the user in other workspaces, too. It’s not fixed to open only in that same initial single workspace assignment for all time. You can auto-open a terminal in workspace #1 during startup, but later on open other terminal instances in various other workspaces.)
Challenge: I cannot get this same behavior to work in sway.
Sure, I can assign kitty to autostart in workspace #1 upon startup (in a ‘workspace’ or ‘autostart’ config file) . But any future instances of kitty will then only open in workspace #1 - regardless of which other workspace has focus at the time.
What’s more, when I run ranger file mgr (specifically: exec kitty -e ranger) then it too will only open in workspace #1 due to the kitty connection. And this initial assignment affects not only the initial terminal instance during autostart but persists throughout the entire sway session.
On the other hand: If I avoid making a workspace assignment during the autostart routine, then all of the various programs opened on startup all get crammed into workspace #1. I have to then manually move them over to various other workspaces where I’d like them to be after startup.
I’ve tried messing with the swaymsg command and the move command. So far, no luck.
Of course I’ve searched online quite a bit and find that many have asked to solve this… but no one seems to have come up with a solution yet. So I’m tempted to conclude it cannot be done.
But this is such a basic use case - i.e., starting up a session with various programs appearing in various individual workspaces without being stuck with those assignments going forward - I’m convinced there’s got to be way to achieve this. Sway is far more sophisticated and programmable than i3wm, right?
But thus far I’m stumped.
Anyone figure this one out? If so I’d sure appreciate knowing how you’ve done it! ![]()