Skip to content

feat(computer): wait for a Hyprland session and list its windows through its IPC - #552

Merged
earakely-scale merged 1 commit into
mainfrom
edgararakelyan/fd-5340-o3-wayland-in-the-protocol-a-hyprland
Nov 9, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
edgararakelyan/fd-5340-o3-wayland-in-the-protocol-a-hyprland

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A computer app's own server waits for the desktop session before it launches the app, and decides Ready(window=True) from the session's windows. Both were X11-only: it waited for X's socket and listed windows with xprop. On Hyprland, xprop sees only XWayland windows, so a native Wayland app's window readiness never held, and without XWayland the wait was skipped. This is the session-layer half of Omarchy computers' Wayland support; the probe's GTK fixture went in with #547.

On Hyprland (HYPRLAND_INSTANCE_SIGNATURE set), in computer/_session_posix.py:

  • The session is up once its Wayland display's socket ($XDG_RUNTIME_DIR/$WAYLAND_DISPLAY) and its IPC's ($XDG_RUNTIME_DIR/hypr/<signature>/.socket.sock) are there.

  • Its windows are its mapped clients as hyprctl -j clients lists them, native Wayland and XWayland alike:

    • class: a Wayland app ID, or an X window's WM_CLASS class;
    • title;
    • instance: a Wayland window has none, so this is its program's file name, as on Windows.

    A listing whose IPC doesn't answer is empty. Like xprop, hyprctl is killed when a listing is cut short.

  • A boot app waits for a Hyprland session as it waits for an X display (app_runtime.start).

X11, macOS and Windows are unchanged. Commands an app or driver runs already get the session's environment, because the driver's and apps' services run in the graphical session (their units restarting with it is the Omarchy base's job), so run_in_session needs no change.

Docs: Launch.window's comment and the protocol README's paragraphs on launch readiness and the session.

Testing

  • Unit tests:
    • On Hyprland: the windows (mapped clients by program, class and title, an unmapped one left out, a gone program's instance empty); an IPC that doesn't answer; the session wait for both sockets; a boot app waiting for an X11 or Hyprland session and for none without one.
    • The "cut short" test now runs for xprop and hyprctl.
    • The whole protocol suite passes locally (1,302), as do the framework's computer, page-driver and shipped-computer tests (180). ruff check . is clean.
  • On Omarchy 4.5.0's VM image (Hyprland 0.56.2, under KVM on EC2), with this branch's protocol wheel:
    • wait_until_up returned with the session up.
    • windows() listed a native Wayland GTK window (class FixtureDesk, instance python3.14) and a Tk window under XWayland (class Benchlab, title "Bench Lab").
    • An app server declared with Launch(command=["nautilus", ...], window={"class": "org.gnome.Nautilus"}, ready=Ready(window=True)) answered not ready before its launch and ready after it.
    • The same session listed through xprop showed only the Tk window.

Not in this PR

What the driver's skill tells an agent on Omarchy (tiling, workspaces, its menu on Super+K), and the recording frame rate under llvmpipe.

FD-5340 (under FD-5336)

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds Hyprland support to computer app startup and window readiness.

  • Hyprland window checks can find native Wayland apps.
  • Boot apps wait for the Hyprland desktop sockets.

Acknowledged scope: earakely-scale assigns restarting services with the graphical session to the Omarchy base and explicitly intends program filenames for instance on Hyprland, including XWayland windows.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[App server starts] --> B{Hyprland session?}
  B -->|Yes| C[Wait for Wayland and IPC sockets]
  B -->|No, X display set| D[Wait for X socket]
  C --> E[Launch boot app]
  D --> E
  E --> F[Check window readiness]
  F --> G{Hyprland session?}
  G -->|Yes| H[Read mapped clients with hyprctl]
  G -->|No| I[Read X windows with xprop]
  H --> J[Match class, instance and title]
  I --> J
Loading

Reviews (1) · Last reviewed commit: "feat(computer): wait for a Hyprland sess..." · Reviewed by Greptile

…ugh its IPC

A computer app's server waited for X's socket and listed windows with xprop, which on Hyprland sees
only XWayland's: a native Wayland app's Ready(window=True) never held. On Hyprland, read from
HYPRLAND_INSTANCE_SIGNATURE, the session is up once its Wayland display's socket and its IPC's are
there, and its windows are its mapped clients as `hyprctl -j clients` lists them, native and XWayland
alike: the class (a Wayland app ID, or an X window's WM_CLASS class), the title, and as the instance,
which a Wayland window hasn't, the program's file name, as on Windows. A boot app waits for a
Hyprland session as it waits for an X display, and hyprctl, like xprop, is killed when a listing is
cut short.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 9, 2026 04:52
@earakely-scale
earakely-scale merged commit 5f3edd9 into main Nov 9, 2026
35 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-5340-o3-wayland-in-the-protocol-a-hyprland branch November 9, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant