conf/.speak

41 lines
693 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
REMOTE=""
FROMSTDIN=0
while getopts "r" opt; do
case $opt in
r)
FROMSTDIN=1
;;
\?)
exit 1
;;
esac
done
shift $(($OPTIND - 1))
# on teste si la lecture est en cours, pour l'arrêter le cas échéant
ESPK=$($REMOTE ps -A | grep espeak | awk '{ print $1 }' )
if ! [ -z "${ESPK}" ]
then
for k in ${ESPK}
do
$REMOTE kill $k
break
done
else
SPEAK_LANG="FR"
if [ -n "$1" ]
then
SPEAK_LANG="$1"
fi
if [ "$FROMSTDIN" -eq 0 ]
then
xclip -o | tr '\n' ' ' | sed "s/ʼ/'/g" | $REMOTE espeak -s 410 -p 35 -v $SPEAK_LANG || true
else
cat | sed "s/ʼ/'/g" | $REMOTE espeak -s 410 -p 35 -v $SPEAK_LANG || true
fi
fi