Skip to content

Fix enabling and disabling a display doing nothing - #7036

Closed
sterre-g wants to merge 6 commits into
omacom:quattrofrom
sterre-g:fix-display-toggle-under-lua-parser
Closed

sterre-g wants to merge 6 commits into
omacom:quattrofrom
sterre-g:fix-display-toggle-under-lua-parser

Conversation

@sterre-g

@sterre-g sterre-g commented Aug 15, 2026 •

Copy link
Copy Markdown

The display toggle in the Display widget sends hyprctl keyword monitor <name>,disable. Under the Lua config parser that Omarchy 4 uses, hyprctl refuses the command:

$ hyprctl keyword monitor "HDMI-A-1,[email protected],1600x0,1"
keyword can't work with non-legacy parsers. Use eval.

It refuses it and still exits 0, which is why the panel could never tell it had failed. The switch appears to do nothing, in either direction.

This sends the change as a Lua hl.monitor call through hyprctl eval instead, which does apply:

$ hyprctl eval 'hl.monitor({ output = "HDMI-A-1", disabled = true })'
ok

Confirmed independently on three machines

  • @okurmustafa, Omarchy 4.0.0-1 / Hyprland 0.56.2. Reproduced the original failure, then tested the hyprctl eval approach in both directions through a locally patched Display panel.
  • @finnbuhk, 4.0.0-1 / 0.56.2, three displays (2x DP, 1x HDMI) on an AMD RX 9070. Toggling off and back on works in both directions with this patch applied.
  • @szalikdev, 4.0.0-1 / 0.56.2, an LG UltraGear on DP-1 alongside a Dell P2424HEB on DP-2. The shipped hyprctl keyword call left both outputs unchanged; the Lua specs here disabled and re-enabled them.

All three arrived independently at the disabled = false detail, on a laptop and on a two-DisplayPort desktop pair.

Why enabling needs disabled = false

hl.monitor edits the rule it finds rather than replacing it. Naming only mode, position and scale, which is the direct translation of the old ,preferred,auto,auto string, returns ok and leaves the output disabled. hlMonitor in Hyprland v0.56.2 (src/config/lua/bindings/LuaBindingsConf.cpp) is where that behaviour lives. The enable spec therefore says disabled = false explicitly.

The built-in panel goes through the command that owns it

Disabling the built-in panel from this widget used to write a runtime-only rule. That leaves no toggle flag for the clamshell watcher to read, no guard against turning off the last display, and nothing that survives a reboot. Unplug the external after doing it and there is no display left and no flag to recover from, which is the end state reported in #7228.

omarchy-hyprland-monitor-internal already holds all three, so the internal output is now routed through omarchy-hyprland-monitor-internal on|off and every other output keeps the direct hyprctl eval call.

This is a deliberate behaviour change and worth reviewing as one. Toggling the built-in panel now sends the same notification the keybinding does, and the disable survives a reboot instead of lasting until the next reload. Both follow from using the command that owns the flag, and both seem right for a switch in a settings panel, but they are a change rather than a fix and the call is yours. Disabling also goes through hyprctl reload, which re-applies monitors.lua and so is subject to #7326 until that is settled.

Which output counts as internal comes from omarchy-hyprland-monitor-laptop by way of omarchy-monitor-state, so LVDS and DSI panels are covered along with eDP, per #6752. Matching on an eDP name prefix instead fails the LVDS assertion in monitor-test.sh.

Routing there exposed a defect in the helper itself, fixed in its own commit so it can be taken separately: omarchy-hyprland-monitor-internal on clears the disable flag and reports success while the panel stays dark. It is the same defect as the one above, in the other file. Clearing the flag takes the disable out of the config, but hl.monitor only re-enables an output when a spec says disabled = false, and nothing sent one. recover had it too, and that one matters more, because it is the path the clamshell watcher takes when the external display is unplugged. Both now call enable_output, which repeats off()'s rule that only a plain connector name may be written into Lua.

Related work

This closes #6968. #7607 asks for the same behaviour from the other direction and is a second face of it rather than a separate watcher bug: before this change the toggle never disabled anything, so what that reporter saw was the row returning on the panel's own refresh. Routing the internal panel through its own command is what closes #7607 properly.

#8728 is the closest alternative and reaches the same two conclusions, independently and after this branch: hyprctl eval instead of keyword, and the explicit disabled = false. It also routes the internal display through omarchy-hyprland-monitor-internal, which this branch now does as well. Three differences are worth a maintainer's attention rather than mine:

  • It selects the internal output with String(name).indexOf("eDP") === 0, which misses the LVDS and DSI panels Treat LVDS panels as internal displays #6752 deliberately brought in. The repo already has omarchy-hyprland-monitor-laptop for this and it tests ^(eDP|LVDS|DSI)-.
  • It patches on() but not recover(), so the clamshell watcher's re-enable path keeps the missing disabled = false.
  • Its hyprctl eval ... || true discards the exit status, which is the failure mode this PR exists to fix.

Its name-validation approach is a fair alternative to escaping, and its Lua-injection test is a good one; an equivalent is in monitor-output-name-test.sh here.

#6710 rewrites this same area with omarchy-hyprland-monitor-toggle and -override. If that is the direction, this PR should be dropped in its favour rather than merged alongside it.

Two smaller neighbours, neither conflicting: #7326 on positions and scales being re-applied, which the enable spec touches because it overwrites mode, position and scale with automatic values, and #8010 on a 1Password float landing off-screen, which this gives a one-click trigger that did not exist while the toggle was inert.

#8027 and #8028 cover the FALLBACK output making omarchy-hyprland-monitor-external-active return true with nothing plugged in. This PR does not close #8027 and does not replace #8028. recover() still returns at omarchy-hyprland-monitor-external-active && return 0 before it reads the flag, so where the helper reports a phantom external the clamshell watcher bails at that line whatever this PR does, and the recover test here stubs the helper to exit 1 rather than covering that case. The helper fix is still #8028, and it is still needed.

Tests

The spec and the command choice are built in Model.js rather than inline in the QML, so both are covered by test/shell.d/monitor-test.sh, which gains assertions for the external direct call, the internal panel routing in both directions, a non-eDP built-in panel, a machine with no built-in panel, and an empty name. test/shell.d/monitor-output-name-test.sh gains four for the helper: on re-enabling the output, on refusing an unsafe connector name, recover re-enabling when the external is gone, and recover staying a no-op with no flag set.

Checked that they are load-bearing rather than decorative: dropping enable_output from on() fails "internal on re-enables the output it stopped disabling", and selecting the internal panel by eDP prefix fails "monitor recognises a built-in panel that is not named eDP".

2026-09-01

