Hyprland version
Hyprland 0.56.2 built from branch v0.56.2 at commit efb50993780079460b0cbed1363e2166a2de1d9f clean ([gha] Nix: update inputs).
Date: Wed Aug 5 14:13:21 2026
Tag: v0.56.2, commits: 7661
Libraries:
Hyprgraphics: built against 0.5.1, system has unknown
Hyprutils: built against 0.14.1, system has unknown
Hyprcursor: built against 0.1.13, system has unknown
Hyprlang: built against 0.6.8, system has unknown
Aquamarine: built against 0.15.0, system has unknown
Version ABI string: efb50993780079460b0cbed1363e2166a2de1d9f_aq_0.15_hu_0.14_hg_0.5_hc_0.1_hlg_0.6
no flags were set
How to focus a specific workspace to a specific monitor on startup
I have 2 monitors, i would like to have my secondary monitor (“HDMI-A-1”) focused on workspace 6, while my primary monitor (“DP-2”) is focused on workspace 1 on startup. I specifically do not want to bind a workspace to a specific monitor using hl.workspace_rule, as I like the flexibility of moving workspaces between monitors. Here’s what i have tried:
hl.on("hyprland.start", function ()
hl.dispatch(hl.dsp.focus({monitor = "HDMI-A-1", workspace = 6}))
hl.dispatch(hl.dsp.focus({monitor = "DP-2", workspace = 1}))
end)
hl.on("hyprland.start", function ()
hl.dispatch(hl.dsp.focus({monitor = "HDMI-A-1"}))
hl.dispatch(hl.dsp.focus({workspace = 6}))
hl.dispatch(hl.dsp.focus({monitor = "DP-2"}))
hl.dispatch(hl.dsp.focus({workspace = 1}))
end)
Sadly neither of these work. Is there any way to get this to work?
Here is another scenario that ties into this, for when i want to open discord or some other application on my secondary monitor but have my focus on the primary one after startup. With
hl.on("hyprland.start", function ()
hl.exec_cmd("kitty", {workspace = 6, monitor = "HDMI-A-1"})
hl.dispatch(hl.dsp.focus({monitor = "DP-2"}))
end)
i am able to open kitty on the correct monitor and workspace, but focus doesn’t move back to my primary monitor, it stays on kitty. Using
hl.on("hyprland.start", function ()
hl.exec_cmd("kitty", {workspace = 6, monitor = "HDMI-A-1"})
hl.dispatch(hl.dsp.focus({workspace = 1}))
end)
doesn’t move my focus either. However
hl.on("hyprland.start", function ()
hl.exec_cmd("kitty", {workspace = 6, monitor = "HDMI-A-1"})
hl.dispatch(hl.dsp.focus({workspace = 2}))
end)
does move my focus on the secondary monitor away from workspace 6 to 2.
Is there any way to move my focus back to my primary monitor after opening an application on the secondary one?
I did a bunch of research on this but nothing came up. It got to the point where i made this forum post, even though i have never posted one until now. So i hope that someone can help me with this. Thank you.