Skip to content

feat(viewer): place the viewer window on Hyprland with a hyprlang config - #415

Merged
ElbertePlinio merged 3 commits into
mainfrom
feat/228-hyprlang-placement
Oct 28, 2026
Merged

ElbertePlinio merged 3 commits into
mainfrom
feat/228-hyprlang-placement

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

The viewer's Hyprland placement applied only when hyprctl -j status reported the Lua config provider. Hyprland with a hyprlang config got an ordinary window.

The adapter now also detects hyprlang: status reports it from Hyprland 0.55, and 0.53 and 0.54, which have no status request, are detected through hyprctl -j version. On hyprlang it installs the same named launch rule through hyprctl keyword 'windowrule[<name>]:<field>' <value> (float, pin, no initial focus, monitor, size, move, and the opacity rule). The rule is disabled first and enabled last, so a window that maps in between never meets a partial rule. If Hyprland refuses a keyword, the rule is disabled again. Expand and collapse use resizewindowpixel and movewindowpixel on the verified client address. The launch record stores provider: "hyprlang"; records without it keep the Lua path. Hyprland before 0.53 still gets an ordinary window.

The runtime check ran Hyprland 0.56.2 with a hyprlang config nested in a headless sway inside a bubblewrap sandbox with no access to the live session. Hyprland 0.53 and 0.54 were checked in source only.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol (high). Sol verdict: approved.

Closes #228

Requirement Verified by Scenario and edge cases Result Evidence
Detect a hyprlang config Unit tests, runtime check status with configProvider: "hyprlang"; 0.53 and 0.54 version strings without status; unknown provider; older versions hyprlang detected; others get an ordinary window packages/cli/test/viewer-hyprland.test.ts; ~/.pickforge/investigations/228/06-runtime-log.txt
Install the named rule before launch Unit tests, runtime check Mapped window with the launch class Floating, pinned, 384x240 at 1512,816 bottom-right, focus stayed on the other window 02-clients-after-map.json, 02-activewindow-after-map.json
Disable the rule after the window maps Runtime check A second window with the same class after disable Tiled, rule no longer applies 03-clients-after-disable.json
Refused keyword leaves no enabled rule Unit tests, runtime check Hyprland answers error text with exit status 0 Rule disabled again; a matching window tiled, unpinned 07-failure-keywords.txt, 07-clients-after-failed-install.json
Expand and collapse use hyprlang dispatchers on the verified address Unit tests, runtime check Expand, then collapse 1280x800 at 320,140, then back to 384x240 at 1512,816 04-clients-after-expand.json, 05-clients-after-collapse.json
Browser viewer class pattern survives hyprlang Runtime check Pattern with ` , .and)$; near-miss class chrome-127x0x0x1__...` Matching window pinned; near-miss tiled
Values cannot inject hyprlang syntax Unit tests Control characters and # in a value; invalid rule name; invalid address Refused before any request viewer-hyprland.test.ts
Runtime check on a hyprlang instance Nested Hyprland 0.56.2, hyprlang config Sandbox with no live Wayland, D-Bus or seat; every call passes --instance No command reached the live Hyprland ~/.pickforge/investigations/228/README.txt
Release note Pending docs/releases/UNRELEASED.md still holds the tagged 0.7.1 notes until they are published and reset Text below, added after the reset this PR

Release note for the next version: "Viewer window placement on Hyprland also works with a hyprlang config, on Hyprland 0.53 and later. (#228)"

Checks: bun run typecheck, bun run lint, cargo build --release -p pickforge-viewer, bun run test:coverage with the CI environment variables (3381 passed), PickCheck (53 functions, no violations).

Detect the hyprlang config provider through hyprctl status, or through the
version on Hyprland 0.53 and 0.54, which lack the status request. Install the
named launch rule through hyprctl keyword, disabled first and enabled last,
and disable it again when a keyword is refused. Expand and collapse use the
resizewindowpixel and movewindowpixel dispatchers on the verified address.

Closes #228
@ElbertePlinio
ElbertePlinio merged commit 8d714f7 into main Oct 28, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/228-hyprlang-placement branch October 28, 2026 22:10
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.

watch: Hyprland placement adapter for hyprlang configs

1 participant