From 75535a27b1a36386faef85ed45ce57939c4b00a7 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 16 Dec 2024 14:42:25 -0500 Subject: [PATCH] Changed the way nvda2speechd is launched. --- audiogame-manager.sh | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index e4cc7ec..b82013e 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -920,22 +920,11 @@ custom_launch_parameters() { if [[ "${game[0]}" == "executioner's-rage" ]]; then find "${WINEPREFIX}/drive_c/Program Files" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; fi - if [[ "${game[0]}" == "haunted-party" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & - fi if [[ "${game[0]}" == "laser-breakout" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & "${0%/*}/speech/speak_window_title.sh" play.exe & fi - if [[ "${game[0]}" == "light-battles" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & - fi if [[ "${game[0]}" == "mist-world" ]]; then "${0%/*}/speech/speak_window_title.sh" mw.exe & - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & - fi - if [[ "${game[0]}" == "oh-shit" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & fi if [[ "${game[0]}" == "bokurano-daibouken-2" ]]; then "${0%/*}/speech/clipboard_translator.sh" play.exe bokurano-daibouken2 & @@ -952,7 +941,6 @@ custom_launch_parameters() { if [[ ! -e "${dictPath}/data/nvdaControllerClient.dll" ]]; then cp "${cache}/nvda2speechd32.dll" "${dictPath}/data/nvdaControllerClient.dll" fi - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & fi if [[ ! -d "${dictPath}/dict" ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; @@ -962,9 +950,6 @@ custom_launch_parameters() { if [[ "${game[0]}" == "bop-it-emulator" ]]; then "${0%/*}/speech/speak_window_title.sh" bop.exe & fi - if [[ "${game[0]}" == "breu2-shadow-hunt" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & - fi if [[ "${game[0]}" == "road-to-rage" ]]; then "${0%/*}/speech/speak_window_title.sh" trtr.exe & fi @@ -1004,16 +989,9 @@ custom_launch_parameters() { popd exit 0 fi - if [[ "${game[0]}" == "vip-mud" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & - fi if [[ -d "${WINEPREFIX}/drive_c/windows/syswow64" ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & # switch to wine64 for 64 bit prefix. - [[ "${wine}" == "wine" ]] && export wine="wine64" - fi - if [[ "${game[0]}" == "the-great-toy-robbery" ]] ; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & + [[ "${wine}" == "/usr/bin/wine" ]] && export wine="/usr/bin/wine64" fi } @@ -1043,6 +1021,14 @@ create_game_array() { game_launcher() { # For use by update scripts that want to source functions in this file. [[ "$agmNoLaunch" == "true" ]] && return + pgrep -u "$USER" nvda2speechd &> /dev/null || { + if [[ -x ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd ]]; then + if command -v FEXLoader &> /dev/null ; then + FEXLoader -- ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & + else + ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & + fi + fi; } mapfile -t lines < <(sed -e '/^$/d' -e '/^ *#/d' "${configFile}" 2> /dev/null) if [[ ${#lines} -eq 0 ]]; then echo "Install some games first."