desbma / GoogleSpeech

Read text using Google Translate TTS API
GNU Lesser General Public License v2.1
161 stars 37 forks source link

How can I use this amazing script read aloud selected text with a keyboard shortcut? #15

Closed anonyxuser1 closed 6 years ago

anonyxuser1 commented 6 years ago

This is such a nice script! Such a beautiful voice too! Wow! Thank you!

I have one huge thing that I am trying to accomplish... how can I use this script to read alloud my selected text anywhere on my system with a simple keyboard shortcut? I was thinking xclip but I wouldnt know how to do that. Could you guide me or help me out here? I would be so thankfull! Thanks so much for your time!

Best, Anony

desbma commented 6 years ago

Assuming you are on Linux with Bash and xclip installed, the following command should read the currently selected text: google_speech -l en "$(xclip -out -selection primary)"

You'd have to put that in a script, and execute it with a keyboard shortcut in your desktop environment.