Skip to content

Refactor monitor_rules for better rule processing - #7408

Open
yi-zelin wants to merge 1 commit into
basecamp:quattrofrom
yi-zelin:yi-zelin-patch-1
Open

Refactor monitor_rules for better rule processing#7408
yi-zelin wants to merge 1 commit into
basecamp:quattrofrom
yi-zelin:yi-zelin-patch-1

Conversation

@yi-zelin

Copy link
Copy Markdown

Fixes #7326

What's wrong?

nwg-displays generate multi-line formatted Lua monitor configs (where hl.monitor({, output, and scale sit on separate lines).

Because omarchy-hyprland-monitor-clamshell pipes monitors.lua line-by-line into sed, configured_monitor_value() fails to match the regular expression, which expects the entire hl.monitor({ ... }) declaration to reside on a single line. This parsing failure causes read_monitor_scale() to fall back to the default scale = 2, continuously reverting fractional scale configurations.

What does this PR do?

  • Updates monitor_rules() to flatten multi-line table declarations into a single stream using tr '\n' ' '.
  • Injects a newline before each hl.monitor declaration using sed 's/hl\.monitor/\n&/g'.
  • Ensures each monitor definition is isolated onto its own line so the existing downstream regex parser can reliably extract keys without modifying the underlying extraction logic.

fix(monitor-watch): support multi-line lua monitor configs generated by GUI tools
Copilot AI balanced review requested due to automatic review settings August 18, 2026 17:56

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.

Copilot wasn't able to review any files in this pull request.


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

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.

Internal monitor position cannot be made to stick: clamshell watcher and Display panel scaling both re-apply position = "auto"

2 participants