diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 06083e1..04ea23d 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -49,7 +49,7 @@ export DIALOGOPTS='--no-lines --visit-items' # Automatic update function update() { local filePath="$(command -v ${0})" - if file "${filePath}" | grep -q 'Bourne-Again shell script,' ; then + if file "${filePath}" | grep -q 'Bourne-Again shell script' ; then return fi # make sure the site can be reached @@ -93,15 +93,16 @@ write_sequence_storm_reader() { # Here-document start cat << "EOF" > ~/.SequenceStormReader #!/usr/bin/env bash - + # Wait for the game to be launched -while ! pgrep -u $USER ^SequenceStorm &> /dev/null ; do +while ! pgrep -u "$USER" ^SequenceStorm &> /dev/null ; do sleep 0.05 done - + export DISPLAY=:0 unset cliptext -while pgrep -u $USER ^SequenceStorm &> /dev/null ; do +socketFile="$(find /tmp -maxdepth 1 -name "orca-*.sock")" +while pgrep -u "$USER" ^SequenceStorm &> /dev/null ; do if [[ "$(uname)" == "Darwin" ]]; then tmp="$(pbpaste 2> /dev/null)" else @@ -114,19 +115,27 @@ while pgrep -u $USER ^SequenceStorm &> /dev/null ; do if [[ "$(uname)" == "Darwin" ]]; then say -v alex -r 300 "$cliptext" else - spd-say -w -r 50 -- "$cliptext" + if [[ -w "${socketFile}" ]]; then + echo "<#APPEND#>$cliptext" | socat - UNIX-CLIENT:"${socketFile}" + else + spd-say -w -r 50 -- "$cliptext" + fi fi else if [[ "$(uname)" == "Darwin" ]]; then say -v alex -r 300 "$cliptext" else - spd-say -r 50 -- "$cliptext" + if [[ -w "${socketFile}" ]]; then + echo "$cliptext" | socat - UNIX-CLIENT:"${socketFile}" + else + spd-say -r 50 -- "$cliptext" + fi fi fi fi sleep 0.05 done - + exit 0 EOF # Here-document end @@ -469,6 +478,8 @@ gameList=( "AudioDisc" "Battle Zone" "Bloodshed" + "Castaways" + "Castaways 2" #"Chopper Challenge" "Christmas WhoopAss" "Crazy Party" @@ -604,6 +615,22 @@ case "${game}" in cp "${cache}/bloodshed.exe" "$WINEPREFIX/drive_c/Program Files/" add_launcher "c:\Program Files\bloodshed.exe" ;; + "Castaways") + export winVer="win7" + install_wine_bottle vb6run dx8vb speechsdk + download "https://www.kaldobsky.com/audiogames/castaways.zip" + unzip -d "$WINEPREFIX/drive_c/Program Files/castaways" "${cache}/castaways.zip" + wine "c:\Program Files\castaways\Checkup.exe" /verysilent + add_launcher "c:\Program Files\castaways\Castaways.exe" + ;; + "Castaways 2") + export winVer="win7" + install_wine_bottle vb6run dx8vb speechsdk + download "http://www.kaldobsky.com/audiogames/castaways2beta.zip" + unzip -d "$WINEPREFIX/drive_c/Program Files/castaways" "${cache}/castaways2beta.zip" + wine "c:\Program Files\castaways\Checkup.exe" /verysilent + add_launcher "c:\Program Files\castaways\Castaways2.exe" + ;; "Chopper Challenge") # Freezes at menu install_wine_bottle vb6run dx8vb speechsdk @@ -617,9 +644,7 @@ case "${game}" in "Christmas WhoopAss") install_wine_bottle vb6run dx8vb download "https://www.agarchive.net/games/draconis/christmas%20whoopass%20setup.exe" - wine "${cache}/christmas whoopass setup.exe" /silent & - xdotool sleep 10 key --clearmodifiers alt+y 2> /dev/null - wineserver -w + wine "${cache}/christmas whoopass setup.exe" /sp- /silent add_launcher "c:\Program Files\Draconis Entertainment\Christmas Whoop Ass\wa.exe" ;; "Crazy Party") @@ -633,9 +658,7 @@ case "${game}" in "Crazy Tennis") install_wine_bottle speechsdk download "https://www.agarchive.net/games/VIP/crazy%20tennis%20setup.exe" - wine "${cache}/crazy tennis setup.exe" /silent & - xdotool sleep 10 key --clearmodifiers alt+y 2> /dev/null - wineserver -w + wine "${cache}/crazy tennis setup.exe" /sp- /silent add_launcher "c:\Program Files\Crazytennis\crazytennis.exe" ;; "Death on the Road") @@ -670,14 +693,12 @@ case "${game}" in install_wine_bottle dx8vb vb6run download "http://www.agarchive.net/games/bpc/fartman.exe" wine "${cache}/fartman.exe" /silent - #add_launcher "c:\Program Files\Finger Panic 1.0\FingerPanic.exe" + #add_launcher "c:\Program Files\" ;; "Finger Panic") install_wine_bottle dx8vb vb6run download "http://www.agarchive.net/games/bsc/FingerPanicSetup.exe" - wine "${cache}/FingerPanicSetup.exe" /silent & - xdotool sleep 10 key --clearmodifiers alt+y 2> /dev/null - wineserver -w + wine "${cache}/FingerPanicSetup.exe" /sp- /silent add_launcher "c:\Program Files\Finger Panic 1.0\FingerPanic.exe" ;; "Fuck That Bird") @@ -869,9 +890,7 @@ EOF "Pacman Talks") install_wine_bottle download "http://www.gmagames.com/pmt101.exe" - wine "${cache}/pmt101.exe" /silent & - xdotool sleep 10 key --clearmodifiers alt+y 2> /dev/null - wineserver -w + wine "${cache}/pmt101.exe" /sp- /silent & add_launcher "c:\Program Files\Pacman Talks\pmt.exe" ;; "Palace Punch Up")