omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Display panel cannot toggle monitors: uses `hyprctl keyword`, which the Lua parser rejects (exit 0)

Open kidskript3 opened this issue 2 months ago • 2 comments

What happened

The display panel (omarchy.monitor, SUPER + CTRL + D) lists every connected output under DISPLAYS with a clickable row to enable/disable it. Clicking a row does nothing. No monitor is switched, no error is shown, and the checkmark stays as it was.

The rows are not dead code — toggleDisplay() runs, and it runs this:

// shell/plugins/panels/monitor/Panel.qml:303
actionProc.command = ["hyprctl", "keyword", "monitor", name + (enabled ? ",disable" : ",preferred,auto,auto")]

Omarchy configures Hyprland in Lua, so the non-legacy parser is active, and it rejects hyprctl keyword outright:

$ hyprctl keyword monitor eDP-1,disable
keyword can't work with non-legacy parsers. Use eval.
$ echo $?
0

The exit code is 0. actionProc has no way to notice the failure, so the panel silently reports success and the UI never diverges from what the user sees on screen.

The same call in the Lua form works:

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

Expected

Clicking a display row enables or disables that output.

Steps to reproduce

  1. Connect a second monitor (any two enabled outputs).
  2. Press SUPER + CTRL + D.
  3. Click either row under DISPLAYS.
  4. Nothing happens. hyprctl monitors all -j shows both outputs unchanged.

Notes toward a fix

Elsewhere in the tree this is already done correctly — omarchy-hyprland-monitor-clamshell uses hyprctl eval "hl.monitor({ ... })". The panel appears to be the last caller still on the legacy syntax.

Two details that cost me time when patching this locally, in case they help:

  • Re-enabling needs an explicit disabled = false. A rule that merely restates mode/position/scale returns ok and leaves an already-disabled output off. Only hl.monitor({ output = "X", disabled = false, ... }) brings it back.
  • ,preferred,auto,auto does not round-trip. An output switched off forgets its scale and position, so auto returns it at Hyprland's computed scale and auto placement rather than what monitors.lua configured. Here a 5120x1440 ultrawide configured at scale = 1.25 came back at scale = 1, and the two monitors swapped sides. Remembering scale and position while the output is still on, and restoring them explicitly, avoids this.

System

  • Omarchy 4.0.2-1
  • Hyprland 0.56.2
  • Intel Core i7-12700H / NVIDIA RTX 3070 Ti Laptop GPU
  • Outputs: internal laptop panel (2560x1440) + external ultrawide (5120x1440@144), both at scale 1.25

No debug log attached — the failure is fully contained in the four lines of shell output above, and omarchy debug carries considerably more about this machine than the bug needs.

kidskript3 avatar Sep 03 '26 22:09 kidskript3

Thanks for the clear report and reproduction details. This is a duplicate of #9622, which identifies the same hyprctl keyword monitor incompatibility with Hyprland’s Lua parser.

There are already competing fixes in #7036 and #8728. The current maintainer recommendation is to advance #7036: it handles the external Lua eval path, routes built-in displays through Omarchy’s internal-monitor helper (including recovery), keeps failures observable, and has more complete coverage. #6710 overlaps but is broader and currently stale/merge-dirty.

The remaining acceptance gate is hardware validation: off/on round trips must preserve mode, refresh rate, position, fractional scale, rotation/mirroring, catch-all/desc: rules, and laptop-undock recovery.

Closing as a duplicate of #9622; follow the implementation discussion in #7036.

spencerbull avatar Sep 04 '26 03:09 spencerbull

Update: #13725 has merged into quattro. The Lua-command toggle failure is fixed. Restoring the prior scale and position when re-enabling a display remains outside the merged change.

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

omarchybot avatar Oct 04 '26 12:10 omarchybot