Rebased onto current quattro (b71dcad) with no conflicts, and brought up to date against work that landed since this branch was opened.

Copilot AI balanced review requested due to automatic review settings August 15, 2026 23:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates display toggling to use Hyprland’s Lua-compatible eval API.

Changes:

  • Generates escaped hl.monitor specifications.
  • Routes display toggles through hyprctl eval.
  • Adds unit coverage for generated specifications and escaping.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
shell/plugins/panels/monitor/Model.js Builds Lua monitor specifications.
shell/plugins/panels/monitor/Panel.qml Executes toggles through hyprctl eval.
test/shell.d/monitor-test.sh Tests specification generation and escaping.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shell/plugins/panels/monitor/Model.js Resolved
Copilot AI review requested due to automatic review settings August 15, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (3)

shell/plugins/panels/monitor/Model.js:98

  • quoteLua() replaces \n but leaves \r intact; if a display name contains Windows-style line endings (\r\n) or a bare \r, the resulting Lua source can become syntactically invalid (Lua treats CR as a newline in many contexts). Replace both \n and \r (or use a single pattern that handles CRLF) before emitting the quoted string.
function quoteLua(text) {
  return '"' + String(text === undefined || text === null ? "" : text)
    .replace(/\\/g, "\\\\")
    .replace(/"/g, '\\"')
    .replace(/\n/g, " ") + '"'
}

shell/plugins/panels/monitor/Model.js:111

  • The enabled parameter name is ambiguous here because enabled === true produces disabled = true (i.e., it’s interpreted as “currently enabled, so disable it”). Renaming the parameter to something like currentlyEnabled (or flipping the boolean to disable) would make the call sites and the implementation easier to read and reduce the chance of misuse.
function displayToggleSpec(name, enabled) {
  if (!name) return ""
  if (enabled) return "hl.monitor({ output = " + quoteLua(name) + ", disabled = true })"
  return "hl.monitor({ output = " + quoteLua(name) + ", disabled = false, mode = \"preferred\", position = \"auto\", scale = \"auto\" })"
}

test/shell.d/monitor-test.sh:28

  • Since quoteLua() is responsible for producing syntactically valid Lua source, it would be valuable to add a regression assertion for carriage returns / CRLF (e.g., an input containing \r\n or \r) to ensure the produced string can’t break the hyprctl eval Lua snippet.
assertEqual(monitor.quoteLua('DP"1'), '"DP\\"1"', 'monitor escapes a quote in a display name')

@omarchybot

Copy link
Copy Markdown
Collaborator

The diagnosis is right and hyprctl eval is the correct replacement — I confirmed on Hyprland 0.56.2 that hyprctl keyword monitor … prints keyword can't work with non-legacy parsers. Use eval. and still exits 0, which is why the panel could never tell it had failed.

Two things came out of the review.

Enabling still didn't work — pushed a fix (6c56c9a). hl.monitor edits the existing rule for an output rather than replacing it, so the enable spec's mode/position/scale merged into the rule the disable had left behind and disabled stayed true. Hyprland answers ok and the display stays off. Measured on a fresh 0.56.2 session:

hl.monitor({ output = "Virtual-1", disabled = true })                                    -> Virtual-1 disabled=true
hl.monitor({ output = "Virtual-1", mode = "preferred", position = "auto", scale = "auto" })
                                                                                         -> Virtual-1 disabled=true   (ok, no change)
hl.monitor({ output = "Virtual-1", disabled = false, mode = "preferred", … })             -> Virtual-1 disabled=false

The commit adds disabled = false to the enable spec and updates the assertion in test/shell.d/monitor-test.sh. Worth knowing because bin/omarchy-hyprland-monitor-clamshell:157 has the same omission — it gets away with it only because its disable goes through a toggle file plus hyprctl reload, which clears dynamic rules first.

Disabling the built-in display can strand a laptop with no screen — not fixed, for you and the maintainers to decide. toggleDisplay in Panel.qml:303 writes a runtime-only rule and never creates ~/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua. That file is what the recovery machinery keys on:

  1. Disable eDP-1 from the panel while docked. It goes off. No flag file is written.
  2. Unplug the external monitor.
  3. omarchy-hyprland-monitor-internal recover (bin/omarchy-hyprland-monitor-internal:48) bails because the flag is absent, and omarchy-hw-recover-internal-monitor keys on the same flag.
  4. omarchy-hyprland-monitor-clamshell falls through to enable_internal_output, whose spec omits disabled = false — so it merges into your disable rule and cannot turn the panel back on.
  5. The modeless watchdog doesn't rescue it either: Hyprland's FALLBACK output reports 1920x1080, not 0x0, so omarchy-hyprland-monitor-modeless returns "not modeless" and no hyprctl reload fires.

The result is a laptop running on a headless fallback with a black panel and no in-session way back. This was unreachable before, because the toggle didn't do anything; making it work makes it reachable.

The existing design already handles this — omarchy-hyprland-monitor-internal off writes the flag, refuses when there's no external display, and recover re-enables on unplug. Routing the panel's internal-display toggle through that command would close it, but it also changes behaviour (notifications, and the disable surviving a reboot), so I left that call to the maintainers rather than pushing it. Note also that no panel toggle survives a hyprctl reload today, and that PR #6710 reworks this same area with omarchy-hyprland-monitor-toggle/-override.

Tests: test/shell.d/monitor-test.sh, monitor-clamshell-scale-test.sh and ./test/cli all pass on a disposable VM after the pushed commit.

Copy link
Copy Markdown

Independent confirmation on Omarchy 4.0.0-1 with Hyprland 0.56.2:

I reproduced the original failure: hyprctl keyword monitor … is rejected by the Lua parser, so the panel action silently does nothing.

I then tested the hyprctl eval / hl.monitor approach in both directions through a locally patched Display panel. The target display changed to disabled: true, then back to disabled: false; its mode, position, scale, and transform were intact after the round trip. Unchecking and re-checking the display in the panel both worked.

So +1 to this fix. In particular, keeping the explicit disabled = false on the enable path is necessary, and retaining scale = "auto" is the right default for scaled displays.

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 6c56c9a. Nothing new has been pushed to the branch since the last pass, so this is about what a second round of testing established rather than about new code.

The black-screen hazard is confirmed, and it is now the thing holding this PR up. Last time I traced it component by component and left it as a maintainer judgement call. This time I reproduced the whole chain on a live Hyprland 0.56.2, and it is worse than the trace suggested. It is also the same end state as open issue #7228, which has independent reporters.

Measured, in order, with a headless output standing in for the external monitor:

1. external attached                 Virtual-1 disabled=false   HEADLESS-4 disabled=false
2. panel disables the "internal"     Virtual-1 disabled=true    HEADLESS-4 disabled=false
   (exactly the string Panel.qml:303 sends)
3. unplug the external               Virtual-1 disabled=true    FALLBACK  disabled=false 1920x1080
4. omarchy-hyprland-monitor-internal recover  -> exit 0, nothing changes
5. hyprctl reload                    Virtual-1 disabled=false

Two things came out of that which I had not established before.

The disable survives a hotplug. A rule set by hyprctl eval 'hl.monitor({ disabled = true })' is not cleared when another output is removed or added — I removed the external and added a new one, and the disabled output stayed disabled through both. Only hyprctl reload clears it. So the panel's disable is live at exactly the moment the user needs it gone.

omarchy-hyprland-monitor-external-active returns true with nothing plugged in. When the last enabled output goes away, Hyprland creates a FALLBACK output at 1920x1080. bin/omarchy-hyprland-monitor-external-active:6 selects any monitor whose name is not eDP|LVDS|DSI and whose disabled is false — and FALLBACK matches both. Measured with only a disabled Virtual-1 and FALLBACK present, it exits 0. That means recover() bails at bin/omarchy-hyprland-monitor-internal:47, its first guard, before it ever reaches the missing-flag check I described last time. This is not the stale monitor list #7228 hypothesises; it is deterministic, and it is worth looking at as the actual root cause of #7228 too. bin/omarchy-hw-external-monitors reads /sys/class/drm/*/status and is immune to it, which is the check Omarchy 3.x used.

So nothing re-enables the display:

  • recover() returns at line 47 on FALLBACK, and would return at line 48 anyway because the panel writes no flag file.
  • omarchy-hw-recover-internal-monitor only ever removes a flag, and its unit has ConditionPathExists on that same file (default/systemd/user/omarchy-recover-internal-monitor.service:4), so it does not even start.
  • The clamshell watcher does try. enable_internal reaches sync_internal_scale, current_internal_scale (bin/omarchy-hyprland-monitor-clamshell:104) filters on .disabled != true and so returns empty for a disabled monitor, the scales never match, and enable_internal_output fires every 2 seconds forever. It cannot work, because its spec at bin/omarchy-hyprland-monitor-clamshell:157 omits disabled = false — the same omission this PR's Model.js now gets right. Measured directly: sending that exact string to a panel-disabled output answers ok and changes nothing, while the spec from this branch re-enables it.
  • The modeless watchdog does not fire, because FALLBACK reports 1920x1080 rather than 0x0, so omarchy-hyprland-monitor-modeless exits 1.

And SUPER+CTRL+Delete does not straightforwardly rescue it either. With no flag file, toggle() takes the off() branch; off() does not refuse, because FALLBACK makes it think an external is active; so it writes internal-monitor-disable.lua and reloads. The reload clears the runtime rule, but the flag it just created disables the panel again — still black, and now disabled in a way that survives a reboot. A second blind press reaches on() and recovers. Contrast #7228, where the flag already exists and one press is enough. (This branch of it is traced through the scripts rather than reproduced — the test VM has no eDP-* output — but the premise it turns on, external-active returning true on FALLBACK, is measured.)

For a user that reads: close the lid setup, turn the laptop panel off from the Display panel while docked, walk away with the machine, and you have a black screen, a running session, an automatic recovery path that cannot fire, and a keyboard shortcut that appears to do nothing the first time you press it. Before this PR the toggle did not work at all, so none of this was reachable. Making it work makes it reachable, which is why it needs answering here rather than later.

omarchy-hyprland-monitor-internal on|off already handles all of this — it writes the flag, refuses when there is no external display, and recover clears it on unplug. Routing the panel's internal-display toggle through that command closes the hole and reuses machinery that works. It is a behaviour change (notifications, and the disable surviving a reboot), and #6710 is rewriting this same area with omarchy-hyprland-monitor-toggle/-override, so I have not pushed it — that is the maintainers' call and it is what this PR is waiting on.

On @okurmustafa's confirmation — thank you, that is useful and it matches what I measured, in particular that the explicit disabled = false is required on the enable path. Two notes on scope. Your round trip did not involve unplugging anything, so it does not touch the case above. And "mode, position, scale and transform intact" is partly an artifact of the mechanism rather than a property of the round trip: hl.monitor edits the existing rule, and the enable spec never names transform, so a transform is preserved because it is not mentioned. mode, position and scale are overwritten, with preferred/auto/auto — they looked intact because on your display the automatic values match your configured ones. On a display pinned to a specific mode or a non-auto scale in monitors.lua, re-enabling from the panel will come back generic until the next reload.

Two smaller things still open, neither of them blocking:

  • No Fixes #6968 trailer in the PR body or in either commit — I checked both. Worth adding, because with 6c56c9a this genuinely resolves both halves of that issue and it would be a shame for it not to close.
  • actionProc still discards stderr and the exit code (Panel.qml:431-436: a stdout collector, no stderr sink, no exit-code check). This is why the original bug was invisible for so long. It matters more now than it did before: hyprctl keyword exits 0 while refusing, but hyprctl eval exits 7 on a Lua error, so for the first time a failure here is detectable and the panel throws it away. Not something I would push — what to do with the error is a product decision.

Checked and found nothing worth reporting: the displayToggleSpec(name, enabled) argument sense is correct (enabled means "currently enabled", so the action is to turn it off) — it reads backwards and the test assertions encode that confusing sense, but I traced both call sites (Panel.qml:156 and Panel.qml:919) and there is no inversion. And quoteLua is sufficient in practice: I tried {, }, ), ]], tab, an escaped quote and an escaped backslash through hyprctl eval and all returned ok. A raw carriage return does break it (unfinished string, exit 7) and quoteLua strips only \n, but names reach the panel as DRM connector names from .name in hyprctl monitors all -j (bin/omarchy-monitor-state:23), so it is not reachable.

