From 35a8a851d81be87f59f03c2818d491a91a186364 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 29 Nov 2023 23:38:10 -0500 Subject: [PATCH] I think I finally solved the long standing problem of speech-dispatcher calls gobbling up all the output to the terminal. Now it should speak and still print things to the terminal. --- .scripts/FreeDoom.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.scripts/FreeDoom.sh b/.scripts/FreeDoom.sh index 7d0d10a..a8cfd77 100755 --- a/.scripts/FreeDoom.sh +++ b/.scripts/FreeDoom.sh @@ -58,6 +58,7 @@ if [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then gameOption+=" ${doomPath}/DoomMetalVol6.wad" fi +set -o pipefail case ${buttonCode} in 1) # Death match setup @@ -115,10 +116,10 @@ case ${buttonCode} in '-extratic' '-dup' '3' ) fi - exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | stdbuf -oL grep "${grepStrings[@]}" | stdbuf -oL sed "${sedStrings[@]}" | spd-say -e + exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e; } || echo "$l";done ;; 0) - exec stdbuf -oL ${gzdoom} ${gameOption} | stdbuf -oL grep "${grepStrings[@]}" | stdbuf -oL sed "${sedStrings[@]}" | spd-say -e + exec stdbuf -oL ${gzdoom} ${gameOption} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e; } || echo "$l";done ;; esac