Skip to content

Persist monitor scaling onto named per-output rules - #8145

Closed
chessing234 wants to merge 1 commit into
omacom:quattrofrom
chessing234:fix/monitor-scaling-persist-named-outputs
Closed

chessing234 wants to merge 1 commit into
omacom:quattrofrom
chessing234:fix/monitor-scaling-persist-named-outputs

Conversation

@chessing234

@chessing234 chessing234 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

omarchy-hyprland-monitor-scaling applied the scale live via hyprctl eval but only wrote monitors.lua for the generic omarchy_monitor_scale local or the wildcard output = "" rule. Explicit per-output rules (what nwg-displays writes) were left stale, and the clamshell poller re-applied the old file scale every ~2s.

It now updates the focused output's own hl.monitor rule (single-line and multi-line). Unrelated outputs keep their scales. If no rule matches, an explicit named rule is appended so the live change cannot be reverted.

monitor-scaling-test.sh covers the generic catch-all, eDP-1-only, HDMI left alone, live eval, multi-line form, and append-when-missing.

Fixes #8103

set_scale already applied the new scale live, but only wrote
omarchy_monitor_scale or the wildcard catch-all. Dual-monitor configs
with explicit hl.monitor({ output = "eDP-1", ... }) rules were left
stale, so the clamshell poller re-applied the old file scale every ~2s.
Copilot AI balanced review requested due to automatic review settings August 25, 2026 03:49

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

Persists focused-monitor scaling in explicit per-output Hyprland rules to prevent clamshell polling from restoring stale values.

Changes:

  • Updates named single-line and multi-line monitor rules.
  • Appends a focused-output rule when none matches.
  • Adds regression tests for persistence behavior.

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 1 out of 2 changed files in this pull request and generated no comments.

File Description
bin/omarchy-hyprland-monitor-scaling Persists scaling in focused-output rules.
test/shell.d/monitor-scaling-test.sh Tests named, multiline, and appended rules.

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

@chessing234

Copy link
Copy Markdown
Contributor Author

@dhh @ryanrhughes ready for review

@johnpippett

Copy link
Copy Markdown

Test results for commit b8a9fa3342a1e72f7f9dfaa990a387a3426d965d:

A local test with simulated Hyprland responses passed for the explicit, single-line monitor rules below.
The test used copies of this PR's scaling script and the installed Omarchy 4.0.2-1 recovery script.
It used temporary configuration and state paths. It also simulated the lid and monitor helper commands.
I did not install this PR in the active Hyprland session.

Starting configuration:

local omarchy_gdk_scale = 2
hl.env("GDK_SCALE", tostring(omarchy_gdk_scale))
hl.monitor({ output = "eDP-1", mode = "2560x1600@144", position = "0x0", scale = 1.25 })
hl.monitor({ output = "DP-1", mode = "3840x2160@60", position = "auto-right", scale = 1 })

With eDP-1 selected, the test gave these results:

  • Requests for 1.6, then 1.25, changed the scale in the existing eDP-1 rule.
  • The file kept exactly one eDP-1 rule.
  • The script did not change the external rule, including its scale, mode, and auto-right position.
  • The installed recovery script kept the requested scale after each change.
  • The scaling script also changed omarchy_gdk_scale from 2 to 1 for the 1.25 request.

With the installed scaling script, the same test did not change the saved scale of 1.6.
Recovery then changed the active scale from 1.25 to 1.6.

These results cover only the rules shown above. I did not test multiline rules, physical dock or lid events, or the full repository test suite.

The live reproduction and configuration workaround results are in this issue comment.

Codex ran the local tests and helped prepare this comment.

@chessing234

Copy link
Copy Markdown
Contributor Author

folded into #12263 for easier review.

chessing234 added a commit to chessing234/omarchy that referenced this pull request Sep 25, 2026
chessing234 added a commit to chessing234/omarchy that referenced this pull request Sep 25, 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

Development

Successfully merging this pull request may close these issues.

omarchy-hyprland-monitor-scaling doesn't persist scale on outputs with explicit per-monitor rules in monitors.lua

3 participants