Skip to content

Install gliff by default and show when a remote session is active - #14712

Merged
dhh merged 5 commits into
quattrofrom
gliff-default
Oct 9, 2026
Merged

dhh merged 5 commits into
quattrofrom
gliff-default

Conversation

@dhh

@dhh dhh commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Ship gliff, the Hyprland remote desktop over SSH, in the base package set, with a migration for existing installs. The package is already published in the Omarchy repo (0.2.0 today).
  • Add a Remote session indicator to the default bar tray so the machine being controlled can clearly see that someone is on it. It lights up in the urgent colour while a gliff-server session runs, and the tooltip names the ssh client address. It is status only: no click action and no notifications.

How

A new first-party omarchy.remote-session service owns detection, so every bar shares one state:

  • gliff-server captures the screen through ext-image-copy-capture, so Hyprland emits a screencast event when a session starts. The service debounces that event and runs shell/plugins/services/remote-session/probe.sh (pgrep -x -u "$(id -u)" gliff-server, reading SSH_CONNECTION from the process environment for the peer) to decide whether it was gliff rather than a screen recorder or browser share.
  • Session end has no reliable event: Hyprland reports the screencast stopped as soon as frames pause for half a second and says nothing more when the server exits later. So the service polls every two seconds, only while a session is active.
  • The indicator is a plain BarIndicator reading the service, like Night Light. The service is also exposed through the third-party bar facade, including refresh(), so clones of the Indicators widget keep working.
  • Manual and plugin README updated.

Known limit

A gliff-server --listen that is waiting for a connection counts as a session, since process presence is what the probe sees. That mode is dev-only; over ssh the server only exists while a client is attached.

Testing

  • test/shell.d/remote-session-test.sh: model unit tests, static contracts, and the probe script against stub pgrep//proc fixtures.
  • test/shell.d/remote-session-service-test.sh: drives the real service in Quickshell against a stub gliff-server, polling for state. It never calls refresh() by hand: one-shot grim captures raise the same Hyprland screencast event, so the event path is what flips the state.
  • Indicator contract fixture extended with the new indicator.
  • Verified by hand against a real local gliff server and client, and that the glyph renders red when active and dimmed when idle.
  • ./test/cli passes. ./test/shell has six failures that all reproduce on quattro without this branch (agent-account, background-instant-reload, background-intro-clone, default-agent, elsewhen-migration, passwordless-grant-lifecycle).

🤖 Generated with Claude Code

dhh and others added 2 commits October 9, 2026 12:41
Gliff is the Hyprland remote desktop over SSH. Ship it in the base
package set for new installs, with a migration for existing ones.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The machine being controlled should make it obvious that someone is on
it. A first-party remote-session service watches Hyprland's screencast
events, which gliff-server triggers through ext-image-copy-capture, and
probes for the server process, picking up the ssh client address from
its environment. The RemoteSession indicator in the default tray lights
up in the urgent colour while a session runs, and a notification
announces each session start and end.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previously reported monitor-layout test issue remaining non-blocking.

Findings

  1. P2 Test fails on shifted monitors ▶

Summary

Installs gliff by default and adds a shared service that shows remote sessions in the bar.

  • Capture events trigger a short delayed check. Active sessions are checked every two seconds.
  • The indicator shows the SSH peer and supports refresh through cloned widgets.
  • This update extracts probe.sh, removes the unused session count, and replaces fixed test delays with waits for state.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Hyprland screencast event] --> B[Wait 150 ms]
  B --> C[Run probe.sh]
  D[Shell startup] --> C
  E[Refresh request] --> C
  C --> F[Read active state and SSH peers]
  F --> G[Update remote-session indicator]
  F --> H{Session active?}
  H -->|Yes| I[Check every two seconds]
  I --> C
Loading

Reviews (4) · Last reviewed commit: "Tighten remote session detection after r..." · Reviewed by Greptile

Comment thread manual/05-the-top-bar.md Resolved
Probe only the current user's gliff-server processes, forward refresh
through the third-party service proxy so cloned indicator widgets can
re-probe, exercise the Hyprland screencast event path in the service
test with a grim capture instead of calling refresh by hand, and
describe the indicator as status only in the manual.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
}

