Repository navigation
Conversation
4a30e6d to
c14e46d
Compare
There was a problem hiding this comment.
Pull request overview
Fixes monitor toggling under Hyprland’s Lua configuration engine and synchronizes internal display state with Omarchy helpers.
Changes:
- Uses
hyprctl evalfor external displays. - Routes internal display toggles through Omarchy.
- Adds connector validation and toggle tests.
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 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
shell/plugins/panels/monitor/Panel.qml |
Updates monitor toggle dispatch and validation. |
test/shell.d/panel-monitor-toggle-test.sh |
Adds monitor command-mapping tests. |
Suppressed comments (2)
test/shell.d/panel-monitor-toggle-test.sh:24
- These tests quote variables inside
[[ ]]; the repository convention inAGENTS.md:26-27is to leave variables unquoted and quote only string literals.
if [[ "$name" == "$internal" || ( -z "$internal" && "$name" =~ ^eDP ) ]]; then
if [[ "$enabled" == "true" ]]; then
test/shell.d/panel-monitor-toggle-test.sh:30
- This comparison quotes the variable inside
[[ ]], contrary toAGENTS.md:26-27; only the literal should be quoted.
if [[ "$enabled" == "true" ]]; then
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
c14e46d to
2188b39
Compare
|
Automated duplication check: this pull request looks similar to #7036, which covers the same monitor enable/disable path. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
|
Update: #13725 has merged into 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 |
Summary
hyprctl keyword monitor ..., which is rejected by Hyprland 0.56+ when running the Lua config engine and silently no-ops.disabled = falseinhl.monitor(); otherwise Hyprland preserves the disabled state.omarchy-hyprland-monitor-internal on/offso that toggle state files (~/.local/state/omarchy/toggles/hypr/), desktop notifications, and recovery logic stay in sync.^[A-Za-z0-9._-]+$) on connector names before embedding intohyprctl eval, showing a notification on refusal.apply_monitor_layout()(when re-enabling) to immediately reposition displays upon toggling.Files Changed
shell/plugins/panels/monitor/Panel.qml— updatedtoggleDisplay(...)to dispatchhyprctl evalfor external monitors, route laptop displays throughomarchy-hyprland-monitor-internal, and sanitize connector names.test/shell.d/panel-monitor-toggle-test.sh— added unit test verifying command mapping, internal vs. external dispatch, and name validation.Root Cause
hyprctl keywordis rejected by Hyprland when using the Lua parser:"keyword can't work with non-legacy parsers. Use eval."hl.monitor()requiresdisabled = falseexplicitly; otherwise the monitor remainsdisabled: true.hyprctldid not update Omarchy's toggle flag files, causing desync with the clamshell watcher.Related Issues
hyprctl keywordsilently no-ops (Lua config) #6968 (Display panel can't toggle monitors on Hyprland 0.56): Replaces deprecatedhyprctl keywordwithhyprctl eval hl.monitor()and explicitdisabled = falseparameters.omarchy-hyprland-monitor-internalso toggle state files remain in sync with the clamshell watcher.Testing Performed
Automated Test Suite (All 93 passed)
Live Manual Verification (Omarchy 4.0.1, Hyprland 0.56.2 Lua)
External Monitor Toggle (Disable & Re-enable)
hl.monitor({ output = "DP-2", disabled = true })and the display disabled immediately.hl.monitor({ output = "DP-2", disabled = false })(andapply_monitor_layout()where applicable) restored the screen smoothly without silent rejection.Internal Laptop Monitor Toggle
omarchy-hyprland-monitor-internal on|offran and~/.local/state/omarchy/toggles/hypr/internal-monitor-disable.luawas created/removed; the clamshell watcher remained in sync.Connector Name Sanitization
/^[A-Za-z0-9._-]+$/before Lua evaluation; unsafe names trigger a notification and are refused.