Add the ability to set speech-dispatcher configuration in settings.conf if desired.

This commit is contained in:
Storm Dragon 2024-02-14 00:45:14 -05:00
parent 9cb652ada4
commit c7f4f546d8
3 changed files with 14 additions and 4 deletions

View File

@ -166,7 +166,7 @@ case ${buttonCode} in
)
fi
pushd "$doomPath"
exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e; } ; echo "$l";done
exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --; } ; echo "$l";done
;;
2)
# Exit was pressed, so exit.
@ -218,11 +218,11 @@ case ${buttonCode} in
)
fi
pushd "${doomPath}"
exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e; } ; echo "$l";done
exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --; } ; echo "$l";done
;;
0)
pushd "${doomPath}"
exec stdbuf -oL ${gzdoom} ${gameOption} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e > /dev/null 2>&1; }; echo "$l";done
exec stdbuf -oL ${gzdoom} ${gameOption} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} -- > /dev/null 2>&1; }; echo "$l";done
;;
esac

View File

@ -273,6 +273,11 @@ help() {
echo
echo "ipfsGateway=\"https://gateway.pinata.cloud\" # Gateway to be used for ipfs downloads."
echo "noCache=\"true\" # Do not keep downloaded items in the cache."
echo "spd_module=\<module_name>\" # set speech-dispatcher module."
echo "spd_pitch=\<number>\" # set speech-dispatcher speech pitch."
echo "spd_rate=\<number>\" # set speech-dispatcher speech rate."
echo "spd_voice=\<voice_name>\" # set speech-dispatcher voice. Be sure module is correct."
echo "spd_volume=\<number>\" # set speech-dispatcher speech volume."
exit 0
}
@ -480,6 +485,11 @@ if [[ -r "${configFile%/*}/settings.conf" ]]; then
fi
unset noCache
export ipfsGateway="${ipfsGateway:-https://gateway.pinata.cloud}"
export spd_module="${spd_module:+ -o ${spd_module}}"
export spd_pitch="${spd_pitch:+ -p ${spd_pitch}}"
export spd_rate="${spd_rate:+ -r ${spd_rate}}"
export spd_voice="${spd_voice:+ -y ${spd_voice}}"
export spd_volume="${spd_volume:+ -i ${spd_volume}}"
# The list of games available for installation.
# Use menu friendly names.

View File

@ -20,7 +20,7 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do
if [[ "$wnd_title" =~ $lookfor ]]; then
wnd_title=${BASH_REMATCH[1]}
if [[ "$old_title" != "$wnd_title" ]]; then
spd-say -- "$wnd_title"
spd-say ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} -- "$wnd_title"
old_title="$wnd_title"
fi
fi