Repository navigation
Conversation
fix(monitor-watch): support multi-line lua monitor configs generated by GUI tools
There was a problem hiding this comment.
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.
|
Thanks for tracking this down, @yi-zelin. The bug is real: on This pull request is one of two open fixes for that same bug, and I'm recommending the other one, #8808, to the maintainer rather than this one. What I checked, reading only (nothing was run, since a fix that won't be taken forward isn't worth a worker): this diff against Why #8808 over this one:
#8808 isn't flawless either; its own review will cover what it needs. #7146 removes the parser entirely as part of a much larger rework of clamshell recovery, so it resolves this only as a side effect. The second opinion came from Codex Medium, asked to pick among the three without being told my answer. It also chose #8808, and it found the statement-leak case above, which I then checked against the source. It can read this session's working files, so its agreement isn't guaranteed to be independent. This now waits on the maintainer to decide between the competing fixes. Nothing was pushed to your branch. |
|
Thank you for this, @yi-zelin. #8808 fixes the same problem in a way the review judged better, so this is closed in favour of it. If it does not cover your case, please say so there. Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent. |
Fixes #7326
What's wrong?
nwg-displaysgenerate multi-line formatted Lua monitor configs (wherehl.monitor({,output, andscalesit on separate lines).Because
omarchy-hyprland-monitor-clamshellpipesmonitors.lualine-by-line intosed,configured_monitor_value()fails to match the regular expression, which expects the entirehl.monitor({ ... })declaration to reside on a single line. This parsing failure causesread_monitor_scale()to fall back to the defaultscale = 2, continuously reverting fractional scale configurations.What does this PR do?
monitor_rules()to flatten multi-line table declarations into a single stream usingtr '\n' ' '.hl.monitordeclaration usingsed 's/hl\.monitor/\n&/g'.