Skip to content

Resize a headless output on Hyprland 0.57 with a Lua config - #110

Open
Unayung wants to merge 1 commit into
omacom:mainfrom
Unayung:fix/hyprland-057-keyword-fallback
Open

Unayung wants to merge 1 commit into
omacom:mainfrom
Unayung:fix/hyprland-057-keyword-fallback

Conversation

@Unayung

@Unayung Unayung commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Problem

On Hyprland 0.57.0 with a Lua config (Omarchy), a headless session never follows the client window. The output stays at its initial 1920x1080, scale 1, so a MacBook Pro 14" client gets a blurry, wrongly sized screen.

set_monitor_mode sends keyword monitor ... and falls back to eval hl.monitor(...) only when the reply contains non-legacy. On 0.57 the socket answers keyword with unknown request, so the fallback never runs and the server only logs "could not resize the headless output".

Fix

Treat unknown request as the same Lua rejection. The check moves into keyword_rejected() with a unit test. docs/hardware-quirks.md notes the new reply.

The dispatcher fallback (response.contains("lua")) still works on 0.57. A legacy dispatch reply there still carries "dispatch in lua is a shorthand for hl.dispatch(...)".

Testing

  • scripts/check.sh passes.
  • On Hyprland 0.57.0 with a Lua config:
    • raw socket keyword monitor ... → unknown request
    • eval hl.monitor({ output = "<headless>", mode = "3024x1964@60", position = "auto", scale = 2 }) resizes a headless output to 3024x1964 at scale 2
  • scripts/e2e.sh was not run: a live remote session was using this Hyprland instance.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMMntUgWn4YwdAk17sViei

Hyprland 0.57 answers `keyword` from a Lua config with `unknown request`
instead of `keyword can't work with non-legacy parsers`. The monitor rule
fell back to `eval hl.monitor(...)` only on the old message, so the resize
failed and a headless output stayed at its initial 1920x1080, scale 1,
whatever the size and scale of the client's window.

Treat either reply as the Lua rejection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMMntUgWn4YwdAk17sViei
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds unknown request to the replies that make set_monitor_mode retry through eval hl.monitor(...).

  • Headless outputs reach Lua mode setting on Hyprland 0.57.

Reviews (1) · Last reviewed commit: "Resize a headless output on Hyprland 0.5..." · Reviewed by Greptile

@londospark

Copy link
Copy Markdown

Confirming this on a second machine: Hyprland 0.57.0 with Omarchy's Lua config, RTX 5080 server. keyword monitor ... answers unknown request, so the headless output never left 1920x1080 until we made the same change, treating unknown request as the Lua refusal. After that, eval hl.monitor(...) resized it as expected.

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.

2 participants