Fix the display panel's on/off rows under the Lua config parser - #10194
Open
kidskript3 wants to merge 1 commit into
Open
Fix the display panel's on/off rows under the Lua config parser#10194kidskript3 wants to merge 1 commit into
kidskript3 wants to merge 1 commit into
Conversation
The rows called `hyprctl keyword monitor <name>,disable`, which the
non-legacy Lua parser refuses ("keyword can't work with non-legacy
parsers. Use eval.") while hyprctl still exits 0, so nothing surfaced and
the display never toggled.
Switch the toggle to `hyprctl eval` and spell out `disabled = false` when
an output comes back; restating a mode alone returns ok and leaves an
already-disabled output off.
Coming back on also has to land where it was. Scale and position can only
be read dependably while an output is on, and "auto" for both re-places
the display and drops a scaled one to 1, so `omarchy-monitor-state` now
carries each display's scale and position and the panel remembers the last
values it saw while an output was on.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10086.
The bug
The rows under DISPLAYS in the monitor panel do nothing. Clicking one leaves the display on, and nothing is reported anywhere.
Panel.qmltoggles through the legacy syntax:Omarchy configures Hyprland through the Lua parser, which refuses that outright — and hyprctl still exits 0, so the panel has nothing to react to:
The fix
hyprctl evalwith anhl.monitor({ ... })rule.disabled = falsewhen switching an output back on. Restating a mode alone returnsokand leaves an already-disabled output off."auto"for both re-places the display and drops a scaled one to 1.omarchy-monitor-statenow carriesscale,xandyper display, and the panel remembers the last values it saw while an output was on.Rule building and remembering are pure functions in
Model.js, so both are unit-tested rather than only reachable through the UI.Tests
test/shell.d/monitor-test.sh— new assertions formonitorRule(disable, restore, and the auto fallback for an output never seen enabled) andrememberLayouts(records every enabled display, keeps the last layout of one that went off).test/shell.d/monitor-state-test.sh— fixtures and the display-list expectations extended to the new fields.test/shellrun: 222 of 226 files pass. The four failures (bar-icon-geometry,config,snapper,unowned-system-paths) fail identically on an unmodified checkout of this branch point on this host.Verified on hardware
Alienware m15 R7 — internal eDP-1 (2560x1440) plus an external 5120x1440 on DP-1, both at scale 1.25, Hyprland 0.56.2:
hyprctl configerrorsis empty throughout. The same sequence throughhyprctl keywordchanges nothing at all.🤖 Generated with Claude Code