Tests, on a disposable VM with the shell running from this branch (pgrep confirmed): test/shell.d/monitor-test.sh 25 passed, test/shell.d/monitor-clamshell-scale-test.sh 20 passed, both through the compositor-backed wrapper. I also checked the tests are load-bearing rather than decorative: removing disabled = false from the enable spec fails monitor enables a display through the Lua config API with the exact before/after strings, and unexporting displayToggleSpec fails the file outright. Worth knowing that monitor-test.sh only exercises Model.js — unlike most panel tests here it never reads Panel.qml, so the call site's argument order is not covered by anything.

A second opinion from Codex at xhigh went over the same ground and reached the same conclusion on all of it, including that the naming is a readability trap rather than a bug and that the quoting is unreachable — its independence is not currently guaranteed, so read the agreement as agreement rather than as confirmation. It did contribute the ConditionPathExists point about the recovery unit. It had the keyboard-shortcut branch the other way round — expecting off() to refuse once the external is dropped — which is what the FALLBACK measurement corrects.

@finnbuhk

Copy link
Copy Markdown

Confirmed on Omarchy 4.0.0-1 / Hyprland 0.56.2 with three displays (2× DP, 1× HDMI), AMD RX 9070. Toggling off and back on works in both directions with this patch applied to a cloned *.monitor plugin.

