Autostarting apps switches to that workspace

Hyprland version
`0.55.4`

Describe your issue / feature…

I have been trying to luaify my configs, but I can’t get the autostart functionality I am looking for in thenew system.

I want to start a few apps on certain workspaces. The problem is I switch to them. For example Firefox on w2, thunderbird on w9 but I end up on w9 everytime.

I couldn’t find anything related to this in the new wiki. In the old config we would “silent start” and app to achieve this.

Use the following
follow = false

hl.exec_cmd("firefox",{workspace = 2, follow = false})
this throws out an error saying follow is wrong.

My bad, thought it was a keybind.

You need to make a window rule for that autostart.

Example:

hl.window_rule({
name = “ABC”,
match = { class = “^(ABC)$” },
workspace = “10 silent”,
})

Make sure class is the correct one by looking at hyprctl clients.
Replace workspace to your liking.

I never learnt the window rules, so I never considered them. I guess it is time to learn! They seem really complicated for some reason, but I’ll be fine. Thank you for your help.