From c925f2b0917bafe37d02cff4e54e97d2bc537093 Mon Sep 17 00:00:00 2001 From: Michael Taboada Date: Mon, 22 Jan 2024 09:55:20 -0800 Subject: [PATCH] Fix slight bug in radio --- .scripts/FreeDoom.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.scripts/FreeDoom.sh b/.scripts/FreeDoom.sh index 667cda3..57de11d 100755 --- a/.scripts/FreeDoom.sh +++ b/.scripts/FreeDoom.sh @@ -24,6 +24,11 @@ doomGames=( "TobyAccMod_V${tobyVersion}.pk3 OpMDK.wad" "Freedoom OperationMDK" ) +antiGrepStrings=( + '-E' '-v' + '-e' '^Resolution:' +) + grepStrings=( '-E' '-e' '^[A-Z][0-9a-z]+: .+' @@ -157,7 +162,7 @@ case ${buttonCode} in ) fi pushd "$doomPath" - exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | 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; } ; echo "$l";done ;; 2) # Exit was pressed, so exit. @@ -209,11 +214,11 @@ case ${buttonCode} in ) fi pushd "${doomPath}" - exec stdbuf -oL ${gzdoom} ${gameOption} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | 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; } ; echo "$l";done ;; 0) pushd "${doomPath}" - exec stdbuf -oL ${gzdoom} ${gameOption} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | 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 > /dev/null 2>&1; }; echo "$l";done ;; esac