Tiny GNOME/Wayland helper for reading selected text aloud with high-quality Edge neural TTS.
It is intentionally not a screen reader. It does one narrow thing:
- Select text anywhere that populates the Wayland primary selection.
- Press
Ctrl+Alt+Rto read it aloud. - Press
Ctrl+Alt+Sto pause. - Press
Ctrl+Alt+Cto continue.
Linux already has screen readers, browser read-aloud extensions, and local TTS engines. This project exists for a narrower workflow:
- better voice quality than
spd-say/eSpeak on many systems; - less intrusive than Orca when you only want selected text read aloud;
- works with terminal selections and other GNOME/Wayland primary selections;
- pause/resume shortcuts without adopting a full accessibility stack.
This uses edge-tts, which sends the
selected text to Microsoft's online speech service. Do not use it for secrets,
private documents, credentials, or sensitive personal information.
If you need offline speech, look at Piper/Mimic3-based tools such as Voluble or VoxFree instead.
- Single Language/Voice: The tool uses a single voice configured in
~/.config/read-selection-tts/config. Reading text in a language different from the configured voice will result in unnatural pronunciation (a strong accent) or playback failure. - Latency on Long Selections: Since
edge-ttsmust generate the entire audio file beforempvstarts playback, very long selections may take a few seconds before the audio begins. - Clipboard Mode: Clipboard mode is not implemented yet. The default read shortcut uses the Wayland primary selection; scripts and agents can use
--stdin.
Tested on Ubuntu GNOME Wayland.
Runtime dependencies:
wl-pastefromwl-clipboardedge-ttsfrompipx install edge-ttsmpvgsettingsfor GNOME shortcut installation
Install dependencies on Ubuntu:
sudo apt install -y wl-clipboard mpv pipx python3
pipx install edge-ttsMake sure ~/.local/bin is on your PATH.
git clone https://github.com/davidf9999/read-selection-tts.git && cd read-selection-tts && ./install.shAvoid curl | bash installs for this project: the installer copies versioned
files from the repository and should run from a checked-out release.
Default shortcuts:
Ctrl+Alt+R: read selected textCtrl+Alt+S: pauseCtrl+Alt+C: continue
The installer preserves existing GNOME custom shortcuts, appends its own, and leaves shortcut paths alone if they already belong to another command.
Select text with the mouse, then press Ctrl+Alt+R.
Pause and continue:
Ctrl+Alt+S
Ctrl+Alt+C
Start a new selection with Ctrl+Alt+R; it replaces the previous read-aloud
audio.
Scripted or agent-triggered speech can use standard input instead of the Wayland primary selection:
printf 'Hello from an agent\n' | read-selection-tts --stdinBy default there is no stop shortcut. To add one:
READ_SELECTION_TTS_STOP_BINDING='<Control><Alt>x' ./install.shPressing the read shortcut (Ctrl+Alt+R) while audio is playing already replaces the current audio, so a separate stop shortcut is optional.
This tool reads the Wayland primary selection — the text highlighted with the mouse, not the Ctrl+C clipboard. In most GNOME/Wayland apps, selecting text with the mouse is enough; you do not need to press Ctrl+C.
Choose a different voice:
READ_SELECTION_TTS_VOICE=en-GB-SoniaNeural ./install.shThe selected voice is persisted in ~/.config/read-selection-tts/config, so GNOME shortcuts use it after the installing terminal closes. Reinstalling without READ_SELECTION_TTS_VOICE preserves the existing voice and any other config lines.
Override shortcut bindings:
READ_SELECTION_TTS_READ_BINDING='<Super><Alt>r' ./install.shList available voices:
edge-tts --list-voices | lessRun these before committing:
shellcheck -x install.sh uninstall.sh bin/* lib/common.sh tests/smoke.sh
./tests/smoke.sh./uninstall.shCheck the log:
runtime_dir="${XDG_RUNTIME_DIR:+$XDG_RUNTIME_DIR/read-selection-tts}"
runtime_dir="${runtime_dir:-/tmp/read-selection-tts-$(id -u)}"
cat "$runtime_dir/read-selection-tts.log"If the shortcut fires but no audio plays, verify:
command -v wl-paste edge-tts mpv python3
wl-paste --primary
tmp="$(mktemp --suffix=.mp3)"
edge-tts --voice en-US-AriaNeural --text "test" --write-media "$tmp"
mpv "$tmp"If edge-tts is not found from a GNOME shortcut but works in your terminal,
ensure ~/.local/bin is on PATH. The installed scripts set a conservative
PATH, so this should normally work.
- Orca: full GNOME screen reader. Better for complete UI accessibility, more intrusive for casual selected-text reading.
- Voluble: GNOME extension using Piper; closer to this project and worth trying if you want offline speech.
- VoxFree: offline Ubuntu/GNOME voice toolkit.
- Browser extensions: excellent inside browsers, not a general terminal/system selected-text workflow.