OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
hyprland-config low common DISPUTE

Workspaces will not stay on the monitor they are bound to, especially after a hotplug

hyprlandomarchyarchendeavouroscachyosmanjarowaylandlaptopdesktop
AUDITED Audited against its sources and confirmed accurate.
AUDIT NOTE

Workspace-Rules wiki confirms every rule used: monitor (accepts desc: descriptions, and the wiki's own example is monitor = "desc:Chimei Innolux Corporation 0x150C"), default (bool), persistent ("Keep this workspace alive even if empty and inactive"), gaps_in/gaps_out/no_border. It also states explicitly that a workspace identifier "can be a workspace selector, but please note workspace selectors can only match EXISTING workspaces", which is precisely the record's compounding cause, and the selectors quoted (r[2-4], w[t1], m[DP-1]) are real props. The hotplug dispatcher is right for a Lua config: Dispatchers lists hl.dsp.workspace.move({ workspace?, monitor }), and src/ipc/s1/Commands.cpp's dispatchRequest wraps input as return hl.dispatch(<in>) under the Lua provider and appends a "your syntax might need to be updated" note for old hyprlang args, so the record is correct that hyprctl dispatch moveworkspacetomonitor 3 DP-1 is rejected. hyprctl workspacerules and hyprctl -j workspaces are both registered commands, socket2 really emits monitoradded/monitoraddedv2, and bin/omarchy-restart-hyprctl exists in quattro. Nothing overlaps stale Omarchy 3 layout.

Symptom

hl.workspace_rule({ workspace = "1", monitor = "DP-1" }) is in the config, but workspace 1 opens on whichever monitor happens to be focused. Or the binding works once and then stops: the first SUPER+1 lands correctly, every later one pulls the workspace to the current screen. Or after undocking and re-docking, every workspace has piled onto the laptop panel and stays there. Or the rule quietly does nothing because the monitor was absent at login.

Cause

Workspace-to-monitor binding is a *rule about where a workspace is created*, not a permanent tether. If the named output does not exist when Hyprland evaluates the rule (monitor off, dock not attached, connector renamed from DP-1 to DP-2), the workspace is created on whatever monitor is available and there is nothing that migrates it back when the output reappears. Compounding this: workspace *selectors* (r[2-4], w[t1], m[DP-1]) only ever match workspaces that already exist, so a selector-based rule cannot pre-place a workspace that has not been created yet. Connector names are also unstable across docks, which is what turns a working config into a broken one after a hardware change.

Fix

Bind by EDID description rather than connector name, and make the workspaces persistent so they exist from login:


-- ~/.config/hypr/hyprland.lua  (Omarchy: put this in ~/.config/hypr/bindings.lua
-- or any file required from hyprland.lua after the Omarchy defaults)

-- Get the description from `hyprctl monitors` and DROP the trailing "(DP-1)"
local EXTERNAL = "desc:Dell Inc. DELL U2720Q 8FGZ043"
local LAPTOP   = "desc:Chimei Innolux Corporation 0x150C"

for _, id in ipairs({ "1", "2", "3", "4", "5" }) do
  hl.workspace_rule({ workspace = id, monitor = EXTERNAL, persistent = true })
end
for _, id in ipairs({ "6", "7", "8", "9" }) do
  hl.workspace_rule({ workspace = id, monitor = LAPTOP, persistent = true })
end

-- One workspace per monitor should be that monitor's default landing spot
hl.workspace_rule({ workspace = "1", monitor = EXTERNAL, default = true, persistent = true })
hl.workspace_rule({ workspace = "6", monitor = LAPTOP,   default = true, persistent = true })

-- Per-workspace look, while you are here
hl.workspace_rule({ workspace = "3", gaps_in = 0, gaps_out = 0, no_border = true })

Check what the compositor actually registered:


hyprctl workspacerules
hyprctl -j workspaces | jq -r '.[] | "\(.id) -> \(.monitor)"'

**After a hotplug**, nothing migrates workspaces back on its own. Re-apply by hand or from a script:


# Lua dispatcher form - `hyprctl dispatch moveworkspacetomonitor 3 DP-1` is the
# old hyprlang syntax and is rejected under a Lua config.
hyprctl dispatch 'hl.dsp.workspace.move({ workspace = "3", monitor = "DP-1" })'

A reload re-runs the rules, which is usually enough once the monitor is back:


hyprctl reload      # Omarchy: omarchy-restart-hyprctl

To automate it, bind the moves to a key or drive them from a monitoradded handler on socket2 and call the dispatcher above for each workspace.

Verify

hyprctl workspacerules lists a monitor entry for each bound workspace. After hyprctl reload with both displays attached, hyprctl -j workspaces | jq -r '.[] | "\(.id) -> \(.monitor)"' shows each workspace on its intended output.

Sources

workspace-not-pinned-to-monitor