OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
display-monitors medium common DISPUTE

Stop losing windows and workspaces when you disable a monitor

omarchyarchendeavouroscachyoshyprlandwaylandlaptopdesktop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The distinction being drawn is correct and important, and it is upstream's own: the Monitors page warns 'Disabling a monitor will literally remove it from the layout, moving all windows and workspaces to any remaining ones. If you want to disable your monitor in a screensaver style (just turn off the monitor) use the dpms dispatcher.' hyprwm/Hyprland#8024 exists ('All windows/workspaces lost when monitor disconnects'), and omarchy-hyprland-monitor-internal toggle|on are real subcommands bound to Super+Ctrl+Delete. The dpms calls are right. But the last command is a legacy hyprlang dispatcher name pasted into Lua: there is no hl.dsp.moveworkspacetomonitor. The Dispatchers page puts it in the workspace namespace as hl.dsp.workspace.move({ workspace?, monitor }), so the recovery step, the one a user reaches for precisely when their windows are already stranded on an invisible output, fails as written.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.

Symptom

You disable a monitor (display panel toggle, or a disabled = true rule) and all the windows that were on it vanish, or reappear stacked on top of everything on the remaining screen. Turning the monitor back on does not restore the layout. Users also report using disabled to 'turn the screen off' and being surprised the workspaces moved.

Cause

disabled = true literally removes the output from the layout: Hyprland migrates every window and workspace off it onto whatever is left. It is not a screen-blank. dpms is the screen-blank. Omarchy's display-panel toggle writes a runtime-only rule with no persisted flag, so nothing re-enables the output when the external is later unplugged.

Fix

Use the right tool for the intent.

Turn the panel *off* without destroying the layout:


hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })'
hyprctl dispatch 'hl.dsp.dpms({ action = "enable" })'

Actually remove an output from the layout (windows will move):


hl.monitor({ output = "HDMI-A-1", disabled = true })

On Omarchy, toggle the laptop panel through the helper that keeps a recovery flag, rather than the raw rule:


omarchy-hyprland-monitor-internal toggle   # Super+Ctrl+Delete
omarchy-hyprland-monitor-internal on       # force it back

If windows are already on an invisible output, move the workspace back. The dispatcher lives in the workspace namespace. hl.dsp.moveworkspacetomonitor is the old hyprlang name and does not exist in Lua:


hyprctl monitors -j | jq -r '.[].name'
hyprctl dispatch 'hl.dsp.workspace.move({ workspace = "3", monitor = "eDP-1" })'

The monitor argument also accepts a direction, current, a relative +1/-2, or a desc: description.

Verify

hyprctl monitors -j | jq -c '.[] | {name,disabled}' matches what you intended, and hyprctl workspaces -j | jq -c '.[] | {id, monitor}' shows every workspace on a monitor you can actually see.

Sources

disable-monitor-loses-windows-and-workspaces