Expand description
omni daemon — persistent-connection desktop keystroke replay (bd-1eefe5).
omni daemon runs as a lightweight service on a desktop, holds a persistent
connection, and REPLAYS received InjectionCommands as local OS keystrokes
— so omni send --daemon <addr> / omni cast --daemon <addr> can cast to
desktops, not just phone/watch keyboards. Unlike tendril (a new SSH
connection per keystroke) the client keeps one established connection.
The daemon speaks the same wire as the relay (crate::transport::relay):
each line is either a token-gated cast ControlFrame or a bare
InjectionCommand. Received commands are replayed through a pluggable
Injector, so the connection/auth/loop is testable headless and real OS
key synthesis is swappable. The same local port accepts subscribe clients;
every accepted command is injected once and mirrored to all subscribers.
Structs§
- Broadcasting
Injector - Injector adapter used by relay-device mode: inject once, then mirror the received command to every local stream subscriber.
- Capture
Injector - An injector that records every command it is asked to replay (for tests).
- Command
Bus - Bounded, non-blocking fan-out of commands received by the daemon.
- Daemon
Options - Options for
run_daemon. - LogInjector
- An injector that only logs what it would replay — the safe default for
headless hosts and
--dry-run. Writes one NDJSON line per command to stderr. - Osascript
Injector - macOS injector via
osascript(System Events). - Relay
Device Options - Options for
run_relay_device. - Wtype
Injector - Linux/Wayland injector via
wtype. - Xdotool
Injector - Linux/X11 injector: replay commands via
xdotool. - Ydotool
Injector - Linux/Wayland injector via
ydotool(evdev keycodes).
Enums§
- Backend
- Which injector backend to use.
- Session
End - Why a relay-device session ended.
Traits§
- Injector
- Replays an
InjectionCommandas local OS keystrokes.
Functions§
- current_
platform - The platform string this build registers as (
linux/macos/windows). - evdev_
code - Linux evdev keycode for a semantic key / character (for
ydotool key). - mac_
key_ code - macOS virtual key code for a semantic key name.
- osascript_
argvs - Build
osascript -e <script>argv(s) (macOS).scrollis unsupported, and a combo must have exactly one non-modifier key. - relay_
device_ session - Register to a relay as a DEVICE over
reader/writer, then drain bareInjectionCommandlines, replaying each viainjector. One pass over a connected stream (no reconnect); returns how the session ended. - resolve_
auto - Resolve the
autobackend from the environment + available tools. - resolve_
auto_ with - Pure core of
resolve_auto(OS / display / tool-presence injected for testability): macOS -> osascript; Wayland -> wtype then ydotool; X11 -> xdotool; else the safe log backend. - run_
daemon - Run the daemon accept loop: each connection streams NDJSON; every received
InjectionCommand(from acastframe or a bare line) is replayed throughinjector. One thread per connection (mirrorsrelay::serve). - run_
daemon_ with_ bus - Run the daemon with a caller-provided command bus. Relay-device mode uses
this to share one bus between its outbound Helsinki connection and the local
listener serving any number of
omni listenclients. - run_
relay_ device - Run the relay-device loop: connect to
relay_addr, register, drain + replay, and reconnect-with-backoff on a clean drop. Stops (returnsOk) on a relay rejection (token/config error) or whenmax_attemptsis reached. - tool_
on_ path - Whether
nameresolves to a file on$PATH. - wtype_
argvs - Build
wtypeargv(s) (Wayland). Reusesxdotool_keysym(wtype keys are XKB keysyms too).scrollis unsupported. - xdotool_
argvs - Build the
xdotoolargv(s) for a command. A command usually maps to one invocation;scroll 0maps to none. - xdotool_
keysym - Map a semantic key name to an X11 keysym understood by
xdotool key. Unknown names pass through unchanged (xdotool accepts many keysyms). - ydotool_
argvs - Build
ydotoolargv(s) (Wayland/uinput).scrollis unsupported.