Per-monitor workspaces renumber to the next free slots after a brief monitor dropout instead of returning to their original numbers
System details
- AMD Ryzen 7 260 (Radeon 780M iGPU) + NVIDIA RTX 5060 Max-Q/Mobile (
nvidia-open), Lenovo 83M0 - Omarchy
4.5.0rc1-1, Hyprland0.56.2(efb50993780079460b0cbed1363e2166a2de1d9f), Quickshell0.3.2.r7.g2b4501a-3 - External LG UltraGear+ on
HDMI-A-1at[email protected], scale 2; internaleDP-1(EDO LEN151WQXGA), disabled in clamshell while the external is connected
What's wrong?
With per-monitor workspaces (default since 4.5), a monitor that disappears for about two seconds and comes back has its workspaces renumbered into the next free slots of its own block instead of returning to their original numbers. The windows survive and keep working, but they shift — in my case workspaces 1, 2, 3 became 3, 4, 5 — and the record of where they came from is dropped in the same second, so the shift is permanent.
Trigger on this machine: nvidia-modeset: WARNING: GPU:0: HDMI FRL link training failed. — the HDMI link drops for ~2 s and comes back. That has happened 10 times in the last 14 days (2× Oct 16, 5× Oct 17, 2× Oct 22, 1× Oct 23), so every one of those is a chance to reshuffle my workspace numbers. Any brief HPD drop should do it, including the post-resume blip where HDMI-A-1 reads disconnected for a moment (#15368).
Steps to recreate
- On the external monitor (first monitor, so its block is 1–10), open windows on workspaces 1, 2 and 3.
- Make that monitor vanish for ~1–2 s and return: unplug/replug HDMI, or wait for a link-training dropout. (A
headlessoutput will not reproduce it, since the removal has to be the real output's.) hyprctl -j workspacesnow lists the windows on3, 4, 5; workspaces 1 and 2 are gone, and~/.local/state/omarchy/monitor-workspaces-mergedis empty, so nothing will put them back.
Expected: the workspaces return under their original numbers, as #15867 set out to do. A two-second dropout should not renumber anything.
Evidence
Kernel and logind, 2026-10-23 00:28:
Oct 23 00:28:05 omarchy kernel: nvidia-modeset: WARNING: GPU:0: HDMI FRL link training failed.
Oct 23 00:28:05 omarchy kernel: snd_hda_codec_nvhdmi hdaudioC0D0: HDMI: invalid ELD data byte 93
Oct 23 00:28:06 omarchy lid-policy[664969]: lid closed, no external display: suspending in 20s unless one comes back
Oct 23 00:28:08 omarchy lid-policy[666111]: external display back after 2s: not suspending
Quickshell's Hyprland IPC debug log (qs log -r 'quickshell.hyprland.ipc.debug=true'), same seconds:
00:28:05 monitorremovedv2>>2,HDMI-A-1,LG Electronics LG ULTRAGEAR+ <serial>
00:28:05 monitoraddedv2>>1,FALLBACK,
00:28:06 monitoraddedv2>>0,eDP-1,EDO LEN151WQXGA
00:28:06 Workspace "1" moved to monitor "eDP-1"
00:28:06 Workspace "2" moved to monitor "eDP-1"
00:28:06 Workspace "3" moved to monitor "eDP-1"
00:28:06 changeworkspaceid>>1,21 Workspace with address "1" changed id to "21"
00:28:06 changeworkspaceid>>2,22 Workspace with address "2" changed id to "22"
00:28:06 changeworkspaceid>>3,23 Workspace with address "3" changed id to "23"
00:28:07 Monitor "HDMI-A-1" focused with workspace "1"
00:28:07 Workspace "2" activated on "HDMI-A-1"
00:28:07 monitoraddedv2>>2,HDMI-A-1,LG Electronics LG ULTRAGEAR+ <serial>
00:28:07 changeworkspaceid>>21,3 Workspace with address "21" changed id to "3"
00:28:07 changeworkspaceid>>22,4 Workspace with address "22" changed id to "4"
00:28:07 changeworkspaceid>>23,5 Workspace with address "23" changed id to "5"
~/.local/state/omarchy/monitor-workspaces — blocks: HDMI-A-1 = 0 (1–10), FALLBACK = 1, eDP-1 = 2 (21–30):
0 HDMI-A-1 LG Electronics LG ULTRAGEAR+ <serial>
1 FALLBACK
2 EDO LEN151WQXGA
monitor-workspaces-merged is 0 bytes, last written 00:28:07.841 — the origin records were cleared in the same second as the second renumber.
Why, reading default/hypr/monitor-workspaces.lua:
-
While HDMI is gone,
merge()sees workspaces 1–3 as guests on eDP-1 (block 2) and renumbers them to 21, 22, 23, recordingmerged[id] = { id = <original>, identity = <LG monitor> }. That part looks right, and matches the "Keep per-monitor workspaces on the right monitor after unplugs" behaviour. -
On HDMI's return,
restore()puts a parked workspace back under its origin only when that number is still free:if block_of_id(origin.id) == by_connector[monitor.name] and not hl.get_workspace(origin.id) then renumber(workspace, origin.id) elseif block_of_id(id) ~= by_connector[monitor.name] then adopt(workspace, by_connector[monitor.name]) endBy then workspaces 1 and 2 already exist on the returning monitor — Hyprland focused 1 on it and the reconcile's own
own_views()/show(monitor, home(monitor, block))created 2, both visible in the log above — so the guard fails and theelseifbranch runsadopt(). -
adopt()keeps the workspace's slot only when it is free, otherwise takes the first free number in the block. Slot 1 was taken (workspace 1), slot 2 was taken (workspace 2), so 21→3, 22→4, 23→5. That is exactly the+2shift. -
restore()clears the merge record before it knows whether the renumber reached the origin:merged[id] = nil save_merged()so the intent to return to 1, 2 and 3 is discarded even though it was not honoured, and no later reconcile can finish the job.
Possible fixes
- Don't create or focus workspaces on a returning monitor before
restore()has had its turn, or haveshow()/home()skip numbers that are pendingmergedorigins. - Or, in
restore(), when the origin number is occupied by an empty workspace, renumber that one aside instead of adopting a new slot. - Or keep the
mergedrecord when the origin number was not reached, so a later reconcile can still put the workspace back.
Aside
omarchy --help lists omarchy debug under "Diagnostics and support logs", but in 4.5.0rc1-1 it is not a route (Unknown Omarchy command: omarchy debug), and omarchy debug --no-sudo --print likewise, so there is no omarchy-debug output attached — versions and hardware are given above. Worth a look separately, since the manual and the bug template both point at it.
I read default/hypr/monitor-workspaces.lua on quattro (967bbdd73) against your log, and the diagnosis holds. When HDMI-A-1 comes back, Hyprland has already started it on the lowest free number, 1, and moving the visible 21 off eDP-1 leaves eDP-1 on the next free number, 2. Both are empty, but restore() (line 608) only returns a workspace to its old number when nothing at all is there, so it falls through to adopt(), which takes the first free slots: 3, 4 and 5. Because restore() clears the merge record (line 599) before it knows whether the number was reached, the shift is permanent. The HDMI link-training dropout is only the trigger; any brief disconnect of a monitor whose workspaces were merged elsewhere goes the same way. This was not reproduced on a test machine, because the fix below is already up and its own review runs it.
#16349 fixes this and is linked to close this issue when it merges. Before restoring a number, it moves an empty placeholder sitting on it out of the way. It does this once per restored workspace, so the 2 that only appears after 21 moves is cleared too. That should return your sequence to 1, 2 and 3. Its tests cover the placeholder on the returning monitor and the one left on the other monitor, but not your exact layout with FALLBACK and the clamshell eDP-1 in block 2. If a window is opened on one of the old numbers during the dropout, that workspace is still renumbered into the next free slot, by design.
Codex Medium and muse-spark-1.3-contributor at high thinking each reviewed this diagnosis separately and agreed with it, though their independence is not guaranteed. Neither found an earlier report of the same thing. They added that own_views() leaves the returning monitor on its empty placeholder, which is part of why the collision is certain. This now waits on the maintainer's decision about #16349.
The omarchy debug route you mention is separate from this. On quattro, bin/omarchy-debug still declares it, and I did not check why it did not resolve on 4.5.0rc1-1, so it deserves its own issue if it still fails after your next update.
Same shift here, from a different trigger: the laptop-display toggle (Super + Ctrl + Delete) rather than a dropout. Two parts of it fall outside what #16349 fixes, so I'm adding them here.
System: Framework 13 (AMD), omarchy-settings-dev 4.0.0.r7437.g7f4b1dd-1, Hyprland 0.57.0. Internal eDP-1 (BOE NE135A1M-NY1) plus a Lenovo E27q-20 on DP-9.
Flow
- Laptop only, windows on some workspaces.
- Plug in the Lenovo, then Super + Ctrl + Delete to turn off the laptop panel.
- Work on the external for a while. New windows land in the Lenovo's block (31–40).
- Unplug. With the panel off, no monitor is enabled for a moment.
omarchy-hyprland-monitor-watchthen runsomarchy-hyprland-monitor-internal recover, which re-enableseDP-1. - On the laptop, workspaces are shifted up one (1 → 2, 2 → 3, …). Sometimes the last slot wraps to 1.
I have not reproduced this step by step. The analysis below comes from reading default/hypr/monitor-workspaces.lua as installed, so the line numbers refer to that copy.
1. The laptop's own workspaces: #16328 as reported. Turning the panel off merges 1, 2, 3 into the Lenovo's block. append_slot() places them after the Lenovo's existing (often empty) home workspace, so they become 32, 33, 34. When eDP-1 comes back, Hyprland starts it on an empty placeholder 1. restore() then falls through to adopt() (line 608), and the record is already cleared (line 599). #16349 should fix this part.
2. Workspaces created on the external while the panel was off: not covered by #16349. Their owner (the Lenovo) is unplugged, so merge() (lines 622–647) treats them as guests and calls append_slot() for the laptop's block. append_slot() (lines 388–407) appends after the highest existing workspace in that block. That includes the empty placeholder Hyprland just started eDP-1 on, so 31 → 2, 32 → 3, and so on. It also closes gaps: 31–35 plus 40 would become 2–7, so slot 10 lands on 7. When slot 10 is taken, it falls back to the first free slot from 1. That explains the wraparound. vacate() in #16349 only runs from restore(), so this path keeps the shift. One possible fix: count only non-empty workspaces when finding the highest slot, or keep each guest's slot when it is free, as adopt() already tries to.
3. Hyprland's FALLBACK output is treated as a real monitor. connected() (lines 153–172) filters out mirrors only. My ~/.local/state/omarchy/monitor-workspaces has a permanent row 4 FALLBACK. So during the moment with no monitor enabled, assign() gave the headless fallback block 4, and merge() can renumber everything into 41–50 before the laptop panel returns. That adds one more renumbering pass, so the final numbers depend on event timing. Skipping FALLBACK in connected() would avoid this. The rule could match on name, or on an empty description plus the headless backend.
Filed by Claude Opus 5.5 via Claude Code, from reading the source on the affected machine.
I've seen a similar workspace-number shift on a single-monitor AMD desktop after a brief HDMI disconnect and reconnect.
My setup is an ASUS Radeon RX 570 connected directly over HDMI to an MSI MP223. The issue tracked here looks relevant to the workspace restoration part of what I observed.
I also saw cases where the monitor's EDID or identity was missing or invalid. That may affect monitor block selection separately, so I can't say whether #16349 covers that case.
As a mitigation for short disconnects, I disabled Auto Scan on the monitor and set amdgpu.hdmi_hpd_debounce_delay_ms=1500. With those settings, three controlled DPMS cycles and a normal lock/unlock completed with the expected EDID and no workspace movement.
This only filters the short HDMI hotplug events I observed; it does not establish that workspace restoration is fixed after a real disconnect. I'll keep an eye on #16349.
Another trigger, with a single monitor this time: an LG 5120x2160 on DP-1 (RTX 5080, nvidia-open 615.78.08, Hyprland 0.57.0, Omarchy 4.0.0.r7519). When the panel sleeps deeply enough to drop off DisplayPort, Hyprland stands in FALLBACK. The state file then gets a permanent 1 FALLBACK row, merge() moves 1–3 into 11–13, and when the monitor wakes it is parked on an empty 1. The restore then lands them on 2–4, which is the collision #16349 fixes.
With one monitor, the merge shouldn't happen in the first place. #17213 leaves FALLBACK out of connected(), as omarchy-hyprland-monitor-clamshell already does, so the workspaces keep their numbers while the monitor is away. That covers the third point in the comment above. It merges cleanly alongside #16349.
Diagnosed with Claude Code from the Hyprland log and the installed script.
I read the three new reports against default/hypr/monitor-workspaces.lua on quattro (175e63b62), together with #16349 and #17213. Taken together, the two pull requests cover what has been reported here.
@eliasfaltin, on your second part: reconcile() runs restore() before merge() (lines 655–663). So once #16349 has returned the laptop's own workspaces to 1, 2 and 3, the workspaces created on the Lenovo are appended after them, from 4 on. They don't land in the slots the laptop's workspaces just reclaimed. Appending, closing the gaps between them, and falling back to the first free slot once slot 10 is taken are what the file sets out to do ("after its own, as Niri appends them", lines 20–22 and 391–393). Each one also keeps a merge record and goes back under its old number when the Lenovo returns. One case is left. If the returning panel has nothing of its own to restore, append_slot() (line 394) still counts the empty workspace it was started on, so the guests begin at 2 beside an empty 1. Whether that is the intended behavior is a judgement call for the maintainer, not a defect I can show, so I have not opened a pull request for it.
@londospark, the third part and your single-monitor case come from connected() (line 153) counting FALLBACK, and #17213 stops that. It does not remove a FALLBACK row that is already saved in ~/.local/state/omarchy/monitors/workspaces. That row keeps its block, so the next new monitor still skips it until the row is deleted by hand.
@l2aptor, the HDMI debounce avoids the dropout but leaves the restore path as it is. A disconnect that outlasts the debounce still goes through the same code, so #16349 is still needed for your case.
Nothing was run on a test machine for this pass. Every point above is read from source. Codex Medium and muse-wonder (via pi, thinking high) each reviewed it separately and agreed, though their independence is not guaranteed. Neither found a further cause. This waits on the maintainer's decision about #16349 and #17213.
Another trigger for this: a monitor that drops its DisplayPort link while its panel sleeps.
System: Dell XPS 14 (DA14260), Intel Arc B390 (Panther Lake), Omarchy edge 4.0.0.r7600.g6194f46 (past v4.5.0-rc1), Hyprland 0.57.1, Quickshell 0.3.2.r7.g2b4501a-7. ASUS ProArt PA27JCV on DP-1 (5120x2880@60, scale 2), internal eDP-1 (2880x1800@120, scale 2).
The PA27JCV drops its DP link for the whole time its panel is in DPMS sleep, so Hyprland destroys DP-1 on every idle and recreates it on wake. Each time, the per-monitor workspaces merge into the laptop's block (12 and 13 become 2 and 3) and get renumbered back on wake.
Locally I hold o.workspaces.reconcile off while the removed output is external, the laptop panel isn't in use (it's off for DPMS, or the session is locked), and no external has come back. The merge only commits after 4 s of real use on the laptop with nothing plugged in. A grace period like that, upstream, would cover this case and the HDMI link-training blips in the original report.
Same shift on the stable release (Omarchy 4.5.0-3, Hyprland 0.56.2, aquamarine 0.15.1). Dell XPS 15 9510, Intel TigerLake-H + RTX 3050, lid closed, Samsung S34CG50 on DP-4 through a dock. The Samsung drops its DP link while it sleeps behind the lock screen (Connector DP-4 disconnected / connected in the Hyprland log, 16 such lines in one session), so FALLBACK gets block 1, and on unlock workspaces 1–4 come back as 3–6. ~/.local/state/omarchy/monitor-workspaces now has a permanent 1 FALLBACK row.
This is the single-monitor FALLBACK case that #17213 + #16349 cover.
+1 for merging both.
Same on stable 4.5.0-3 (Hyprland 0.56.2), Dell Precision, lid closed, Acer XB323QK on DP-6 via an MST dock. Undocking with the lid shut briefly leaves no enabled output, so FALLBACK claimed a permanent block (3 FALLBACK in monitor-workspaces). The Acer's workspaces 21/23/24 landed on the laptop as 11/12/14: slots 1/3/4 became 1/2/4. Only 11 and 12 got a record in monitor-workspaces-merged, so the workspace from 24 (now 14) won't return when the Acer comes back. I didn't capture an IPC log, so I can't say which reconcile pass dropped that record. +1 for #16349 and #17213.
Same setup here (Omarchy 4.5.0-3, Hyprland 0.56.2, Core Ultra 9 185H): laptop panel turned off automatically whenever a BenQ external is connected. Extra detail: because eDP-1 was disabled the first time blocks were assigned, the BenQ took block 0, FALLBACK took block 1 and the laptop got block 2 (21–30). Once saved, the laptop never got 1–10 back, despite the "laptop claims the first block" sort in connected(), because a disabled monitor isn't in hl.get_monitors(). I had to fix the state file by hand (laptop to 0, BenQ to 1, FALLBACK line deleted). It may be worth having #17213, or a migration, clear existing FALLBACK lines and let the internal panel reclaim block 0.
Same bug here, with a two-monitor desktop and no FALLBACK/clamshell step. The trigger is the lock screen blanking the displays with DPMS.
System
- Omarchy 4.5.0-3, Hyprland 0.56.2 (aquamarine 0.15.1), kernel 7.2.15-1-omarchy
- AMD Ryzen 5 9600X, Radeon RX 9070 (Navi 48), amdgpu
- Acer XV275U F3 on DP-1 (block 0, workspaces 1–10); BenQ EX2510S on DP-2 (block 1, workspaces 11–20)
Trigger
Lock-explorer is set to blank after 5 min (blankMs: 300000). It runs omarchy-brightness-display off → DPMS disable. The Acer drops its DisplayPort link every time: Connector DP-1 disconnected in hyprland.log, five disconnects this session, each matching an owed: policy pause=1 ... reason=dpms-off line. DP-2 never disconnects.
Symptom
Windows on workspaces 1, 2, 3 come back on 2, 3, 4. The returning monitor is parked on an empty workspace 1, so restore() fails the not hl.get_workspace(origin.id) guard and falls through to adopt(), which renumbers 12→2, 13→3, 14→4. ~/.local/state/omarchy/monitor-workspaces-merged is empty afterwards, so the shift is permanent.
It is timing-dependent: on the most recent dropout I captured (03:39 lock → 03:44:40 dpms-off → 03:47 wake) the restore won the race and the workspaces stayed on 1/2/3. Earlier locks produced the +1 shift. That matches the empty-placeholder collision #16349 describes.
Tried as a mitigation Enabling the Acer's OSD "Quick Start Mode" does not stop the link drop — the monitor still disconnects on every DPMS-off. The only reliable workaround so far is to set the lock screen to never blank (keep-display-on), which avoids the DPMS cycle entirely.
omarchy debug --no-sudo --print is still not a route in 4.5.0-3 (Unknown Omarchy command: omarchy debug --no-sudo --print), so no debug bundle attached.
+1 for #16349. This case has a real second monitor rather than FALLBACK, so it should exercise the same placeholder path without needing #17213.
Same bug on stable 4.5.0-3, Hyprland 0.56.2, in a clamshell setup where Omarchy turns the laptop panel back on while the external is away. #17213 / #18153 alone wouldn't cover this one; #16349 would.
System: Dell G15 5515 (AMD iGPU drives both outputs), lid closed, Dell U4021QW on DP-1 (block 0), internal eDP-1 disabled by clamshell (block 1). Trigger: switching the Dell off at its power button and back on.
What happens (socket2 trace, one off/on cycle):
- Dell off:
monitorremoved>>DP-1, thenmonitoradded>>FALLBACK. About 0.25 s lateromarchy-hyprland-monitor-clamshellre-enables the panel (monitoradded>>eDP-1). Hyprland starts eDP-1 on an empty11, and FALLBACK goes away. merge()appends the Dell's occupied workspaces after that empty 11, so2, 4, 5, 6become12, 13, 14, 15.monitor-workspaces-mergedholds correct records (12→2 … 15→6).- Dell on: Hyprland moves 12–15 to DP-1 and emits
createworkspace>>1for DP-1, all beforemonitoradded>>DP-1. Sorestore()runs with an empty1already on DP-1.
With nothing on workspace 1, every origin id is free and the cycle restores correctly; I verified this (2, 4, 5, 6 came back). With windows on workspace 1, origin 1 is held by the empty placeholder, restore() falls through to adopt(), and those windows land on 2 with 1 left empty, exactly as described above.
FALLBACK is only on screen for about 250 ms here. The merge into the laptop panel's block happens no matter what, so this case needs the placeholder handling in #16349.
Local workaround until #16349 lands: in restore(), if hl.get_workspace(origin.id) is an empty, non-special workspace on the returning monitor, first monitor:set_workspace(...) to the workspace being restored. Hyprland destroys the hidden empty placeholder synchronously (checked with hyprctl eval), so the renumber to origin.id then succeeds. I'm testing it on real off/on cycles now.
+1 for merging #16349.
Same bug on stable 4.5.0-3 (Hyprland 0.56.2-4, Quickshell 0.3.2.r7.g2b4501a-1), from a plain dock/undock. Below is the whole sequence and use case, since several open issues and PRs (#16349, #17213, #11275, #17759, #17868) meet in this one setup, and a fix probably needs to consider them together.
Setup and use case
- ThinkPad T14 (
eDP-1); two Dell U2415s through a dock onHDMI-A-1andDP-4/DP-5(the connector name changes between plugs). The laptop panel is disabled while docked. - Keyboard only. Workspaces are bound to Alt+1…0 instead of Super, and a workspace number means an app: 2 is the browser, 3 the editor, and so on, wherever the window is. Before 4.5 I had a cloned
omarchy.workspacesbar widget that shows global 1–10.
What happened on the first undock after 4.5
- The laptop got block 3 (31–40). The panel was off when blocks were first assigned, and
FALLBACKalso took a block. This is the same as Coding-Sparrow's report above (serials redacted):0 Dell Inc. DELL U2415 <serial-A> 1 Dell Inc. DELL U2415 <serial-B> 2 FALLBACK 3 eDP-1 Lenovo Group Limited 0x40A9 - The Dells' workspaces
1, 2, 3, 4, 5, 10became32–37. That's slots 2–7, not 1–5 and 10. - Everything looked gone. Alt+N (global) found nothing, and the cloned widget (#17759) showed no occupied workspaces. The stock widget would also have shown stale numbers, because Quickshell ignores
changeworkspaceid(#11275, quickshell#929), and the module now sends that event on every hotplug. The #11275 triage says "nothing Omarchy ships renumbers a workspace"; that no longer holds since 4.5. - The record of where they came from was wrong. Workspaces 2–5 were physically on the second Dell. They had been created under global numbering, though, so their ids fell in the first Dell's block, and
merge()recorded the block owner (identity_of_block(block_of_id(old))) as their origin. On redock they all went to the first Dell. Anyone upgrading from global numbering with workspaces spread across monitors will hit this once.
Three bugs in the module
a) Blocks are assigned by who shows up first, and FALLBACK counts. The comment in connected() says the laptop panel claims the first block, but a disabled panel isn't in hl.get_monitors(), so it's assigned last. FALLBACK: #17213.
b) merge() appends instead of keeping the slot. append_slot() (line 634) always takes the id after the highest one in the target block, even when the workspace's own slot is free. The fix: keep the slot when it's free, and append only on a collision.
c) The new monitor's empty placeholder collides with that slot. When docking, Hyprland starts the new monitor on an empty workspace in its own block (11 here). That empty workspace holds slot 1, so the first workspace still collides and everything after it shifts: 1–5 became 12–16. It's the same collision #16349 fixes in restore(), so I reused its vacate() in merge():
-- merge(), in place of: local id = append_slot(by_connector[workspace.monitor.name])
local block = by_connector[workspace.monitor.name]
local id = block * SLOTS + (workspace.id - 1) % SLOTS + 1
if not vacate(id) then
id = append_slot(block)
end
Without #16349's vacate() in restore(), the undock direction shifts the same way: the laptop returns on an empty 1, and 1–5 come back as 2–6.
Tested against the module's own test harness
I used test/shell.d/hyprland-monitor-workspaces-test.sh from v4.5.0, plus a dock/undock scenario: laptop with windows on 1–5, 9 and 10; Dell added on an empty workspace; panel removed; then undock in either order.
| Docked | Undocked | |
|---|---|---|
| Stock | 12,13,14,15,16,17,18 |
2,3,4,5,6,9,10 |
With #17213 + #16349's vacate() + keep-slot merge() |
11,12,13,14,15,19,20 |
1,2,3,4,5,9,10 |
4 of the existing 15 tests fail with keep-slot, all on the numbers they assert for the append design. For example, merge expects 11, 12 and 13 to become 6, 7 and 8 after the laptop's own 1 and 5. With keep-slot, 11 collides with the occupied 1 and is appended (6), while 12 and 13 keep their slots (2, 3). Replug restore and the deferred-teardown checks behave the same. So keep-slot is a design change, and those tests would need updating if you want it.
On the real machine, the docked result matched the table, but only after the vacate() fix: my first patch without it produced 12–16 on the dock.
For the stale bar I added a local workaround: the loader restarts the shell about 2 s after any renumber. Until Quickshell handles changeworkspaceid, Omarchy might want to do something similar.
Why I went back to global workspaces anyway
Even with all of this fixed, per-monitor slots don't fit this use case. "Go to the browser" becomes "focus the right monitor, then press its slot", so you have to remember which monitor holds what, or reach for the mouse. That's the same complaint as #17647 and #17759. So I replaced the module locally with a global stub: a package.preload for default.hypr.monitor-workspaces that defines o.workspaces.focus/move_window/... as plain global dispatches, with a no-op reconcile.
With that, a real undock and redock on 4.5.0-3 kept every workspace number, and the cloned bar was correct throughout. But the workspaces didn't go back to the right monitors on redock. Hyprland returns a monitor's workspaces only when it comes back under the same connector name, and the dock gave one Dell a different connector (DP-4 before, DP-5 after). So every workspace except one landed on that Dell. The same connector-based return also misfires the other way: opening the laptop lid while docked switches the panel back on, and Hyprland pulls onto it every workspace last seen on eDP-1, even though their monitors are still connected.
The 4.5 module already handles this part correctly: it identifies a monitor by make, model and serial, not by connector. A global mode should keep that part and drop only the renumbering. Locally I added a small hook that does just that, without renumbering:
- It remembers each workspace's monitor by its description.
- After any hotplug or config reload settles (about 2.5 s), it sends every workspace whose monitor is connected back to it. That undoes Hyprland's connector-based moves, including the lid case.
- A workspace whose monitor is unplugged keeps its record, so it's treated as visiting rather than rehomed.
- Hyprland moves workspaces before
monitor.removed/monitor.addedfire, so records are only learned a moment after user actions, and a snapshot is dropped if a hotplug happens in between. My first version didn't drop them, and opening the lid while docked overwrote the records.
It passes a lid-open, undock, redock scenario in the module's test harness, including a connector rename and a deliberate move to another monitor. A full real cycle on 4.5.0-3 (undock, lid open, redock) now ends with every workspace on its own monitor, under its own number.
Suggestions
- Merge #17213 and #16349, and give
merge()the same keep-slot andvacate()treatment, so numbers survive a dock/undock in per-monitor mode. - Record the origin monitor in
merge()from where the workspace actually is, not from the owner of its id's block. Or migrate global-era ids into the right blocks on the first run of 4.5. - Ship the global toggle from #17868. Keyboard-driven setups that tie numbers to apps need it, and it avoids every renumbering bug above. Keep the identity-based return in global mode too, because plain Hyprland loses the layout as soon as a dock renames a connector.
Another trigger on stable 4.5.0-3 (Hyprland 0.56.2): a KVM switch away and back. Framework 13 (AMD) with the lid closed, Dell S3221QS on DP-4.
The state file had the Dell on block 0, FALLBACK on block 1 and the internal BOE panel on block 2. The Hyprland log shows this sequence:
- KVM away:
DP-4removed, thenFALLBACK, thenomarchy-hyprland-monitor-clamshellre-enabledeDP-1, which started on 21.merge()renumbered 1, 2, 3 to 22, 23, 24. - KVM back:
New monitor: WORKSPACEID 1, exists: 0, so Hyprland parkedDP-4on an empty placeholder 1.restore()cleared the records, found 1 taken and fell through toadopt().adopt()keeps the slot of the merged id ((22 - 1) % 10 + 1), not the original one, so the log showschangeID 22 to 2,23 to 3and24 to 4. The records were gone (monitor-workspaces-mergedwas empty), so every workspace stayed shifted by one.
Fixed by hand with hl.dsp.workspace.change_id (2→1, 3→2, 4→3). This matches the placeholder collision #16349 fixes, plus the FALLBACK block #17213 removes. +1 for both.
A side point: when adopt() is reached from restore(), it could prefer origin.id's slot over the merged id's slot. Then a collision that #16349 doesn't catch would still land on the right number, or at least keep the original slot.
Same bug on a desktop with two external monitors, no laptop panel, no lock screen involved. The trigger is simply switching both monitors off at their power buttons and back on.
System
- Omarchy 4.5.0-3, Hyprland 0.56.2, kernel 7.2.15-1-omarchy
- AMD Raven Ridge iGPU (Radeon Vega), amdgpu
- iiyama PL2730H on
HDMI-A-1(block 0, workspaces 1–10); Dell P2222H in portrait onDVI-D-1(block 1, workspaces 11–20)
What happens
Powering the monitors off makes both connectors drop (Connector HDMI-A-1 disconnected, then Connector DVI-D-1 disconnected in hyprland.log). When they come back, the workspaces on the landscape monitor (HDMI-A-1, block 0) appear shifted by one: windows from 1, 2, 3 end up on 2, 3, 4. I haven't checked yet whether this is consistent on every power cycle or timing-dependent. ~/.local/state/omarchy/monitor-workspaces also gained a FALLBACK row on block 2, so at some point both outputs were gone together, which may also be relevant to #18153.
+1 for #16349.
I've opened #18636 for the case the 2 Nov comment left open: workspaces from an unplugged monitor starting at 2, beside the empty 1 that a monitor with none of its own is parked on. It is also the second part of the 30 Oct report and the contributing factor noted in #18084.
It reproduces every time without hardware, on quattro (e485c622) with Hyprland 0.57.1. Start a nested Hyprland whose config loads only default/hypr/helpers.lua and default/hypr/monitor-workspaces.lua, with its own XDG_STATE_HOME, then:
hyprctl -i $SIG output create headless EXT
hyprctl -i $SIG eval 'hl.monitor({ output = "WAYLAND-1", disabled = true })' # the clamshell panel
for id in 11 12 13 14; do
hyprctl -i $SIG eval "hl.exec_cmd('foot', { workspace = '$id silent' })"; sleep 0.5
done
hyprctl -i $SIG eval "hl.dispatch(hl.dsp.focus({ workspace = '11' }))"
hyprctl -i $SIG output remove EXT; sleep 1
hyprctl -i $SIG reload # drops the runtime rule, so the panel comes back
hyprctl -i $SIG workspaces
The windows end on 2, 3, 4 and 5. A real clamshell undock on 4.5.0-3 left the same records in my monitor-workspaces-merged (2←11 through 5←14).
The PR keeps append-after-own and only stops the empty workspace from holding a number. It merges cleanly with #16349 and #17213, and its description notes the one test line in #16349 that would need to follow.
Same Hyprland behaviour on a different setup, in case it helps with the fix design: Omarchy 4.5.0-3, Hyprland 0.56.2, laptop eDP-1 plus one external monitor on DP-4, with a user module that maps raw workspaces 1-10 to the laptop and 11-20 to the external screen.
Unplugging the external monitor renumbered its workspaces before monitor.removed fired: 11, 13 and 14 became 6, 7 and 8 (the next free raw IDs). Any handler that only reads workspace IDs inside monitor.removed has already lost the original numbers. Recording each window's workspace while the monitor is connected, then moving windows back from that record, fixed it for me.
I reproduced it without hardware using hyprctl output create headless and hyprctl output remove <name>. The issue says a headless output does not reproduce it for the stock module, but the renumbering did show up with one in my setup.
Same shift on stable 4.5.0-3 (Hyprland 0.56.2, aquamarine 0.15.1). ASUS TUF A15 (Ryzen 9 7940HS, RTX 4060), with eDP-2 disabled in monitors.lua and a Prism+ X300 ultrawide on HDMI-A-1. The X300 drops off HDMI overnight, Hyprland re-enables eDP-2, and after unlock in the morning, workspaces 1, 2, 3 come back as 2, 3, 4. My monitor-workspaces state also has a permanent 2 FALLBACK row, so #17213 applies here too.
The analysis above was from reading source, so here is an executed reproduction. It runs a nested Hyprland with headless outputs against the installed monitor-workspaces.lua and does not touch the live session. HEADLESS-2 plays the external monitor (block 0) and WAYLAND-1 the laptop panel (block 3).
| Run (3 times each) | Before dropout | While away | After return |
|---|---|---|---|
| Stock 4.5.0-3 | 1, 2 | 32, 33 | 3, 4 |
| With the stopgap below | 1, 2 | 32, 33 | 1, 2 |
A workspace.created trace shows both placeholders #16349 describes. Hyprland starts the returning monitor on an empty 1, and moving 31 back off the other monitor leaves that monitor on another empty low number. Clearing only the first one (a default named workspace rule for the returning monitor) took the result from 3, 4 to 2, 3. So the vacate has to run per restored workspace, as #16349 does.
repro.sh
#!/bin/bash
# Reproduces #16328 in a nested Hyprland with headless outputs; your session is untouched.
# HEADLESS-2 plays the external monitor (block 0, workspaces 1-10), WAYLAND-1 the laptop panel (block 3).
# Usage: ./repro.sh -> stock Omarchy
# ./repro.sh fix.lua -> also loads a module that wraps o.workspaces.reconcile
set -e
dir=$(mktemp -d); trap 'kill $pid 2>/dev/null; rm -rf "$dir"' EXIT
mkdir -p "$dir/state/omarchy"
printf '0\t\tHEADLESS-2\n3\t\tWAYLAND-1\n' > "$dir/state/omarchy/monitor-workspaces"
extra=""; [ -n "$1" ] && extra="dofile(\"$(realpath "$1")\")"
cat > "$dir/test.lua" <<LUA
dofile("/usr/share/omarchy/default/hypr/bootstrap.lua")
require("default.hypr.helpers")
require("default.hypr.monitor-workspaces")
$extra
LUA
before=$(ls "$XDG_RUNTIME_DIR/hypr")
XDG_STATE_HOME="$dir/state" Hyprland -c "$dir/test.lua" >"$dir/log" 2>&1 & pid=$!
sleep 4
export HYPRLAND_INSTANCE_SIGNATURE=$(ls "$XDG_RUNTIME_DIR/hypr" | grep -vxF "$before" | head -1)
show() { echo "$1: $(hyprctl clients -j | jq -r '[.[] | .title + " on " + (.workspace.id|tostring)] | join(", ")')"; }
hyprctl output create headless HEADLESS-2 >/dev/null; sleep 1
for n in 1 2; do
hyprctl dispatch "o.workspaces.focus($n, \"HEADLESS-2\")" >/dev/null; sleep 0.5
hyprctl dispatch "hl.dsp.exec_cmd(\"foot -T app$n\")" >/dev/null; sleep 1.5
done
[ "$(hyprctl workspaces -j | jq -r '[.[] | select(.windows > 0 and .monitor == "HEADLESS-2") | .id] | sort | join(",")')" = "1,2" ] \
|| { echo "setup failed: expected windows on 1 and 2 of HEADLESS-2"; exit 1; }
show "before dropout"
hyprctl output remove HEADLESS-2 >/dev/null; sleep 2
show "while away "
hyprctl output create headless HEADLESS-2 >/dev/null; sleep 2
show "after return "
The stopgap is the same idea as #16349, done from user config: it wraps o.workspaces.reconcile and moves any empty workspace sitting on a number about to be restored to 9000+ first. It's here for anyone who needs it until #16349 merges. Load it with require("hypr.monitor-workspaces-fix") in ~/.config/hypr/hyprland.lua.
~/.config/hypr/monitor-workspaces-fix.lua
-- Workaround for Omarchy's per-monitor workspaces (default/hypr/monitor-workspaces.lua)
-- shifting workspaces by one or more after the external monitor drops off overnight.
--
-- While HDMI-A-1 is gone its workspaces 1, 2, ... are renumbered onto another
-- monitor (31, 32, ...) and remembered in the merged state file. When it comes
-- back, Hyprland fills the gap on the monitor they leave with a new empty
-- workspace using the lowest free number, usually 1. Omarchy then finds 1
-- taken, so 31 becomes 2, 32 becomes 3, and so on.
--
-- Before Omarchy reconciles a returning monitor, move any empty workspace that
-- sits on a number it is about to restore out of the way. The parked one is
-- left empty and Hyprland removes it once Omarchy shows that monitor its own.
local paths = require("default.hypr.paths")
local MERGED_FILE = paths.state_home .. "/omarchy/monitor-workspaces-merged"
local PARK = 9000
-- The original numbers of the workspaces waiting for this monitor to return.
local function returning_ids(name)
local monitor = hl.get_monitor(name)
local file = monitor and io.open(MERGED_FILE, "r")
if not file then
return {}
end
local description = monitor.description ~= "" and monitor.description or monitor.name
local ids = {}
for line in file:lines() do
local original, identity = line:match("^%d+\t(%d+)\t(.+)$")
if original and identity:gsub(" #%d+$", "") == description then
ids[#ids + 1] = tonumber(original)
end
end
file:close()
return ids
end
local reconcile = o.workspaces.reconcile
function o.workspaces.reconcile(added, gone)
if added then
for _, id in ipairs(returning_ids(added)) do
local workspace = hl.get_workspace(id)
if workspace and (workspace.windows or 0) == 0 then
local park = PARK
while hl.get_workspace(park) do
park = park + 1
end
hl.dispatch(hl.dsp.workspace.change_id({ workspace = tostring(id), id = park }))
end
end
end
return reconcile(added, gone)
end
+1 for merging #16349 and #17213.
One more trigger, and a second symptom that #16349 and #17213 don't touch.
System: Intel Tiger Lake (i915), single HKM UG27F on HDMI-A-1, Omarchy 4.5.0-3, kernel 7.2.15-1-omarchy.
Trigger: switching the monitor's input to another source (HDMI 2, for a second computer) and back. The monitor drops hotplug while it is on the other input, so HDMI-A-1 disappears for 2–5 seconds and Hyprland stands in FALLBACK. In three days this happened three times (Nov 15 10:53, Nov 16 03:03, Nov 17 03:59 JST). Each time ~/.local/state/omarchy/monitor-workspaces ended up with a 1 FALLBACK row, as described above, and windows were renumbered to 10+.
Second symptom: the shell's IPC handlers are duplicated after the dropout. After the 03:59 dropout, omarchy-shell logged one of these for nearly every panel:
WARN scene: QML ShellIpc at file:///usr/share/omarchy/shell/plugins/panels/power/Panel.qml[184:3]: Handler was registered but will not be used because another handler is registered for target omarchy.power
(The same for omarchy.clock, omarchy.network, omarchy.monitor, omarchy.system-update, omarchy.tailscale, omarchy.weather, omarchy.indicators and others.)
From then on, the system menu would not open. Super + Esc did nothing. omarchy menu ping returned ok and omarchy menu toggle system exited 0, but no omarchy-menu layer surface ever appeared in hyprctl layers. omarchy restart shell fixed it immediately. It looks like the per-screen panel instances are created again for the returning output (or the FALLBACK output) before the old ones are torn down. The IPC targets then stay bound to instances that no longer have a visible surface.
Workaround: forcing the connector on, so that the input switch doesn't register as an unplug: video=HDMI-A-1:e drm.edid_firmware=HDMI-A-1:edid/<monitor>.bin with the EDID added to the initramfs. amdgpu.hdmi_hpd_debounce_delay_ms from the comment above has no i915 equivalent.
The additional undock case now has PR #18636: append_slot() counts the host monitor's empty workspace, so arriving workspaces start at 2 beside an empty 1. That PR keeps the append-after-own order and changes how the empty workspace is handled. The original restore collision has two open implementations, #16349 and #18990; #16349 already links to close this issue. #17213 prevents FALLBACK receiving a new block, but leaves previously saved FALLBACK rows allocated. These PRs remain open. The previous statement that two PRs covered everything was too broad.
The missing merge record reported by @amahran remains unexplained without a Hyprland IPC trace spanning the undock and reconnect. The intermittent EDID loss mentioned by @l2aptor is also not established as the cause of their renumbering. The pending changes are not proven to address either subcase.
@maikunari, the menu failure matches the symptoms tracked in #13956: monitor loss and return, duplicate ShellIpc warnings, then shortcuts that stop opening panels. The exact cause remains unconfirmed; those warnings alone do not establish why the menu fails. Please add the shell journal spanning the dropout and return, together with the installed Quickshell version, to #13956 so that failure can be followed separately from workspace numbering.
I checked the updated reports against quattro (419a5a709) and the linked PR diffs. This pass read source only; no reproduction or test suite ran. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the diagnosis and agreed with leaving the issue open for the pending fixes; their independence is not guaranteed. They also called out the saved-FALLBACK limit and the unexplained missing-record case.
This issue waits on the maintainer's decision about the pending workspace fixes.
Another confirmation, with data on the fix. Single monitor on DP-1 (LG, deep sleep drops the DP link on S3 wake), omarchy-dev r7585 through r8269.
Every wake with the link drop gave the same shift: empty workspace 1, everything else +1. The state file ~/.local/state/omarchy/monitors/workspaces had a 1<TAB><TAB>FALLBACK line each time.
Since 2026-11-05 I have run the #17213 change locally (and monitor.name ~= "FALLBACK" in connected()). With it applied the shift did not come back. It returned on 2026-11-17, 11-20, 11-23 and 11-24, each time only after an omarchy-dev update had overwritten monitor-workspaces.lua and removed the patch. So #17213 alone fixes the single-monitor case. I now reapply it with a pacman hook, but it would be good to get it merged.