Never launch new espeak if one is launch; kill one per one espeak, older first
This commit is contained in:
parent
0e77984b1e
commit
aba883fff2
16
.speak
16
.speak
@ -1,10 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# on teste si la lecture est en cours, pour l'arrêter le cas échéant
|
# on teste si la lecture est en cours, pour l'arrêter le cas échéant
|
||||||
if [ ! -z $(ps -A | grep espeak | awk '{ print $1 }' ) ]
|
if ! [ -z "$(ps -A | grep espeak | awk '{ print $1 }' )" ]
|
||||||
then
|
then
|
||||||
# kill $(ps -A | grep espeak | awk '{ print $1 }' )
|
for k in $(ps -A | grep espeak | awk '{ print $1 }' )
|
||||||
killall espeak
|
do
|
||||||
|
kill $k
|
||||||
|
break
|
||||||
|
done
|
||||||
else
|
else
|
||||||
xclip -o | espeak -v $1 | true
|
SPEAK_LANG="FR"
|
||||||
|
if [ -n "$1" ]
|
||||||
|
then
|
||||||
|
SPEAK_LANG="$1"
|
||||||
|
fi
|
||||||
|
xclip -o | espeak -v $SPEAK_LANG | true
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user