function captureFrame() {
Quickshell.execDetached(["grim", "-g", "0,0 1x1", Quickshell.env("OMARCHY_QML_TEST_FRAME")])

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.

P2 Test fails on shifted monitors

captureFrame() always requests 0,0 1x1, but the test uses the running desktop without setting monitor positions. If no enabled monitor covers the origin, grim cannot capture this region. No capture event reaches the service, and the test fails even when detection works.

Select an enabled monitor or derive the region from its position.

dhh and others added 2 commits October 9, 2026 13:21
The bar indicator is the signal; a toast on every connect and
disconnect is noise on top of it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Hyprland reports a screencast stopped as soon as frames pause for half a
second and says nothing more when the server later exits, so poll every
two seconds while a session is active instead of trusting a stop event.
Match only the screencast event, not its screencastv2 twin, and debounce
the burst around one transition so it costs one probe. Move the probe
into its own script that the service and the test both run, poll for
state in the service test instead of fixed delays, and drop the unused
session count.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dhh
dhh merged commit 9d48fc4 into quattro Oct 9, 2026
1 check passed
@dhh
dhh deleted the gliff-default branch October 9, 2026 15:02
olafkfreund added a commit to olafkfreund/nixarchy that referenced this pull request Oct 9, 2026
…fault (#1227)

Closes #1226

Upstream Omarchy made gliff (omacom/gliff, MIT) its remote desktop today
(omacom/omarchy#14712). gliff shows another Hyprland machine's session
over ssh: no open port, no extra account, no password. This packages it
and adds it to the preinstalls. hypr-rdp, the Setup > Remote desktop
menu and `nixarchy-remote` are untouched.

- Intent: `intent/2026-10-09-1226-gliff-preinstall.md`
- Spec: `spec/2026-10-09-1226-gliff-preinstall.md`
- Plan: `plan/2026-10-09-1226-gliff-preinstall.md` (see **Deviations**)

## What changes
- **`pkgs/gliff/default.nix`**: built from a non-flake input pinned to
`v0.3.0`; exported as `packages.gliff` and through the overlay.
- `vulkan-loader` goes on the RUNPATH of all three binaries, because
`ash` dlopens `libvulkan.so.1`. Without it gliff falls back to the CPU
tier and nothing says so.
  - The `gliff` client is wrapped with `openssh` on PATH.
  - All upstream unit tests run in the sandbox and pass.
- **`modules/nixos.nix`**: gliff joins the preinstalls, and
`preinstallsExclude = [ "gliff" ]` removes it.
- It is reached through `pkgs.extend inputs.self.overlays.default`, the
same pattern `omarchy` and `owe` use.
  - Mode A is unchanged: gliff only arrives with `preinstalls`.
- **Checks:**
- `checks.gliff-runpath` is new: the Vulkan RUNPATH and the ssh wrapper.
- `checks.session` gets a gliff block: the server reaches Hyprland,
creates its headless output and negotiates a stream.
- `pkgs/verify.sh` gets a hardware row: GPU tier, plus a captured frame
through encode and decode.
- **Docs:**
- `remote-desktop.md` gets a gliff section with the sshd requirement and
a clipboard warning.
  - `flake.md` gets an entry for the new input.
  - README and `llms.txt` name gliff.
- The false "verify.sh has an RDP step" sentences in `tests/AGENTS.md`
and `tests/install-matrix.py` are corrected.

## Proof (§1)
**`checks.gliff-runpath`**: green; red on each break; green again with
the identical drv.
```
green: PASS
break-rpath: FAIL: gliff-server RUNPATH lacks /nix/store/…-vulkan-loader-1.4.357.0/lib: …dbus…libva…wayland…libgbm…
break-ssh:   FAIL: gliff wrapper does not put /nix/store/…-openssh-10.5p1/bin on PATH
green-again: PASS
```
**`checks.session`** (local, CI idle): green, then red with the probe
pointed at a dead port.
```
green: gliff-server created its headless output and negotiated a stream
break-deadport: AssertionError: gliff-probe serve-test lacks 'HelloAck: headless=true output=gliff-'
```
**Step 3 evaluation**: gliff is in `vm`'s `systemPackages` (`true`), and
absent with `preinstallsExclude = [ "gliff" ]` (`false`). Its drvPath is
identical to `packages.gliff`.

**p620 (RX 7900 XT)**, by hand and through the new verify.sh row:
```
vulkan: AMD Radeon RX 7900 XT (RADV NAVI31) (radv Mesa 26.2.4)
PASS VA-API H.264 encode
PASS VA-API H.264 decode
  captured 2560x1440 DrmFourcc(XR24) modifier 0x0 from DP-1
  decoded 18.0 ms; end-to-end RGB PSNR vs CPU reference 41.5 dB
PASS Dual420 4:4:4 GPU pipeline on a captured frame
```
Also passing: `checks.doc-options`, `nix fmt -- --ci`, statix, deadnix.

## Deviations (recorded in plan/)
- **Step 3**: the spec said the module's `pkgs` carries our overlay. It
does not (Mode A); the step 3 evaluation caught it, and the fix is
`pkgs.extend` as above.
- **Step 4**: capture cannot run in the session VM.
- hypr-capture allocates its buffers with GBM on `/dev/dri/renderD128`,
even on the CPU tier, and the VM has none. It failed with `capture: io:
No such file or directory`.
  - The block is narrowed to what the VM can answer rather than dropped.
- Frames are verify.sh's row, and the hole is named in `tests/AGENTS.md`
and `install-matrix.py` (§3).
- **Step 6**: the RDP subheadings keep their levels under the new
section, so no anchor moves. No deep links existed.

## Cache
No allowlist entry is needed: as a preinstall, gliff rides in
`vm-toplevel` and `reference-toplevel`. The `system` job's
`cache-budget.sh` figure for this head will be added here when it
reports.

## Security review of gliff's source (read-only)
Being installed is inert: no service, autostart, setuid, udev rule,
telemetry or update check. In use, the one real risk is that a connected
host can read the local clipboard without a paste; the manual warns
about it. These are filed upstream, at the owner's request, as
omacom/gliff#29:
- clipboard only on paste, or only to the focused tab;
- `--` before the ssh host;
- `--listen` restricted to loopback;
- `StreamConfig` size bounds.

## Who did what
The `coder` agent (Sonnet) wrote the first draft of steps 1–6. The
session (Opus) ran every build, proof and evaluation, and wrote the step
3 fix, the step 4 narrowing and the review fixes. A fresh Opus reviewer
read the plan and the diff; its findings were applied:
- a 120 s timeout on the probe;
- the journal read as root;
- the verify.sh fallback reason;
- README and `llms.txt` drift.

Bus: read before starting; nothing on gliff.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0117TADC4XC7JSKKXfg2XVvy

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
@dhh dhh mentioned this pull request Nov 10, 2026
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