Updated set fvoice script to work with ggrep on mac.
This commit is contained in:
parent
0403da6b0e
commit
3bdd559ae8
@ -138,13 +138,21 @@ trap restore_voice SIGINT
|
||||
# Create an array of available voices.
|
||||
ifs="$IFS"
|
||||
IFS=$'\n'
|
||||
voiceListFullName=($(grep -P '\[Software\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^\\]+\].*' "${WINEPREFIX}/system.reg" | sed -E -e 's/\[([^]]+)\].*/\1/g'))
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
voiceListFullName=($(ggrep -P '\[Software\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^\\]+\].*' "${WINEPREFIX}/system.reg" | sed -E -e 's/\[([^]]+)\].*/\1/g'))
|
||||
else
|
||||
voiceListFullName=($(grep -P '\[Software\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^\\]+\].*' "${WINEPREFIX}/system.reg" | sed -E -e 's/\[([^]]+)\].*/\1/g'))
|
||||
fi
|
||||
IFS="$ifs"
|
||||
voiceList=()
|
||||
for x in "${voiceListFullName[@]}" ; do
|
||||
voiceList+=("$(echo "$x" | rev | cut -d\\ -f1 | rev)")
|
||||
done
|
||||
oldVoice="$(grep -P '"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^"]+"' "${WINEPREFIX}/user.reg" | sed -E -e 's/"DefaultTokenId"="([^"]+)"/\1/g')"
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
oldVoice="$(ggrep -P '"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^"]+"' "${WINEPREFIX}/user.reg" | sed -E -e 's/"DefaultTokenId"="([^"]+)"/\1/g')"
|
||||
else
|
||||
oldVoice="$(grep -P '"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^"]+"' "${WINEPREFIX}/user.reg" | sed -E -e 's/"DefaultTokenId"="([^"]+)"/\1/g')"
|
||||
fi
|
||||
echo "oldVoice: ${oldVoice}"
|
||||
echo "voiceList: ${voiceList[@]}"
|
||||
echo "voiceListFullName: ${voiceListFullName[@]}"
|
||||
|
Loading…
Reference in New Issue
Block a user