Keyboard Shortcut
yaoberh opened this issue · comments
Hey! Just wondering if it is possible to implement a keyboard shortcut functionality?
You can do it using xclip
or similar tool to get selections, and assign it to a keyboard shortcut using your desktop environment.
For example using GNOME:
-
Write a script containing the following:
larynx -v en "$(xclip -selection primary -out)"
-
Save it somewhere in your PATH, e.g.
~/.local/bin/tts
-
In GNOME Settings > Keyboard > Custom Shortcuts, create a new shortcut with the command
tts
. I have chosen Super + D as the shortcut key. -
Now you can select text in programs such as a browser or text editor and press Super + D to read it using larynx.
Thanks! Working