How do I make a terminal on workspace 2 and make it active on startup

Hyprland version
Hyprland 0.55.0 built from branch v0.55.0 at commit af923e30d1d24f1f4a4f5cb8308065173c1d9539 clean (version: bump to 0.55.0).
Date: Sat May 9 13:35:27 2026
Tag: v0.55.0, commits: 7290

Libraries:
Hyprgraphics: built against 0.5.1, system has 0.5.1
Hyprutils: built against 0.13.1, system has 0.13.1
Hyprcursor: built against 0.1.13, system has 0.1.13
Hyprlang: built against 0.6.8, system has 0.6.8
Aquamarine: built against 0.11.0, system has 0.11.0

Version ABI string: af923e30d1d24f1f4a4f5cb8308065173c1d9539_aq_0.11_hu_0.13_hg_0.5_hc_0.1_hlg_0.6
no flags were set

Quick and maybe easy for people who know, but how could i open a terminal at workspace 2 at hyprland.start?

Have a hard time trying to find info on hl.exec_cmd()

I guess there might be a way to name the terminal and then use hl.dsp.window.move on it, but i don’t really know lua to find out how.

This is the closest I have gotten:

hl.on(“hyprland.start”, function ()
hl.exec_cmd(“nm-applet”)
hl.exec_cmd(“waybar & hyprpaper”)
hl.exec_cmd(terminal, hl.dsp.window.move({ workspace = 2}))
end)

think i am getting somewhere… I added a window rule

hl.exec_cmd(terminal, moveTerminal)

local moveTerminal = hl.window_rule({
match = { class = “kitty” },
workspace = 2,
})

This moved it to the right workspace/monitor, but is not active before i move the mouse:(
Can i set active window in the window_rule?

Now am starting to want to pull my hair out….

it’s likely some app requests activation on startup, it’s quite common unfortunately (absolutely mongoloid electron devs usually) and so hyprland focuses them

You can focus apps though, hl.dispatch(hl.dsp.focus({ window = ... }))