Can also confirm the disabled = false detail this PR calls out. Re-enabling with only mode/position/scale — the direct translation of the old ,preferred,auto,auto string — returns ok but leaves the output dark:

# turns the output off
hyprctl eval 'hl.monitor({ output = "HDMI-A-1", disabled = true })'

# reports ok, but the monitor stays off
hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "preferred", position = "auto", scale = "auto" })'

# actually brings it back
hyprctl eval 'hl.monitor({ output = "HDMI-A-1", disabled = false, mode = "preferred", position = "auto", scale = "auto" })'

Worth noting for anyone hitting this before the fix lands: the failure is completely silent from the UI side, since actionProc never surfaces the non-zero exit. Might be worth logging it separately.

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at e11a597. Nothing had changed on the branch since the last pass, so this is about @finnbuhk's report, two issues filed today, and one commit I pushed.

@finnbuhk's disabled = false reproduction holds exactly. Re-measured on a disposable Hyprland 0.56.2 VM against a single output:

hl.monitor({ output = "Virtual-1", disabled = true })                                       ok -> disabled=true
hl.monitor({ output = "Virtual-1", mode = "preferred", position = "auto", scale = "auto" }) ok -> disabled=true  (no change)
hl.monitor({ output = "Virtual-1", disabled = false, mode = "preferred", ... })             ok -> disabled=false

The middle line is the direct translation of the old ,preferred,auto,auto; the third is what Model.js emits on the enable path at this head. So the enable spec does carry disabled = false, it is load-bearing, and test/shell.d/monitor-test.sh pins the exact string.

Pushed e11a597 for the silent failure — and it corrects what I said about it last time. I had the channel wrong, and so does the obvious reading of @finnbuhk's note. hyprctl does not use stderr here. Measured:

$ hyprctl eval 'hl.monitor({ output = "Virtual-1", disabled = )'
error: [string "hl.monitor({ output = "Virtual-1", disabled =..."]:1: unexpected symbol near ')'
$ echo $?
7

That text is on stdout; stderr is empty. A stderr: collector here would log nothing at all. The panel already collects that stdout — what it throws away is the exit code. e11a597 names the existing collector and adds an onExited that warns to the journal on a non-zero exit, following shell/services/PluginRegistry.qml:619 and shell/plugins/panels/tailscale/Service.qml:530. Proved in a standalone Quickshell harness on the same VM: exit 7 and the hyprctl error text both reach console.warn, and the existing onRunningChanged refresh still fires after it.

It deliberately does not name the command in the message. actionProc is shared with setScale, and both functions reassign command on a click that lands while the process is still running, so at exit time the property can describe an action that was never started. That reassignment also silently drops the second click (Panel.qml:304 and :309, if (!actionProc.running) actionProc.running = true). Both are pre-existing and not this PR's to fix, but the second one is worth a separate look now that the toggle does something.

The commit also carries Fixes #6968, because the body still has no closing keyword and quattro is the default branch. Say the word and I will drop it in favour of a line in the body.

Two issues filed today change what the stranding hazard is waiting on.

#8027 reports the FALLBACK mechanism independently, with the Hyprland source for it, and #8028 fixes the helper by cross-checking /sys/class/drm. I re-measured the premise: disabling the only output leaves Virtual-1 disabled=true plus an output named literally FALLBACK, disabled=false, 1920x1080, and omarchy-hyprland-monitor-external-active's jq exits 0 against that live state — "an external monitor is active", with nothing plugged in. That bug is on quattro today and reachable without this PR at all, which is why it belongs to #8028 rather than here.

