Skip to content

Instantly share code, notes, and snippets.

@elmodos
Created May 1, 2016 18:04
Show Gist options
  • Save elmodos/eed636470473ad05b2fe10e4f26ae60f to your computer and use it in GitHub Desktop.
Save elmodos/eed636470473ad05b2fe10e4f26ae60f to your computer and use it in GitHub Desktop.
Linux, say current selection aloud, espeak
#!/bin/bash
# Get espeak PID if it is running
PID=`pgrep -x espeak`
echo Process ID: $PID
if [ -z $PID ];
then
# Not runnning
# en - male
# en+12 - female
xclip -selection primary -out | espeak -v en+12 --stdin
else
# Is running, terminating
kill -9 $PID
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment