Skip to content

Fix Display panel monitor toggle under the Lua config parser - #11112

Open
gushy79 wants to merge 1 commit into
omacom:quattrofrom
gushy79:fix-monitor-toggle-lua-parser
Open

Fix Display panel monitor toggle under the Lua config parser#11112
gushy79 wants to merge 1 commit into
omacom:quattrofrom
gushy79:fix-monitor-toggle-lua-parser

Conversation

@gushy79

@gushy79 gushy79 commented Sep 10, 2026

Copy link
Copy Markdown

Authorship: this fix was investigated and written by Claude Code
(Anthropic's agentic CLI). I reviewed it and am submitting it on its behalf.

Problem

The Display bar panel (shell/plugins/panels/monitor/Panel.qml) lists every
display with an enable/disable row, but toggleDisplay() runs:

hyprctl keyword monitor <name>,disable        # off
hyprctl keyword monitor <name>,preferred,auto,auto   # on

Hyprland disables the legacy hyprctl keyword IPC whenever the config is read
by the Lua parser:

$ hyprctl keyword monitor DP-3,disable
keyword can't work with non-legacy parsers. Use eval.

Omarchy v4 ships the Lua hypr config as the sole default (config/hypr/*.lua,
no hyprland.conf), so on a stock v4 install every monitor on/off row in the
panel is a silent no-op — the command errors on stderr, which the panel
doesn't surface. Brightness and scale in the same panel are unaffected; they
go through omarchy-* helpers.

Fix

Drive the Lua hl.monitor helper through hyprctl eval instead, which is the
same mechanism bin/omarchy-hyprland-monitor-internal already uses to disable
the internal display (hl.monitor({ output = ..., disabled = true })). The
connector name comes from omarchy-monitor-state (Hyprland .name), and is
guarded with the same ^[A-Za-z0-9._-]+$ check the bin/ monitor helpers
apply before interpolating a name into eval'd Lua.

-    actionProc.command = ["hyprctl", "keyword", "monitor", name + (enabled ? ",disable" : ",preferred,auto,auto")]
+    if (!/^[A-Za-z0-9._-]+$/.test(name)) return
+    actionProc.command = ["hyprctl", "eval",
+      "hl.monitor({ output = \"" + name + "\", disabled = " + (enabled ? "true" : "false") + " })"]

Re-enabling with disabled = false picks the mode/position back up from the
catch-all hl.monitor({ output = "", mode = "preferred", position = "auto" })
rule, matching the previous ,preferred,auto,auto behaviour. Like the old
code this is a runtime change and doesn't persist across a config reload —
semantics are unchanged there.

Testing

  • ./test/shell — no new failures (the 6 pre-existing failures on my machine —
    config, locate, runtime-smoke, screenshot-sanity, snapper,
    unowned-system-paths — reproduce on a clean quattro checkout and are
    environmental).
  • Manual, on Omarchy 4.0.3 with two external monitors: toggling each display
    row off/on from the panel now disables/re-enables the output
    (hyprctl monitors disabled: flips); before the patch the rows did
    nothing.

🤖 Generated with Claude Code

The per-monitor enable/disable rows in the Display panel run
`hyprctl keyword monitor <name>,disable`, which Hyprland rejects when the
config is parsed by the Lua parser ("keyword can't work with non-legacy
parsers. Use eval.") — the default for Omarchy's Lua hypr config, so the
toggle is a silent no-op for essentially every v4 install. Drive the Lua
`hl.monitor` helper through `hyprctl eval` instead, matching how
`omarchy-hyprland-monitor-internal` already disables the internal display,
and guard the connector name like the bin/ monitor helpers before it is
interpolated into the eval'd string.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gushy79
gushy79 force-pushed the fix-monitor-toggle-lua-parser branch from 6bb7969 to 81fcc09 Compare September 10, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant