I built this as a minimal-effort script to get me up and running using information that I found on Stack Exchange and Ubuntu's documentation. I also imagine this script will run into issues if two instances of espeak are ever running at the same time. I haven't tested this script on a Wayland-based Ubuntu machine, but I suspect it might not work. X11 has been the default window system in Linux for decades, but distributions are starting to adopt Wayland. You should hear a robotic voice read the text back to you. Select some text on your computer and run your shortcut. I set mine to ctrl + esc, but you can set yours to whatever you like.įinally, click the Add button at the top of the window. You can run the pwd command in your user-scripts directory to find your full path. In the command field, type the full path to the script we created earlier (my script's path is /home/tyler/user-scripts/read-selected-text). In the name field, title the shortcut "Read Selected Text." At the bottom of this screen, click Customize Shortcuts, then scroll to the bottom and click Custom Shortcuts. Open the Settings app, and navigate to Keyboard on the left-hand sidebar.
#HIGHLIGHTED TEXT TO SPEECH MAC MAC OS#
Press ctrl + o to save, then ctrl + x to exit Nano.īinding the script to a keyboard shorting The excellent Mac OS text to speech function can be activated with a simple keystroke, but first you have to enable the feature. Run the following commands in your terminal:Įnter fullscreen mode Exit fullscreen mode
#HIGHLIGHTED TEXT TO SPEECH MAC INSTALL#
The script will check to see if the text-to-speech application is already running.We'll create a script that runs when you hit ctrl + esc.
But, we can get something that's good enough. If you have any experience using Apple's alt + esc text-to-speech feature, let me start by saying this won't be nearly as good. Unfortunately, my Linux machine doesn't have this feature built in, so I needed to hack it together. It's become an indispensable part of my writing workflow. I hear many of the mistakes I miss while proofreading. I manage to gloss over most of my mistakes, no matter how many times I read something that I wrote.īecause of this, it was a godsend when I discovered that hitting the alt + esc keys on my Macbook would read the selected text out-loud.