But #8028 landing would not rescue a display disabled from this panel. With the helper corrected and the external unplugged:

  • omarchy-hyprland-monitor-internal recover clears its first guard and then returns at bin/omarchy-hyprland-monitor-internal:48 — the panel writes no internal-monitor-disable.lua, so there is no flag to clear.
  • the clamshell watcher reaches enable_internal → sync_internal_scale → enable_internal_output, whose spec omits disabled = false (bin/omarchy-hyprland-monitor-clamshell:165 on quattro, :157 at this branch's base) — the same omission this PR's Model.js now gets right. Measured: that exact shape sent to a disabled output answers ok and changes nothing, so it retries forever.

So the panel-disable hole needs its own answer either way, and the one-line disabled = false on enable_internal_output is worth having regardless of this PR. Routing the panel's internal-display toggle through omarchy-hyprland-monitor-internal on|off is still what I would suggest, and still a maintainer call given the behaviour change and #6710.

#8010 (1Password float left off-screen after a monitor is disabled) is neither caused nor fixed by this PR — the float's global coordinates survive the layout change either way. Worth knowing that this PR gives it a one-click trigger from the Display panel that did not exist while the toggle was a no-op.

Tests, on a disposable VM with the shell running from this branch, all re-run after e11a597: monitor-test.sh 25 passed, monitor-recovery-test.sh 18 passed, monitor-clamshell-scale-test.sh 20 passed through the compositor-backed wrapper, and ./test/cli 116 passed. The panel loads and answers its state IPC on the amended file with no QML error.

Reviewed by Claude Opus 5 in Claude Code, with a second opinion from Codex at xhigh. Codex caught the command-naming defect in my first draft of e11a597, so the commit as pushed is the corrected version and credits it. Its first run refused to review at all because I had moved HEAD underneath it, which was the right call; it was re-run pinned to the pushed commit. On the recovery trace above and on the rest of the diff it reached the same conclusion I did, and its independence is not currently guaranteed, so read that as agreement rather than as confirmation.

Still waiting on the maintainers for the stranding question. Nothing needed from you unless you want the Fixes trailer gone.

@szalikdev

Copy link
Copy Markdown

Independently confirmed this bug and fix on Omarchy 4.0.0-1 with Hyprland 0.56.2. The shipped hyprctl keyword monitor call silently left both outputs unchanged, while the Lua specs in this PR successfully disabled and re-enabled an LG UltraGear on DP-1 alongside a Dell P2424HEB on DP-2. I also confirmed that re-enabling requires the explicit disabled = false; a spec containing only mode/position/scale returned ok but left DP-1 disabled.

The patched display rows worked after reloading the shell plugin.

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at e11a597. The branch has not moved, so this is @szalikdev's report checked against Hyprland's own source, one new finding about the enable spec, and one open issue nobody here has named.

@szalikdev's disabled = false detail is not a quirk of a setup — it is what the binding does, and the source says why. hlMonitor in Hyprland v0.56.2 (src/config/lua/bindings/LuaBindingsConfigRules.cpp) takes the first existing rule whose output matches, copies it wholesale, and then applies only the fields your table names before appending the result. A spec of mode/position/scale inherits disabled = true from that copy and still answers ok, which is why three separate reproductions in this thread land on the same line. So the explicit disabled = false at Model.js:112 is a stable contract rather than a workaround.

That same merge is worth one more look on the enable path, because it means the enable spec throws away settings it does not need to. Since the disable inherits the rule that was already there, everything the enable spec names overwrites it. Measured on Hyprland 0.56.2 against an output pinned to 1280x720@60 at 200,100, scale 1:

hl.monitor({ output = X, disabled = true })                                              -> disabled=true,  1280x720 at 200,100 scale=1
hl.monitor({ output = X, disabled = false })                                             -> disabled=false, 1280x720 at 200,100 scale=1
hl.monitor({ output = X, disabled = false, mode = "preferred", position = "auto", scale = "auto" })
                                                                                         -> disabled=false, 1920x1080 at 1280,0 scale=2

The last line is what this branch sends, so re-enabling a display from the panel discards a mode or position pinned in monitors.lua — and also the scale the same panel set through omarchy-hyprland-monitor-scaling, which persists omarchy_monitor_scale for exactly that reason. It comes back at automatic values until the next hyprctl reload. The one-line alternative is safe in the case that would worry you: on an output with no rule at all before the disable, disabled = false on its own brings it back at the same geometry it had (measured — the inherited rule is the one your disable created, not empty defaults). Whether the toggle should restore what the display had or re-lay it out automatically is a product call, and the old ,preferred,auto,auto string argues for the current behaviour, so I have not pushed anything: it is worth a maintainer's word, and it touches open issue #7326.

Issue #7607 asks for exactly the change this PR is waiting on, and its diagnosis does not hold. It reports that turning the internal display off from this panel "doesn't persist — the watcher re-enables it within ~2s while docked", and asks for the toggle to call omarchy-hyprland-monitor-internal off. The ask is the same one that has been put to the maintainers here; the mechanism is wrong in both directions. Before this PR the toggle never disabled anything, so what the reporter saw was the row returning on the panel's own refresh. After it, the watcher still cannot revert a panel disable: enable_internal reaches enable_internal_output (bin/omarchy-hyprland-monitor-clamshell:157), whose spec omits disabled = false, so it answers ok every two seconds and changes nothing. Measured: a runtime hyprctl eval disable survives the watcher indefinitely and is cleared only by hyprctl reload. With this PR the disable therefore does stick for the rest of the session, which makes #7607 a second face of #6968 rather than a separate watcher bug and leaves only the reload and the unplug cases open.

Nothing else has changed: the stranding hazard is live at this head, #8028 landing would not close it, and it is still a maintainer decision between routing the internal display through omarchy-hyprland-monitor-internal on|off and taking #6710's persistent-override rewrite instead. Nothing needed from you.

Tests, on a disposable VM with the shell serving this branch (pgrep confirmed): monitor-test.sh 25 passed, monitor-recovery-test.sh 18 passed, monitor-clamshell-scale-test.sh 20 passed through the compositor-backed wrapper. Reviewed by Claude Opus 5 in Claude Code with a second opinion from Codex at xhigh. Codex raised the enable-spec point above independently, and settled a question left open last time: it traced Quickshell's Process implementation and showed the collector is finalised before exited fires, so reading actionStdout in the new onExited reports the run that just ended even though command may already have been reassigned.

@GibreelAbdullah

Copy link
Copy Markdown

When is this planned to be merged?

@omarchybot

Copy link
Copy Markdown
Collaborator

@szalikdev — thank you. That is the third independent confirmation on 4.0.0-1 / Hyprland 0.56.2, after @okurmustafa and @finnbuhk, and the first on a two-DisplayPort desktop pair rather than a laptop. Your disabled = false observation is the same one they measured and is what commit 6c56c9a exists for.

@GibreelAbdullah — there is no schedule, and this account does not merge anything, here or anywhere. It reviews, pushes fixes to the branch, and reports; what lands is the maintainers' call. This is not waiting on a review or on a defect. It is waiting on one product decision, and there are now two pull requests offering opposite answers to it — see the last two sections.

Nothing in the diff changed since the last review; the head was the same commit. What follows is what changed around it, plus one defect found in this run.

#6968 is fixed at this head, measured on a real compositor. On a disposable Omarchy VM running Hyprland 0.56.2 (efb5099), against a spare output:

  • the command quattro ships today, verbatim from shell/plugins/panels/monitor/Panel.qml:303 on the base branch — hyprctl keyword monitor HEADLESS-2,disable — exits 0, prints keyword can't work with non-legacy parsers. Use eval., and leaves the output disabled: false. That is Display panel can't toggle monitors on Hyprland 0.56: hyprctl keyword silently no-ops (Lua config) #6968 in full, including the exit 0 that made it silent.
  • this branch's command — hyprctl eval 'hl.monitor({ output = "HEADLESS-2", disabled = true })' — returns ok and the output goes disabled: true.

Fixes #6968 is in e11a597 and GitHub has the link registered, so merging this closes that issue with nothing further to do.

Two more measurements from the same session, because they settle open questions elsewhere: hl.monitor({ output = ..., mode = "preferred", position = "auto", scale = 2 }) against a disabled output returns ok and leaves it disabled, while the same spec with disabled = false brings it back; and scale = "auto" is accepted, which matters because it is what config/hypr/monitors.lua:7-8 ships as the default.

#8027 and #8028 were closed on 27 Aug pointing at this pull request, and this pull request does not fix them. #8028 was closed by its author "in favor of #7036" and #8027 closed as completed with "should be fixed by #7036". Neither is right: this branch touches only shell/plugins/panels/monitor/ and test/, and the bug is in bin/omarchy-hyprland-monitor-external-active, whose single line on quattro still counts any output not named eDP*/LVDS*/DSI* as an external monitor — which includes the FALLBACK output Hyprland invents when every real output is off. Nothing has landed on quattro for it, so a reproduced bug is now closed with no fix in flight except #7207, which addresses it only in recover(). Worth a maintainer reopening; not something this account will do to someone else's issue.

The stranding hazard is unchanged, and it is one field away — in quattro, not in this diff. Disabling the internal panel from this UI writes a runtime-only rule: no toggle flag, no reload. Ran the current quattro clamshell watcher against that state on the worker, with the real script and stubbed compositor, for an open-lid user who then unplugs the external monitor:

internal recover: returned at toggle-enabled guard (no flag) -- NO re-enable
eval hl.monitor({ output = "eDP-1", mode = "preferred", position = "auto", scale = 2 })

The watcher does reach enable_internal_output and does emit a spec for the internal panel — it just never says disabled = false, so per the measurement above it returns ok and the screen stays black. Adding that one field to bin/omarchy-hyprland-monitor-clamshell:173 flips the same run to disabled = false, mode = "preferred", ... and the panel comes back. (That line was :157 and :165 in earlier comments here; #8129 and #7581 have moved it since.) It is a one-line quattro fix owned by no open pull request, and it closes the black-screen half of this without settling anything about routing.

There is now a competing pull request: #8728, opened yesterday. It answers the routing question this one is parked on, by sending internal-display toggles through omarchy-hyprland-monitor-internal on|off — so the disable writes the toggle flag, survives a reboot, and is recovered by the watcher, which closes the stranding hole and #7607. Read against this branch, from its diff: it re-enables an external with disabled = false alone and so does not overwrite a mode, position or scale pinned in monitors.lua, which this branch's preferred/auto/auto does — that is the #7326 point raised here on 25 Aug, and #8728 is the better of the two on it. It rejects unsafe connector names outright rather than escaping them, matching what #8129 did across bin/. It does not carry the exit-code logging this branch has, so a refused spec is silent again. And its apply_monitor_layout() hook names a function that exists nowhere in the repository; the type(...) == "function" guard makes it a no-op on a default install. Which of the two to take is a maintainer's decision about behaviour — a routed disable brings a notification, reboot persistence, and a refusal when no external display is active — and neither pull request should be closed by anyone but a maintainer.

Pushed to this branch: 2bcb246, one defect, in the bot's own earlier commit rather than yours. e11a597 read the stdout collector from inside Process.onExited. Those two signals have no guaranteed order — this repository states so twice, at shell/plugins/panels/wifiqr/Panel.qml:162 and shell/plugins/panels/speedtest/Panel.qml:131, and handles it the same way in both places — so a refused change could have logged its exit code with an empty spec, losing the part actually worth reading. The exit code is now held and whichever signal arrives second logs the pair, once.

Tests, on a disposable VM with the compositor serving this branch (pgrep confirmed it came back on the worktree), after the push: monitor-test.sh 25 passed, monitor-clamshell-scale-test.sh 20, monitor-recovery-test.sh 18, monitor-state-test.sh 5, monitor-scaling-test.sh 14 — 82 assertions, none failing. The QML loads clean in a real session with no errors in the journal; the failing-toggle path itself was not driven through the UI, so the new handler is verified by structure and precedent rather than by a forced race.

Reviewed by Claude Opus 5 in Claude Code, with a second opinion from Codex at xhigh reasoning. Codex found the signal-ordering defect above, which neither the first review nor the previous run had caught, and independently traced the watcher's return path to the same line the worker measurement landed on. It also worked through whether an attacker-chosen monitor name can escape quoteLua and reach Lua execution, and concluded it cannot — a carriage return breaks the string but only into a syntax error Hyprland rejects, U+2028/U+2029 do not end a Lua short string, and a NUL cannot cross the argument vector. That analysis is its own; note that codex's independence is not currently guaranteed, since its sandbox restricts writes but not reads.

Nothing needed from you.

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed the two new commits at 1cfad3e8, on a worker VM with quickshell serving this tree. The stranding I raised on 22 and 25 August is answered: the panel now writes internal-monitor-disable.lua, so recover and the omarchy-recover-internal-monitor boot service both have something to recover from. Nothing to add to your own description of that. Four things that are new.

Verified rather than assumed. monitor-test.sh, monitor-output-name-test.sh, monitor-recovery-test.sh and monitor-clamshell-scale-test.sh pass on the worker (31/12/18/25 assertions). I mutated the code rather than trust green: dropping enable_output from on() and recover() fails "internal on re-enables the output it stopped disabling", and pointing the internal name back at the direct hyprctl eval fails "monitor disables the built-in panel through the command that owns it". Both new groups pin what they claim. Two weaker cases do not — the unsafe-name on case at monitor-output-name-test.sh:81 and the no-flag recover case at :98 pass against the unfixed code too.

One state where the switch still does nothing. With internal-monitor-mirror set, off() at bin/omarchy-hyprland-monitor-internal:61 writes no flag, sends no notification, runs no hyprctl, and exits 0. Measured on the worker with the helpers stubbed:

--- mirror toggle ON ---
exit=0
flag: NONE
notify: []
hyprctl: []

Exit 0 means warnRefusedAction never fires either, so the row flips, refresh() reads the unchanged state back, and it flips again with nothing in the journal. Not a regression, since the switch does nothing on quattro today, but it is the one state this PR leaves it doing nothing. Whether disabling should clear the mirror, refuse out loud, or stay a no-op is a product call, so I have pushed nothing.

What the new recover() does not reach. recover returns at :73 when the manual flag is unset, which is exactly the lid-open case, so bin/omarchy-hyprland-monitor-clamshell:173 is still the path taken and still omits disabled = false. Traced on the worker with the clamshell flag set and no manual flag:

HYPRCTL reload
HYPRCTL monitors all -j
HYPRCTL eval hl.monitor({ output = "eDP-1", mode = "preferred", position = "auto", scale = 2 })
HYPRCTL dispatch hl.dsp.dpms({ action = "enable", monitor = "eDP-1" })

The same one-field defect you just fixed in on/recover, in the other file, on a path this branch does not touch and no open PR owns.

Two smaller ones. on() and recover() end in wake, which is || true, so a failed enable_output reaches the panel as exit 0 and logs nothing. And enabling the built-in panel from the widget while the lid is shut lights it and leaves internal-monitor-clamshell.lua on disk with its expected contents, so disable_internal at :239 sees no change and never reloads — the panel stays lit inside a closed lid until something else reloads. That one predates these two commits.

Reviewed by Claude Opus 5 in Claude Code and by Codex at xhigh. Codex reached the mirror no-op separately from the measurement above and contributed the closed-lid and exit-status points; its independence is not currently guaranteed, because it can read this session's own transcript.

Waiting on the maintainer and unchanged: the deliberate behaviour change you flagged, the choice against #8728, and #6710.

@joelclark

Copy link
Copy Markdown

Please do not treat this PR as closing #8027 / replacing #8028.

This change is the right fix for the Display panel (hyprctl keyword vs eval) and for on/recover needing an explicit disabled = false. It does not change omarchy-hyprland-monitor-external-active, and recover() still returns immediately when that helper is true:

omarchy-hyprland-monitor-external-active && return 0

Hyprland 0.56 creates a virtual FALLBACK output (disabled: false) when the last enabled monitor goes away. A disabled eDP-1 does not count, so unplugging the external after Super+Ctrl+Delete makes the helper report “external still active.” The clamshell watcher retries and every attempt bails at that line. The recover test here stubs the helper to exit 1, so it does not cover that case.

Reproduced 2026-09-14 on Omarchy 4.0.3-1 / Hyprland 0.56.2 with an Apple Studio Display over Thunderbolt. Details on #8027. The helper fix is still #8028.

@f1n3d

f1n3d commented Sep 24, 2026

Copy link
Copy Markdown

Independent confirmation of #6968, plus one data point on the enable path that differs from what is reported above.

Setup: Omarchy 4.0.4-1, Hyprland 0.56.2, desktop with 2x DisplayPort (DP-1 [email protected] at 0x0, DP-2 same mode at 1920x0) using explicit hl.monitor entries in ~/.config/hypr/monitors.lua.

  • Stock behavior reproduced: hyprctl keyword monitor DP-2,disable prints keyword can't work with non-legacy parsers. Use eval. and exits 0, leaving the output unchanged. The Display panel toggle silently does nothing, as described.
  • hyprctl eval 'hl.monitor({ output = "DP-2", disabled = true })' disables the output instantly.
  • Re-enable differs on this setup: an eval spec with disabled = false (tried with and without mode/position/scale) returned ok but left the output disabled in hyprctl monitors all -j. What reliably brought it back with its exact mode/position/scale was hyprctl reload, which re-applies monitors.lua.

That last point may matter for the enable spec chosen here: mode = preferred, position = auto, scale = auto resets the position to auto, which collapses explicit side-by-side layouts like 0x0/1920x0. A reload-based enable (or preserving the current position in the eval) keeps them intact. I opened #13142 with the same observation for the scaling path, where position = auto had the same effect.

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
kris-1 added a commit to kris-1/omarchy-monitor-layout that referenced this pull request Sep 29, 2026
Hyprland 0.55+ refuses `hyprctl keyword`, so the DISPLAYS toggle did
nothing. Backport omacom/omarchy#7036 verbatim: external outputs go
through `hyprctl eval` with hl.monitor, the laptop panel through
omarchy-hyprland-monitor-internal. The row now flips at once and a
state read from before the switch no longer restores it, so a second
click cannot repeat the first while omarchy-monitor-state is slow.

Fixes #1

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Following the merge of #13725, The Display panel Lua-command failure is fixed. This PR also routes the built-in display through its owning toggle command and repairs internal-display re-enable/recovery; those laptop-recovery changes remain unmerged.

Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup.

Omabot on behalf of DHH

@paulogeyer

Copy link
Copy Markdown
Contributor

#16147 is merged now, and it covers the layout half of this: the Display panel re-enables an output with hl.monitor({ output = ..., disabled = false }) and leaves its mode, position and scale alone. On my laptop, the monitor-toggle-test.sh from #16147 fails on quattro just before that merge and passes on the current tip.

This branch conflicts with quattro in shell/plugins/panels/monitor/Panel.qml, and displayToggleSpec here still re-enables external outputs with mode = "preferred", position = "auto", scale = "auto", which is the case #16147's test rejects. The part that #13725 and #16147 don't cover is the built-in panel: routing it through omarchy-hyprland-monitor-internal and the enable_output call in on/recover. Rebasing down to that, with the merged enable spec kept, would make this a small laptop-recovery PR.

omarchybot and others added 6 commits October 28, 2026 20:51
hyprctl prints a rejected monitor spec on stdout and exits 7, and the panel collected that stdout and threw both it and the exit code away, so a refused change looked exactly like an applied one. Measured on Hyprland 0.56.2: `hyprctl eval 'hl.monitor({ output = "Virtual-1", disabled = )'` prints `error: ...unexpected symbol near ')'` on stdout, nothing on stderr, and exits 7.

Reading stdout rather than adding a stderr sink is deliberate: the error never reaches stderr, so a stderr collector here would log nothing. The message names no command for a related reason: `actionProc` is shared with `setScale`, and either function reassigns `command` on a click that lands while the process is still running, so by the time the exit arrives the property may describe an action that was never run. hyprctl quotes the spec it refused, which is the part worth having.

That silence is what let this bug survive a release. `hyprctl keyword` goes further and exits 0 while refusing, so nothing downstream could tell the toggle had done nothing; `hyprctl eval` at least reports it, and now the panel does too.

Fixes omacom#6968

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Codex XHigh <[email protected]>
`Process.onExited` and `StdioCollector.onStreamFinished` have no guaranteed order, so reading the collector from inside `onExited` could report the exit code with an empty spec -- and the spec hyprctl quotes back is the half of the message worth having. The repo already states that ordering twice, at `shell/plugins/panels/wifiqr/Panel.qml` and `shell/plugins/panels/speedtest/Panel.qml`, and handles it the same way both times: hold what the first signal carries and let the second one publish the pair.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Codex XHigh <[email protected]>
omarchy-hyprland-monitor-internal on clears the disable flag and reports
success, but the output stays dark. It is the same defect this branch fixes in
the Display panel: hl.monitor edits the rule it finds rather than replacing it,
so a monitor Hyprland has already disabled is only re-enabled by a spec that
says disabled = false, and nothing here sent one.

recover has it too, and that one matters more, because it is the path the
clamshell watcher takes when the external display is unplugged. Both now go
through enable_output, which repeats off()'s rule that only a plain connector
name may be written into Lua.

Stands alone from the rest of the branch.
Disabling the built-in panel from the Display panel wrote a runtime only rule:
no toggle flag for the clamshell watcher to read, no guard against turning off
the last display, and nothing surviving a reboot. Unplug the external after
that and there is no display left and no flag to recover from, which is the end
state reported in omacom#7228.

omarchy-hyprland-monitor-internal already holds all three, so the internal
output is routed through it and every other output keeps the direct call.

Which output counts as internal comes from omarchy-hyprland-monitor-laptop by
way of omarchy-monitor-state, so LVDS and DSI panels are covered rather than
only the name that happens to be most common. Matching on an eDP prefix instead
fails the LVDS assertion in monitor-test.sh.
Both passed against the script before enable_output existed, because
each asserted only the absence of an eval that code never sent.

The unsafe-name case of on now also requires the unsafeName notice.
The no-flag case of recover now sees the wake as well as the eval, so it
fails when the flag guard goes, with or without enable_output. With no
flag, recover behaves the same before and after enable_output, so no
assertion on it alone can tell the two apart; the lid-open path it
leaves to the clamshell sync is pinned in that sync's own test.
on and recover ended in the wake, which never fails, so a spec hyprctl
refused or a name enable_output rejected still exited 0, and the Display
panel's refused-change log never fired for the built-in panel. Both now
return enable_output's status, and the wake still runs either way.
@sterre-g
sterre-g force-pushed the fix-display-toggle-under-lua-parser branch from 1cfad3e to cee977b Compare October 28, 2026 20:03
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change is limited to display controls and built-in display recovery.

The PR appears safe to merge, with non-blocking improvements to error reporting and panel test coverage.

Findings

  1. P2 Enable errors lose their explanation ▶
  2. P2 Internal routing goes untested ▶

Summary

The PR routes built-in display switches through omarchy-hyprland-monitor-internal and keeps external displays on direct Lua calls.

  • External displays switch on and off through Hyprland's Lua monitor API.
  • Built-in display switches use the command that owns their saved state.

Acknowledgments from sterre-g:

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Display switch] --> B{Built-in display?}
  B -->|Yes| C[Internal display helper]
  C --> D{Requested state}
  D -->|Off| E[Check external display and save disable flag]
  D -->|On| F[Clear disable flag and explicitly enable output]
  B -->|No| G[Direct Lua monitor call]
  C --> H[Record failure and refresh panel]
  G --> H
Loading

Reviews (1) · Last reviewed commit: "🩹 Exit non-zero when the internal panel..." · Reviewed by Greptile

return 1
fi

hyprctl eval "hl.monitor({ output = \"$INTERNAL\", disabled = false })" >/dev/null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Enable errors lose their explanation

enable_output discards the error text from hyprctl eval. When enabling the built-in display fails, the helper returns the failure code, but the panel warning cannot show why it failed. Keep successful output quiet, but forward the error text on failure so the journal contains more than an exit code.

}
const invoke = vm.runInNewContext('(' + method[0] + ')', {
root: { enabledDisplayCount: count }, actionProc
root: { enabledDisplayCount: count }, actionProc, Model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Internal routing goes untested

The panel test never supplies root.internalMonitor, so every case takes the external-display path. The model tests cover the command builder, but would still pass if toggleDisplay stopped passing the internal display name. Add panel-level cases with internalMonitor set and check both on and off commands.

@omarchybot omarchybot removed the enhancement New feature or request label Nov 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again at cee977b5, since the branch moved on 28 Oct. This was read, not run: I didn't put it on a worker, for the reasons below.

What this pull request is hasn't been settled. I classified it as a bug fix, since it fixes things that don't work. Codex Medium, classifying on its own from the item alone, called it an enhancement, presumably because sending the built-in panel through omarchy-hyprland-monitor-internal changes behaviour on purpose: you now get a notification and the disable survives a reboot, as the description says. When the two disagree it gets no class label, so I've taken off the enhancement label this account added on 21 Oct. Which one it is is the maintainer's call.

Most of this diff targets code that quattro no longer has. #17159, merged on 31 Oct, removed the Display panel's per-display on/off switch on purpose. Its commit says "The panel no longer turns displays on and off, so toggleDisplay and its test go." So on quattro today:

  • toggleDisplay in shell/plugins/panels/monitor/Panel.qml is gone, and test/shell.d/monitor-toggle-test.sh was deleted. GitHub shows this branch conflicting in those two files.
  • That makes the displayToggleSpec / displayToggleCommand changes in Model.js, the actionProc exit-code logging, and their monitor-test.sh assertions dead code if merged.
  • The clamshell watcher's missing disabled = false, raised earlier in this thread, has been addressed on quattro separately (Laptop display turned off from the Monitor panel stays off after the external display is unplugged #16307) (enable_internal_output in bin/omarchy-hyprland-monitor-clamshell).

The part that still applies to quattro is the change to bin/omarchy-hyprland-monitor-internal (enable_output in on and recover) and its tests in monitor-output-name-test.sh. Before it's worth carrying forward, it needs to show the bug it fixes still exists. on and recover turn the toggle off through omarchy-hyprland-toggle, which ends in hyprctl reload. An earlier measurement in this thread (22 Aug) found that a reload brings back an output disabled at runtime. Whether the same holds once the flag's config rule is removed and the config reloaded hasn't been shown either way. The new tests stub hyprctl, so they show the eval is sent, not that the panel would otherwise stay dark.

What happens next: @sterre-g, if you want to keep this going, the useful shape is the one @paulogeyer suggested on 21 Oct, cut down further now that the panel switch is gone. That means a branch on current quattro carrying only the omarchy-hyprland-monitor-internal change and its tests, plus a reproduction showing omarchy-hyprland-monitor-internal on leaving the panel dark after the reload. Whether that's wanted, and whether this one should be closed, is up to the maintainer.

@sterre-g

sterre-g commented Nov 4, 2026

Copy link
Copy Markdown
Author

Reproduction attempt for the question in the last review: does omarchy-hyprland-monitor-internal on leave the built-in panel dark after the reload?

Setup: Omarchy 4.0.6 (its on() is identical to quattro at 50bb5db: clear the internal-monitor-disable flag, reload, wake), Hyprland 0.56.2 with the Lua parser, a laptop with eDP-1 ([email protected], scale 1.25) and HDMI-A-1 connected, lid open.

  1. omarchy-hyprland-monitor-internal off: the flag was written and hyprctl monitors all -j reported eDP-1 disabled: true after the reload.
  2. omarchy-hyprland-monitor-internal on: the flag was removed and eDP-1 reported disabled: false 4 s and 8 s later, with its workspaces back on it.

So on current Hyprland the reload does bring the panel back once the flag's rule is gone, and the enable_output change in on/recover is not needed. The earlier dark-panel reports were against the runtime hl.monitor rule the Display panel used to set, which #16147 and #17159 have since replaced. I'd close this PR rather than carry the cut-down version forward; the two open Greptile threads are on code that would go with it.

One side observation: the panel came back at 60.01 Hz rather than 165.02 Hz, and was at 165.02 Hz again by the next check about a minute later.

@sterre-g

sterre-g commented Nov 4, 2026

Copy link
Copy Markdown
Author

Closing: the reproduction above shows omarchy-hyprland-monitor-internal on brings the built-in panel back on Hyprland 0.56.2 once the flag is cleared, and the Display panel's runtime rule this PR worked around has since been replaced upstream (#16147, #17159). The remaining change isn't needed, and the conflicts are in code that would be dropped with it.

@sterre-g sterre-g closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

10 participants