Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deadlock Linux Dictation

Hold-to-dictate voice input for Deadlock on Linux/Proton.

This is a small Linux/X11 utility that records your mic while you hold Left Alt, transcribes the audio with faster-whisper, copies the result to the clipboard, and tries a best-effort Ctrl+V paste into the game chat. If the game blocks synthetic paste, the text stays on the clipboard so a real/manual Ctrl+V still works.

What it does

  • Hold Left Alt to record.
  • Release Left Alt to transcribe.
  • Uses faster-whisper small.en.
  • Tries CUDA/float16 first by default.
  • Falls back to CPU/int8 if CUDA fails.
  • Clears the clipboard at recording start.
  • Copies recognized text to a persistent clipboard holder.
  • Attempts one xdotool Ctrl+V paste.
  • Plays short beeps and desktop notifications for feedback.

Platform support

This version is intentionally Linux/X11 focused. It depends on Linux desktop tools such as:

  • PulseAudio/PipeWire Pulse compatibility: pactl, parec, paplay
  • X11 input tools: xinput, xdotool, xmodmap
  • Desktop notifications: notify-send
  • Python/Tk clipboard behavior

It will not run as-is on Windows. The speech-to-text idea is portable, but Windows would need a different hotkey, audio, clipboard, and input backend.

Files

  • bin/deadlock-dictation-hold-daemon — main Python hold-to-dictate daemon.
  • bin/deadlock-clipboard-holder — small Python/Tk clipboard holder.
  • bin/deadlock-right-alt-to-f20 — optional Bash helper to remap Right Alt to F20.
  • bin/deadlock-dictate-toggle — older nerd-dictation toggle version kept for reference.
  • systemd/deadlock-dictation.service — persistent user service.
  • install.sh — Debian/Ubuntu installer and service setup.

Install

Ubuntu/Debian:

git clone https://github.com/KevinPequad/deadlock-linux-dictation.git
cd deadlock-linux-dictation
./install.sh

The installer:

  • creates a dedicated runtime at ~/.local/share/deadlock-dictation/.venv;
  • pins the proven faster-whisper==1.2.1 release;
  • installs the runtime scripts under ~/.local/bin, binding the daemon to the dedicated interpreter and the Tk helper to the verified system interpreter;
  • replaces any stale service-enable links from an older install;
  • starts deadlock-dictation.service and waits for both the Whisper model and X11 input monitor to report ready.

The dedicated venv is intentional. Do not point the service at another app's managed venv (for example, an AI-agent or nerd-dictation environment), because that environment can be replaced and make faster_whisper disappear after an update.

For NVIDIA GPU acceleration, install a CUDA-compatible CTranslate2 stack appropriate for your machine. If CUDA is unavailable, the daemon falls back to CPU/int8.

Run the installer from an active X11 desktop session. For a local :N display, the installer imports the shell's DISPLAY and XAUTHORITY into the systemd user manager instead of assuming :0; SSH-forwarded displays are not persisted. On the first install, startup can take a while if the small.en model must be downloaded; the installer will wait up to 15 minutes and fail instead of claiming success before the daemon is ready. Transient lock, clipboard-helper, and audio state lives in the user's private $XDG_RUNTIME_DIR/deadlock-dictation directory, with a private cache fallback for direct runs without XDG_RUNTIME_DIR.

Configure

The default mic source is currently set in the script:

MIC = "alsa_input.usb-SteelSeries_SteelSeries_Arctis_1_Wireless-00.mono-fallback"

Find your own source with:

pactl list short sources

Then edit MIC in bin/deadlock-dictation-hold-daemon and rerun ./install.sh.

Optional Whisper overrides for the user service:

systemctl --user edit deadlock-dictation.service

Add:

[Service]
Environment=DEADLOCK_WHISPER_DEVICE=cuda
Environment=DEADLOCK_WHISPER_COMPUTE=float16

Then restart it:

systemctl --user daemon-reload
systemctl --user restart deadlock-dictation.service

Run

The installer starts the user service automatically. Manage it with:

systemctl --user status deadlock-dictation.service
systemctl --user restart deadlock-dictation.service
journalctl --user -u deadlock-dictation.service -f

For a manual foreground run after installation, the installed command already uses the dedicated interpreter:

~/.local/bin/deadlock-dictation-hold-daemon

Open Deadlock chat, hold Left Alt, speak, then release.

Notes / caveats

  • This watches physical X11 key events so synthetic key events do not recursively trigger dictation.
  • The script is tuned for one local setup and may need edits for your keyboard and mic names.
  • Deadlock/Proton may reject synthetic paste. The clipboard fallback is intentional.
  • This does not inspect game memory, inject into the game, or automate gameplay; it is just OS-level dictation and clipboard/paste glue.

License

MIT

About

Linux/Proton hold-to-dictate voice input for Deadlock chat

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages