Overview

voic.sh — Voice typing for Wayland Linux

crates.io docs GitHub

Offline, privacy-first voice typing. Speak into your mic, text appears in your focused app. Or pipe a WAV file and get text on stdout.

Build: Rust, C compiler, cmake, pkg-config, libclang, ALSA headers — sudo apt install build-essential cmake pkg-config libclang-dev libasound2-dev

Run (mic mode): sudo apt install wl-clipboard wtype ydotool — GNOME 45+ / KDE 6.1+ work without wtype/ydotool; pipe mode has no runtime deps

Early stage — free-time side project. Primary target: Ubuntu + GNOME + Wayland. Other distros and compositors are welcome, but I can only test on this setup. If something doesn’t work, open an issue . See CONTRIBUTING.md for how to help.

Quick start

cargo install voicsh

# First run — detects your desktop and picks the best model:
voicsh init

# Mic mode:
voicsh                          # continuous mic → text into focused app
voicsh --once                   # single utterance → exit

# Pipe mode (no mic/runtime deps needed):
cat file.wav | voicsh
voicsh transcribe-file file.wav # same, via the running daemon's loaded model

voicsh --help                   # all commands and options

How it works

Mic/WAV → VAD → Chunker → Whisper → Post-processor → Text injection
                                                        ↓
                                                portal / wtype / ydotool
  1. Audio captured via cpal (mic) or hound (WAV file)
  2. Voice activity detection splits speech into chunks
  3. whisper-rs (or Parakeet on ONNX Runtime) transcribes each chunk locally
  4. Text injected via xdg-desktop-portal (GNOME/KDE), wtype, or ydotool

Pipe mode (cat file.wav | voicsh) skips injection and writes to stdout. Pipe mode and transcribe-file read WAV only; voicsh transcribe-file --help lists the supported encodings and the ffmpeg command that converts anything else.

For integrations that keep the model warm, run voicsh daemon and send newline-delimited JSON over its Unix socket. The daemon accepts WAV file jobs with {"type":"submit_transcribe_file","path":"/tmp/voice.wav"} and streams queued/running/done updates on the same socket by default. See INTEGRATIONS.md for the Go/Telegram sidecar pattern, including OGG/Opus conversion before calling voicsh.

Install

# Ubuntu/Debian:
sudo apt install build-essential cmake pkg-config libclang-dev libasound2-dev
cargo install voicsh
voicsh init                    # benchmark hardware, pick model, download
voicsh install-gnome-extension # GNOME Shell panel indicator (optional)

Other distros, GPU acceleration, and experimental error correction: see INSTALL.md .

Text injection

voicsh injects transcribed text into your focused app. voicsh init auto-detects the best backend:

Desktop Backend Notes
GNOME 45+ Portal (RemoteDesktop) No extra tools needed
KDE 6.1+ Portal or wtype
Sway / Hyprland wtype sudo apt install wtype
Fallback ydotool Needs ydotoold daemon

Override at runtime: voicsh --injection-backend wtype Override via env: VOICSH_BACKEND=portal voicsh Override in config: [injection] section — run voicsh config dump to see all options.

wl-clipboard (wl-copy) is required for clipboard-based injection.

Note: The default injection method (Direct) types text via keysym events — no clipboard involved. If you set method = "Clipboard" (or your backend requires it), wl-copy is used, which overwrites your clipboard.

Voice commands

Voice commands trigger only when spoken as standalone utterances — pause, say the command, pause. Text that merely contains a command word passes through unchanged:

[pause] "period" [pause]          → .
[pause] "new line" [pause]        → (line break)
"the period of history"           → "the period of history"
"press enter to continue"        → "press enter to continue"
[pause] "all caps" [pause] "wow" [pause] "end caps" → "WOW"

Built-in commands are available for English, German, Spanish, French, Portuguese, Italian, Dutch, Polish, Russian, Japanese, Chinese, and Korean — see post_processor.rs for the full list. Discover all commands for a language:

voicsh config list --language=en     # English voice commands
voicsh config list --language=ko     # Korean voice commands
voicsh config list --language=en,de  # multiple languages

Add custom commands in [voice_commands.commands] in config — they take precedence over built-ins. To disable voice commands entirely: voice_commands.enabled = false.

Configuration

voicsh config dump              # commented template with all options and defaults
voicsh config list              # current active configuration
voicsh config list stt          # just the [stt] section
voicsh config get stt.model     # single value
voicsh config set stt.model small.en

Config file: ~/.config/voicsh/config.toml. Environment overrides: VOICSH_MODEL, VOICSH_LANGUAGE, VOICSH_BACKEND.

Settings changed in a running daemon (panel menu or IPC: language, model, error correction, correction model) are saved to the config file the daemon loaded (--config or the default), so they survive a restart. Only the changed setting differs afterwards; environment overrides stay out of the file. Like voicsh config set, saving rewrites the file without its comments.

Shell integration

GNOME extension — panel indicator with recording state, model info, and Super+Alt+V toggle:

voicsh install-gnome-extension

The install enables the extension and reports either Panel indicator active. or the one step left. GNOME Shell scans for extensions only when it starts, and it caches extension code once loaded. Because of that, a first install or a code update needs a GNOME Shell restart: log out and back in, or on X11 press Alt+F2, type r, and press Enter. Reinstalling an extension that the shell already knows activates it live.

Indicator states (indicatorState in gnome/voicsh@voic.sh/extension.js):

  • Connected: the microphone icon shows the recording state.
  • Daemon unreachable: a crossed-out microphone. The menu names the command that starts the daemon: systemctl --user start voicsh.service when the service is installed, otherwise voicsh install-service or voicsh daemon. The indicator reconnects on its own once the daemon is back.
  • Extension uninstalled: a crossed-out microphone. The menu says that the extension was removed and stays loaded until you log out and back in. This state wins over daemon unreachable.

Uninstall: voicsh uninstall-gnome-extension stops and removes voicsh.service and deletes the extension files. It reports what it removed and whether a GNOME Shell restart is still needed. It does not disable the extension in GNOME’s settings: disabling would pull the indicator out of the panel with no explanation. A running shell keeps the loaded extension until it restarts, and until then the indicator stays in its extension uninstalled state.

Indicator not showing? GNOME has a global kill-switch, disable-user-extensions, that keeps every user extension inactive. install-gnome-extension detects it and prints the fix: gsettings set org.gnome.shell disable-user-extensions false, then rerun voicsh install-gnome-extension.

Shell completions: voicsh completions bash|zsh|fish — run voicsh completions --help for install paths.

License

MIT

Acknowledgments