DEV Community

Al Amin
Al Amin

Posted on

Voice Typing on Linux: How to Dictate Into Any App on X11 and Wayland

Voice typing on Linux has always been a bit of a DIY project. On Windows you press Win+H, on macOS you tap the dictation key, and on most Linux desktops you go looking for a Python script, a Whisper model, and a way to get the text into the window you're actually using.

This post explains what a working voice typing setup on Linux needs, why X11 and Wayland behave differently, and how I set it up with a GUI app instead of gluing scripts together. It's written for people who want dictation in a terminal, an editor, a browser, and a chat app, not just inside one program.

What "voice typing on Linux" actually requires

Speech-to-text is only half the job. A usable setup has three parts:

  1. Capture: record from the right microphone, and know when to stop.
  2. Transcribe: turn audio into text, either with a local model (such as Whisper) or a cloud API.
  3. Insert: put the text where your cursor is, in whatever app has focus.

Most homemade setups get the first two working quickly. The third part is where Linux gets tricky, because it depends on your display server.

X11 vs Wayland: why inserting text is the hard part

On X11, any program can send synthetic keystrokes or paste into the focused window. Tools like xdotool do this, which is why older dictation scripts "just work" on X11 sessions.

On Wayland, apps are isolated from each other by design. A random program can't type into another window the way it could on X11. To insert text you need a tool that the compositor allows, such as wtype (on compositors that support the virtual keyboard protocol) or ydotool (which works at the input-device level and usually needs extra permissions).

So if a dictation tool works on your laptop but not on a colleague's, the first thing to check is echo $XDG_SESSION_TYPE. If it says wayland, the insertion method is probably the difference.

Local Whisper vs cloud speech-to-text

Local (offline) Whisper Cloud speech API
Internet needed No Yes
Where audio goes Stays on your machine Sent to the provider
Setup Download a model once Sign in or add an API key
Speed Depends on your CPU/GPU and model size Depends on your connection and the provider
Good for Private notes, offline work, sensitive text Weaker hardware, quick setup

Model size is the main trade-off for local dictation. Small models download fast and run on modest hardware; larger models are heavier and usually more accurate. Try a small one first and move up only if the results aren't good enough for you.

A GUI setup: voice typing on Linux with InsertKit

I use InsertKit, a voice typing and text expander app, which ships Linux builds as .AppImage, .deb and .rpm. It runs in the system tray and inserts text at the cursor in most apps where you can type: terminals, VS Code, browsers, Slack, and so on.

1. Install and check dependencies

After installing, open Settings → General → Linux Dependencies. It checks for xdotool, wtype and maim. On Wayland, the tips point you to wtype or ydotool. On Debian or Ubuntu, for example:

sudo apt install xdotool wtype
Enter fullscreen mode Exit fullscreen mode

2. Pick a speech engine

In the Speech Engine panel you can choose:

  • InsertKit Free: hosted models with a daily limit. You just sign in; no API key.
  • InsertKit Premium: premium hosted models that use credits.
  • Local Offline (Whisper): runs fully on your computer with no internet. Models download inside the app: Tiny (~75 MB), Base (~140 MB), Small (~460 MB), Medium (~1.5 GB) and Large v3 (~3 GB).
  • Bring your own key: OpenAI, Groq, OpenRouter, Deepgram, AssemblyAI or ElevenLabs.

If privacy is the reason you're on Linux in the first place, Local Offline is the mode to pick: in that mode your audio doesn't leave the machine.

3. Dictate

Click into any text field, press the activation shortcut (default Right Alt / AltGr), and speak. A small pill near the cursor shows LIVE while it listens and THINK while it transcribes. Press the shortcut again to stop, or just stop talking: auto-stop after silence is on by default (5 seconds, adjustable to 2, 3, 8 or 10, or off).

Long dictation is split into chunks at natural pauses and transcribed while you keep talking, so a long paragraph doesn't arrive all at once at the end.

4. Let formatting match the app

With Smart Formatting on, the text is cleaned up (punctuation, filler words like "um") and the style adapts to the app you're in. In VS Code, vim or a terminal it uses a code-comment style, and spoken identifiers become camelCase or snake_case. In a chat app it stays short and casual. If the AI step can't be reached, the raw transcript is still pasted, so you don't lose what you said.

5. Teach it your words

Linux work is full of words speech models get wrong: kubectl, systemd, nginx, your project names. In the Vocabulary tab you can add hint words, and add corrections like "when heard as engine x, write as nginx". Corrections are applied before and after formatting.

Voice typing plus snippets

Because the same app is also a text expander, you can mix the two. Save a snippet with a trigger like /standup, type it in any app, and the full template appears. Or say "insert standup" while dictating and the snippet is pasted by voice. Press F4 to pause all snippets when you don't want / triggers firing, for example in a terminal session.

Pricing is simple: there's a free tier, and paid plans start at $2.99/month. Voice typing supports 100+ languages with auto-detect.

FAQ

Is there voice typing built into Linux?
Most Linux desktops don't ship system-wide dictation the way Windows (Win+H) and macOS do. You usually add it with a separate app or script.

Can I use Whisper for dictation on Linux offline?
Yes. Whisper models can run locally. In InsertKit, choose Local Offline (Whisper), download a model, and dictation works without an internet connection.

Why does my dictation tool work on X11 but not Wayland?
Wayland doesn't let apps type into other windows freely. You need a compositor-supported tool such as wtype, or ydotool.

Does voice typing work in the terminal?
With a system-wide app, yes: text is inserted wherever the cursor is, including terminal emulators.

Do I need an API key?
No. InsertKit Free and Premium need no key. Keys are optional if you want to use your own OpenAI, Groq or other account.

Wrapping up

A good Linux dictation setup comes down to three questions: where transcription happens (local or cloud), how text gets into the focused window (X11 or Wayland tooling), and whether the output fits what you're writing. Sort those out and voice typing on Linux stops being a weekend project and becomes something you reach for daily.

Top comments (0)