From c7f4f546d8683a08f1b1e87d986e4960c671e43d Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 14 Feb 2024 00:45:14 -0500 Subject: [PATCH] Add the ability to set speech-dispatcher configuration in settings.conf if desired. --- .scripts/FreeDoom.sh | 6 +++--- linux-game-manager.sh | 10 ++++++++++ speech/speak_window_title.sh | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.scripts/FreeDoom.sh b/.scripts/FreeDoom.sh index 6b6a0c5..e57eb65 100755 --- a/.scripts/FreeDoom.sh +++ b/.scripts/FreeDoom.sh @@ -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 diff --git a/linux-game-manager.sh b/linux-game-manager.sh index 9679b4b..df434bb 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -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=\\" # set speech-dispatcher module." + echo "spd_pitch=\\" # set speech-dispatcher speech pitch." + echo "spd_rate=\\" # set speech-dispatcher speech rate." + echo "spd_voice=\\" # set speech-dispatcher voice. Be sure module is correct." + echo "spd_volume=\\" # 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. diff --git a/speech/speak_window_title.sh b/speech/speak_window_title.sh index eb73553..63be563 100755 --- a/speech/speak_window_title.sh +++ b/speech/speak_window_title.sh @@ -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