Skip to content

feat(voice)!: move voice to otoji, CLX+V now triggers the otoji app - #159

Open
snomiao wants to merge 1 commit into
mainfrom
feat/voice-to-otoji
Open

snomiao wants to merge 1 commit into
mainfrom
feat/voice-to-otoji

Conversation

@snomiao

@snomiao snomiao commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Moves voice out of CapsLockX into otoji. CLX+V now only triggers the otoji app.

Depends on snomiao/otoji#163, which adds the control socket CLX+V talks to. Until an otoji build with it is installed, CLX+V shows "otoji didn't respond, please update".

CLX+V

Gesture Command sent to otoji
Tap toggle
Hold (300 ms or more, the old threshold) ptt-start, then ptt-end on release

The first 300 ms of a hold are not push-to-talk, because the gesture can't be told apart from a tap until then.

Situation What happens
macOS, tray running Command goes to <otoji data dir>/tray-ctl.sock, one ASCII datagram per command
macOS, installed but not running open -g -b com.snomiao.otoji, then retry for up to 10 s. A tap sends on instead of toggle, since otoji may already start listening when launched
macOS, not installed Overlay with the download link; pressing CLX+V again while it shows opens the page
Windows / Linux "Not available yet". Linux has no overlay, so there it only goes to the log

What changed

  • Removed: the voice stack (STT engines, audio capture, overlay, TTS, wake word, dev and bench binaries, clx-media, clx-ocr) and its dependencies, about 21k lines. cargo tree no longer contains openssl, curl, onnx, whisper, sherpa or cpal, and bin/clx no longer sets DYLD_LIBRARY_PATH. The packaging scripts and workflows drop the dylib bundling.
  • Agent: agent::ENABLED = false unbinds CLX+M, because agent mode was fed by CLX's own transcripts. The code still compiles and its tests run, and clx agent still works.

Behaviour changes to check

  • Brainstorm no longer reads replies aloud, and the agent's speak tool is gone.
  • clx no longer starts otoji-tray at launch.
  • clx no longer runs pkill -9 -f 'otoji listen' at startup. Keeping it would have killed otoji's own listener on every clx restart.
  • Old voice settings and the ElevenLabs key stay in config.json when saving (macOS, FullConfig::extra), because otoji imports them on first run. The Windows config simply stops reading them.
  • PTT context from on-screen OCR (clx-ocr) is gone; otoji has no equivalent.

Testing

  • cargo test -p capslockx-core: 333 passed, 0 failed, 10 ignored.
  • cargo test -p capslockx-macos --bin capslockx: 4 passed, including delivery to a fake tray socket and a stale socket.
  • cargo build -p capslockx-macos --release: builds with no Homebrew OpenSSL; the binary links only system libraries.
  • cargo check -p capslockx-core -p capslockx-linux -p capslockx-browser on macOS passes, but this doesn't compile the Linux-only code.

Not tested:

  • CLX+V against a real otoji tray. The running clx and otoji were left alone, so this still needs a try on a real install.
  • The Windows adapter: it can't be checked here (no mingw), so this PR's CI is the check.
  • build.sh and scripts/package-mac.sh: edited and syntax-checked with bash -n only, not run.

🤖 Generated with Claude Code

CapsLockX no longer records, transcribes, polishes or speaks anything.
That all lives in otoji now, so remove the in-process stack (STT engines,
audio capture, overlay, TTS, wake word, dev/bench binaries) with its
dependencies. onnxruntime and openssl are no longer needed at all.

CLX+V is now a thin trigger: tap sends `toggle`, a hold of 300 ms or more
sends `ptt-start` and `ptt-end`, over otoji-tray's control socket.
- macOS: if otoji.app is installed but not running, launch it and send
  `on` (it may already start listening, so `toggle` could turn it off).
  If it is missing, the overlay suggests installing it.
- Windows/Linux: otoji doesn't ship there, so CLX+V says not available yet.

Also:
- Unbind CLX+M (agent::ENABLED = false): agent mode was fed by CLX's own
  transcripts. `clx agent` still works.
- Brainstorm no longer reads replies aloud; the agent's `speak` tool is gone.
- clx no longer starts otoji-tray at launch, and no longer runs
  `pkill -9 -f 'otoji listen'` at startup, which would kill otoji's own child.
- Keep old voice settings in config.json on save, since otoji imports them
  on its first run.

BREAKING CHANGE: voice input requires the separate otoji app, and needs an
otoji build with the tray control socket (snomiao/otoji#163).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant