larynx icon indicating copy to clipboard operation
larynx copied to clipboard

Keyboard Shortcut

Open ghost opened this issue 3 years ago • 2 comments

Hey! Just wondering if it is possible to implement a keyboard shortcut functionality?

ghost avatar Jan 25 '22 12:01 ghost

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:

  1. Write a script containing the following:

     larynx -v en "$(xclip -selection primary -out)"
    
  2. Save it somewhere in your PATH, e.g. ~/.local/bin/tts

  3. In GNOME Settings > Keyboard > Custom Shortcuts, create a new shortcut with the command tts. I have chosen Super + D as the shortcut key.

  4. Now you can select text in programs such as a browser or text editor and press Super + D to read it using larynx.

jn64 avatar Apr 25 '22 12:04 jn64

Thanks! Working

ghost avatar Apr 25 '22 13:04 ghost