Stop Lua autostart apps jumping back to the workspace you started on
Discussion 16137 (v0.56.2, 2026-09-04) states exactly this: processes started by hl.exec_cmd inside hl.on("hyprland.start") get HL_INITIAL_WORKSPACE_TOKEN, the legacy exec-once path is exempt because m_isLaunchingExecOnce only wraps that loop, and it gives the 'unset HL_INITIAL_WORKSPACE_TOKEN; cmd' workaround. The current config-options wiki confirms misc.initial_workspace_tracking defaults to 1 (0 disabled, 1 single-shot, 2 persistent). The Omarchy claim was confirmed on this machine: /usr/share/omarchy/default/hypr/looknfeel.lua sets initial_workspace_tracking = 0, the same line is on the quattro branch, and the read-only query hyprctl getoption misc:initial_workspace_tracking returns int: 0, set: true. The hl.config misc form in the fix matches what Omarchy itself ships. The token behaviour itself was not reproduced here.
Symptom
After moving the config from hyprland.conf to hyprland.lua, apps autostarted in hl.on("hyprland.start", ...) open on workspace 1 even though you already switched to another workspace while they were loading. With exec-once in the old config they opened where you were.
Cause
Hyprland 0.56.2 gives processes started by hl.exec_cmd inside the Lua hyprland.start event the HL_INITIAL_WORKSPACE_TOKEN variable. The legacy exec-once path is exempt and the Lua path is not. With misc.initial_workspace_tracking = 1 (the default), a window that maps within the tracking window and has no workspace rule is moved to the workspace that was active when it was launched.
Fix
**Plain Arch.** Either drop the token for autostarted commands:
hl.on("hyprland.start", function()
hl.exec_cmd("unset HL_INITIAL_WORKSPACE_TOKEN; slack")
end)
or turn the tracking off entirely:
hl.config({ misc = { initial_workspace_tracking = 0 } })
**Omarchy 4.** Not affected by default: /usr/share/omarchy/default/hypr/looknfeel.lua already sets initial_workspace_tracking = 0. Check that your own looknfeel.lua does not set it back to 1.
Verify
hyprctl getoption misc:initial_workspace_tracking shows 0, or an autostarted app's environment (tr '\0' '\n' < /proc/$(pgrep -n slack)/environ | grep HL_INITIAL) has no token, and the app opens on the workspace you are on.