[ documentation ]
Everything the app does, on one page.
A background voice-dictation tool for Linux and Windows. Hold or toggle a hotkey, speak, and the transcribed text is injected into whatever application is focused. Runs entirely on CPU via faster-whisper — no GPU required.
Not for dictating code, paths, or shell commands — speech-to-text isn't reliable enough for that, and this tool doesn't try to be.
Quick start
Linux
./install.sh
This builds a virtualenv, installs Python dependencies, pre-downloads the whisper model, and installs+enables the interject systemd --user service (autostarts on login). Setup is gated on your session type ($XDG_SESSION_TYPE): on X11 only xdotool/xclip are required and the ydotool/uinput/Wayland stack is skipped entirely (a leftover ydotoold service from an older install is disabled automatically); on Wayland it additionally sets up ydotool/uinput access and the ydotoold service. If you switch session types later, re-run ./install.sh from the new session.
Windows
Install Python 3.10+ from python.org (tick Add python.exe to PATH, keep tcl/tk selected), then from the project directory:
powershell -ExecutionPolicy Bypass -File setup.ps1
This builds a virtualenv, installs Python dependencies (including pywin32), pre-downloads the whisper model, registers autostart at login (a Startup-folder shortcut running pythonw.exe, so no console window), and starts Interject. No admin rights needed. See Windows notes below for platform behavior differences.
Portable installers
installer/linux/ and installer/win/ are each self-contained (wrapper script + interject.zip source snapshot) — copy the folder to any box and run install.sh / install.ps1. Rebuild both snapshots after any source change with ./build_installer.sh.
Using it
Default hotkey: Ctrl+Alt+Space — press to start recording, press again to stop. Speak, then check the focused window (or wherever you were focused when you started) for the transcribed text.
To remove later: ./uninstall.sh on Linux, uninstall.ps1 on Windows (both leave your config, logs, and downloaded model in place).
How it works
The core loop
IDLE (overlay hidden)
│ hotkey pressed
▼
RECORDING → overlay appears: timer, level bar, session indicator
│ hotkey released/pressed again (toggle mode) or released (hold mode)
▼
TRANSCRIBING → overlay shows "Transcribing...", timer frozen
▼
INJECT → text copied to clipboard, then pasted via the resolved backend
▼
IDLE (overlay auto-hides after ~2.5s)
- Escape cancels at any stage — during recording or during transcription — with no clipboard write and no injection.
- Hold Shift while stopping to force clipboard-only for that one capture, regardless of your configured backend.
Injection backends
Interject auto-detects whether you're on X11 or Wayland ($XDG_SESSION_TYPE, with a loginctl fallback) and picks the best available backend automatically. You can override this in config.yaml.
| Backend | Behavior | Works on |
|---|---|---|
targeted | Captures the window you were focused on when recording started, and pastes back into that exact window even if you click away to something else in the meantime. | X11 only |
focused | Pastes into whatever window has focus when the paste actually happens (i.e. after transcription finishes). | X11 + Wayland |
clipboard | Never auto-pastes. Loads the clipboard and you paste manually (Ctrl+Shift+V in terminals, Ctrl+V elsewhere). | X11 + Wayland |
All three backends always copy the result to the clipboard as a safety net, whether or not they also auto-paste.
targeted is physically impossible on Wayland — compositors deliberately block window-ID targeting and foreign-window focus for security. If you force targeted while on Wayland, Interject logs a warning and falls back to the Wayland backend instead of silently misbehaving.
Recording modes
- toggle (default): press the hotkey to start, press again to stop. Good for long-form dictation.
- hold: hold the hotkey down to record, release to stop. Set
recording.mode: holdin config.
Hotkeys
| Action | Default | Configurable as |
|---|---|---|
| Start/stop recording | Ctrl+Alt+Space | recording.hotkey |
| Cycle profile | Ctrl+Alt+Z | recording.profile_cycle_hotkey |
| Cycle Auto-Enter override | Ctrl+Alt+X | recording.auto_enter_toggle_hotkey |
| Cancel (during recording or transcribing) | Escape | not configurable |
| Force clipboard-only for one capture | hold Shift while stopping | not configurable |
If you change recording.hotkey, avoid including Shift as a required modifier. The Shift-forces-clipboard-only override needs Shift to be optional at stop-time — if it's baked into the hotkey combo itself, you can't press the combo without Shift, so the override becomes permanently active instead of occasional. This is why the default is ctrl+alt+space, not the spec's original ctrl+shift+space.
Pick hotkeys that don't collide with apps you'll be dictating into. Ctrl+Shift+P is Sublime Text's (and many editors') Command Palette shortcut — using it as profile_cycle_hotkey meant the global listener never reliably saw it fire while Sublime had focus. Ctrl+Alt+Z/Ctrl+Alt+X were chosen specifically to avoid this.
Why no click-to-toggle Auto-Enter checkbox in the overlay? Clicking a Tk widget risks grabbing keyboard focus away from whatever app you're dictating into — exactly what this tool is designed never to do. Both profile cycling and the Auto-Enter override are hotkey-driven for that reason; the overlay just displays the current state.
Configuration
Everything lives in config.yaml, re-read fresh by some subsystems (replacements) and at startup by others. Full schema with comments is in the file itself; the sections below cover what's not self-explanatory.
Transcription
model: small # tiny | base | small | medium -- bigger = more accurate, slower
compute_type: int8
language: en # pinned to skip language auto-detection (faster)
cpu_threads: 6
beam_size: 1 # 1 = greedy decode (fastest); 5 = faster-whisper's default
condition_on_previous_text: false # false: faster, fewer hallucinated repeats on short clips
initial_prompt: "..." # vocabulary hint (jargon, product names) fed to whisper pre-decode
vad:
enabled: true # strips silence; faster, avoids quiet-gap hallucinations
On a 6-core 7th-gen Intel CPU, small/int8 measured ~0.14x real-time (a 20s clip transcribes in ~2.8s) — there's headroom to go up to medium if you want more accuracy and can spare the extra CPU time. beam_size: 1 and condition_on_previous_text: false are dictation-tuned; set beam_size: 5 / true to get faster-whisper's stock behaviour back. initial_prompt fixes jargon at the model level, so fewer transcriptions need patching by the replacements dict afterwards.
A capture that transcribes to nothing (accidental hotkey tap, silence) is dropped entirely: the clipboard is left untouched, nothing is pasted, and Auto-Enter does not fire. It's logged as empty.
Session / injection
session:
auto_detect: true
force_session: null # null | x11 | wayland -- escape hatch for testing
injection:
x11:
backend: targeted
auto_enter: false
wayland:
backend: clipboard
auto_enter: false
paste_keys: ctrl+shift+v # works in terminals; many GUI apps also accept it
paste_delay_ms: 80 # brief pause before pasting, lets window activation settle
shift_forces_clipboard_only: true
always_copy_to_clipboard: true
Profiles and Auto-Enter
profiles:
active_default: prompt
definitions:
prompt: { auto_enter: false } # OpenCode / Claude Code
search: { auto_enter: true } # browser search bars
chat: { auto_enter: false } # Telegram, etc.
Cycle profiles with Ctrl+Alt+Z. The overlay briefly flashes the new profile name and resolved Auto-Enter state whenever you cycle (even outside an active recording). The active profile persists across restarts in state.json (falling back to active_default if the saved profile no longer exists in definitions).
Auto-Enter resolution precedence, evaluated at the moment you stop recording (not when you started):
live hotkey override > active profile's auto_enter > session-type's auto_enter > behaviour.auto_enter_default
Ctrl+Alt+X cycles the live override through three states — forced ON, forced OFF, and cleared (back to profile → session → default resolution) — so you're never stuck with a sticky override. The override persists across restarts in state.json. If you toggle profile or Auto-Enter mid-recording, whatever's active when you stop is what applies — this can be surprising if you're narrating the toggle while still recording.
Replacements
replacements:
"open code": "OpenCode"
"x do tool": "xdotool"
...
Case-insensitive find-replace, applied before injection. Re-read fresh from config.yaml on every capture — edit the dictionary and it takes effect immediately, no restart needed. Only fixes phrases that match exactly; if whisper transcribes "x do tool" as one word ("exdotool") instead of three, that specific mangling won't match the dictionary entry. Add variants you actually observe.
Logging
logging:
path: ./logs/interject.log
verbosity: normal # quiet | normal | verbose
rotate_mb: 1
rotate_count: 5
warn_ratio: 1.5
Never logs transcription content — only metadata (durations, ratio, word count, backend, profile, session type). A WARNING fires if a capture's transcribe/audio ratio exceeds warn_ratio, which usually means CPU contention or thermal throttling rather than a code problem.
UI
ui:
overlay_enabled: true
visualiser: level_bar # level_bar | none
fps: 15
opacity: 0.9
position: bottom-right # top-left|top-right|bottom-left|bottom-right|center
session_indicator: true
tooltips: true
timer: true
thresholds:
yellow_seconds: 15
red_seconds: 25
overlay_enabled: false runs fully headless: the window is never shown, but audio cues, hotkeys, and all captures still work.
The overlay is positioned relative to your primary monitor's actual bounds (via xrandr), not the combined virtual screen — on multi-monitor setups with differently sized/offset displays, the combined virtual screen has dead zones no physical monitor covers, and an earlier version of this positioning logic landed the overlay in one of those (invisible on any real screen) before being fixed.
Manual testing tools
These are standalone diagnostic tools, useful for verifying a new install or a new platform before trusting the live loop:
bench.py --record N/--wav PATH— benchmark transcription speed against a fixed clip, without any hotkey/injection involved. Use this first on a new machine to confirm the model is performing as expected.test_inject.py {targeted,focused,clipboard}— prove a single injection backend interactively: captures the active window, gives you 6 seconds to click elsewhere, then pastes back. Good first step on Windows or a new Linux setup.test_hotkeys.py --mode {toggle,hold}— console-only proof of the hotkey listener (prints state transitions, no audio/injection). Run this if hotkeys aren't responding.interject.py --duration 60 --backend focused— run the real app for a bounded test window instead of forever, optionally forcing a specific injection backend.
Troubleshooting
Nothing happens when I press the hotkey. Check journalctl --user -u interject -f (or tail -f logs/interject.log) for errors. Confirm the service is actually running: systemctl --user status interject.
The service won't start / fails with a display error (no display name, cannot open display, or the ExecStartPre "No DISPLAY/WAYLAND_DISPLAY" message). A systemd --user service doesn't automatically inherit DISPLAY/XAUTHORITY/WAYLAND_DISPLAY from your graphical session, and the app needs them. install.sh imports them, but if your session doesn't export them to systemd you may need to re-run it from a terminal inside the desktop session, or add systemctl --user import-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY to your shell startup. Then systemctl --user restart interject.
ydotoold fails with "failed to open uinput device". You need the uinput group + udev rule that install.sh sets up, and a fresh login after being added to that group — group membership changes don't apply to your current session.
ydotoold: command not found even after installing ydotool. On Debian/Ubuntu, ydotool (the client) and ydotoold (the daemon) are separate apt packages. Install both: sudo apt install ydotool ydotoold.
Targeted backend doesn't paste back into a terminal multiplexer (tmux/Terminator/etc). X11 window activation operates on the outer window, not on internal tabs/panes a multiplexer manages itself. If the multiplexer's internally-focused pane doesn't match the one that was active when you started recording, the paste can land in the wrong pane or appear to do nothing. focused backend avoids this since it doesn't try to reactivate anything.
A hotkey doesn't seem to fire reliably. Check whether the app you're dictating into has its own binding for the same combo (e.g. many editors bind Ctrl+Shift+P to a command palette) — pick a combo that's unlikely to collide with apps you actually use.
Windows notes
The session type is detected as windows automatically (session.force_session is ignored — there's nothing to misdetect). The overlay's session chip shows WIN.
- All three backends work.
targetedrefocuses the window that was active when you started recording viaSetForegroundWindow, using the standardAttachThreadInputworkaround for Windows' focus-stealing prevention. If Windows still refuses the focus change, the capture fails loudly instead of pasting into the wrong window — and the text is already on the clipboard (safety net), so nothing is lost. - Paste is
ctrl+v(set per-session asinjection.windows.paste_keys), not the Linux defaultctrl+shift+v, which most Windows apps don't treat as paste. In Windows terminals (Windows Terminal, ConHost)ctrl+vpastes by default. - UAC-elevated windows (admin PowerShell, installers) can't receive synthetic keystrokes or clipboard pastes from a non-elevated process. This is a Windows security boundary, not a bug — dictation into elevated windows silently does nothing beyond the clipboard write.
- No external tools needed: clipboard and window focus use
pywin32, keystrokes usepynputin-process (the xdotool/ydotool analogs don't exist and aren't required). - Autostart is a shortcut in
shell:startuprunningpythonw.exe— remove it withuninstall.ps1or manage it in Task Manager's Startup tab. There's no service manager involvement and no auto-restart-on-crash (unlike systemd on Linux). - First run on a new box: walk
test_hotkeys.py, thentest_inject.py, thenbench.pybefore trusting the live loop — same harnesses as Linux, they're all portable.
Known limitations
- The Windows port has not yet been live-tested on a real Windows box. The code is written against documented pywin32/pynput APIs and all dependencies verifiably ship Windows wheels, but hotkeys, focus behavior, and audio capture need on-box verification (see Windows notes for the test sequence). The
targetedbackend's focus workaround is the most likely part to need iteration. - Wayland injection backends (
ydotool/wl-copy) and XWayland overlay focus behavior have not been verified on a real Wayland session. This entire build was developed and tested on X11. The code is written against documented APIs for both, but only the X11 path has been live-tested end to end. If you're on GNOME Wayland, verify before trusting it for anything important. - Dictating code, paths, or shell commands isn't supported and isn't a goal — accuracy on that kind of content is inherently unreliable with general-purpose speech-to-text.
- Per-application profile selection is manual (hotkey-cycled), not automatic — GNOME Wayland doesn't expose reliable focused-window-class detection. An automatic
select_profile()seam exists in the code for future Sway/Hyprland/GNOME-extension support but isn't implemented. - Transcription content is never logged or stored anywhere beyond the immediate clipboard/injection — there's no history or undo if a capture goes wrong.
File layout
config.yaml full configuration schema
interject.py main entry point / state machine (InterjectCore)
audio_capture.py microphone capture (fixed-duration and start/stop-controlled)
transcribe.py warm-loaded faster-whisper wrapper
session.py x11/wayland/windows detection + config-precedence resolution
inject.py the three injection backends + resolver (X11/Wayland/Windows)
hotkeys.py global hotkey listeners (toggle/hold + simple trigger hotkeys)
overlay.py Tkinter overlay (thread-safe, queue-driven)
replacements.py find-replace post-processing
state.py Auto-Enter + active-profile persistence, resolution precedence
vplogger.py metadata-only logging with rolling-average ratio
install.sh / uninstall.sh Linux: systemd --user service setup/teardown
setup.ps1 / uninstall.ps1 Windows: venv + Startup-shortcut setup/teardown
build_installer.sh rebuilds installer/{linux,win}/interject.zip from source
installer/linux, installer/win self-contained portable installers (wrapper + source zip)
systemd/ interject.service, ydotoold.service (templated)
requirements.txt Python dependencies (pywin32 is Windows-only via marker)
logs/ rotated log output (created at runtime)
samples/ benchmark test clips (used by bench.py)
bench.py transcription speed benchmark
test_hotkeys.py hotkey listener diagnostic
test_inject.py injection backend diagnostic
This page mirrors the README.md shipped inside each installer download.