atspiprobe

command
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: BSD-3-Clause Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

atspiprobe — pure-Go AT-SPI2 provider spike (pre-rebrand tracker #489)

Research spike for pre-rebrand tracker #489 (a11y Phase 6: Linux screen-reader support). Proves that a Bellui app can expose an accessible tree to Linux assistive technology (Orca) by speaking the org.a11y.atspi.* AT-SPI2 D-Bus protocol directly in pure Go — via github.com/godbus/dbus/v5, already a fork dependency — with no cgo and no Rust/AccessKit.

It is deliberately standalone: it hand-builds a tiny static tree (application → frame → { button, label }) and does not touch the bellui canvas or internal/accessibility. The production backend is the follow-up implementation issue; this only de-risks the handshake and wire format.

Run

On a Linux box with the AT-SPI2 stack (at-spi2-core) and Orca installed:

go run ./hack/atspiprobe

The provider discovers the a11y bus (org.a11y.Bus.GetAddress), dials it, exports its objects, registers with the registry via Socket.Embed, and stays alive emitting a focus event on the button.

Verify (no audio needed) — walk the tree as an AT client

A11Y=$(busctl --user call org.a11y.Bus /org/a11y/bus org.a11y.Bus GetAddress \
        | sed 's/^s "//;s/"$//')
NAME=:1.39   # the "our a11y bus name" the probe logs on startup

# Our app is a child of the AT-SPI desktop root — Orca's tree entry point:
busctl --address "$A11Y" call org.a11y.atspi.Registry \
  /org/a11y/atspi/accessible/root org.a11y.atspi.Accessible GetChildren

# Read role / name / state / extents of any node (this is exactly what Orca does):
busctl --address "$A11Y" call $NAME /org/a11y/atspi/accessible/2 \
  org.a11y.atspi.Accessible GetRoleName          # -> "push button"
busctl --address "$A11Y" get-property $NAME /org/a11y/atspi/accessible/2 \
  org.a11y.atspi.Accessible Name                 # -> "Click me"

# Reverse path — an AT action reaching back into Go:
busctl --address "$A11Y" call $NAME /org/a11y/atspi/accessible/2 \
  org.a11y.atspi.Component GrabFocus             # logs "GrabFocus ..." in the probe

Verify with Orca itself

gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true
# monitor which methods Orca calls on our provider:
dbus-monitor --address "$A11Y" | grep "destination=$NAME"
orca --replace &

When Orca starts it probes every app on the bus. Against this provider it calls Application.GetApplicationBusAddress, Cache.GetItems, and Properties.Get on our root — i.e. it discovered and read the pure-Go app. (Cache.GetItems is intentionally unimplemented here; Orca falls back to the per-property tree walk, which is why Properties.Get follows. Implementing org.a11y.atspi.Cache is a follow-up performance phase, not a blocker.)

What this proves / what it doesn't

Proven on the linux_parallels box (arm64, GNOME/Wayland, Orca 50.2, AT-SPI2 2.60.0):

  • pure-Go Socket.Embed handshake → app appears under the desktop root
  • Accessible + Application + Component reads (role/name/state/extents)
  • focus StateChanged events in the verified siiva{sv} wire format
  • reverse action path (GrabFocus) into Go
  • Orca actively discovers and queries the app

Not covered here (all deferred to the implementation issue): wiring the real internal/accessibility.Node tree, the Cache/GetItems fast path, Text/Value/Action/Selection/Table interfaces, and the Wayland absolute-coordinate limitation (an app cannot learn its window's screen position under Wayland — a constraint shared with AccessKit).

Documentation

Overview

Command atspiprobe is a research spike for pre-rebrand tracker #489: a *pure-Go* AT-SPI2 accessibility provider, speaking the org.a11y.atspi.* D-Bus protocol directly through github.com/godbus/dbus/v5 (already a fork dependency) with no cgo and no Rust/AccessKit.

It exposes a tiny, static accessible tree (an application → a frame → a button and a label) to the AT-SPI2 registry so a Linux screen reader (Orca) — or any AT client (busctl, Accerciser, pyatspi) — can discover and read it. The point is to prove the provider handshake works end-to-end on a real desktop:

session bus → org.a11y.Bus.GetAddress → dial the a11y bus →
export Accessible/Application/Component objects → Socket.Embed against the
registry root → stay alive, emit a focus StateChanged.

This is throwaway spike code, deliberately standalone (it does NOT touch the bellui canvas or the internal/accessibility node tree); the production backend is the follow-up implementation issue. Run on the linux a11y box:

go run ./hack/atspiprobe          # then: busctl / Orca reads the tree

See hack/atspiprobe/README.md for the verification recipe.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL