From 86c86581ffe2f30a3f883956841bd03ff8be9e8b Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 16 Nov 2020 16:57:16 -0500 Subject: [PATCH] Sequence Storm now working. --- audiogame-manager.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 74b38e1..8e6bd73 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -26,6 +26,37 @@ update() { fi } +# Create the clipboard reading function for Sequence Storm +write_sequence_storm_reader() { + if -e ~/.SequenceStormReader ]]; then + return + fi +# Here-document start +cat << "EOF" > ~/.SequenceStormReader +#! /bin/bash + +export DISPLAY=:0 +close=-1 +unset cliptext +while [[ $close -ne 0 ]]; do + tmp="$(xclip -selection clipboard -o)" + if [ "$tmp" != "$cliptext" ] ; then + cliptext="$tmp" + spd-say -r 50 "$cliptext" + fi + sleep 0.05 + if [ $(pgrep -cu $USER SequenceStorm) -eq 0 -a $close -eq -1 ]; then + continue + fi + close=$(pgrep -cu $USER SequenceStorm) +done + +exit 0 +EOF +# Here-document end + chmod 755 ~/.SequenceStormReader +} + # Wine configuration section checklist() { @@ -79,6 +110,11 @@ checklist() { else errorList+=("Warning: Wine mono not found, some games may not work.") fi + if command -v xclip &> /dev/null ; then + echo "Xclip is installed." + else + errorList+=("Warning: Xclip is not installed. Some games may not speak.") + fi if command -v xdotool &> /dev/null ; then echo "Xdotool is installed." else @@ -233,6 +269,10 @@ game_launcher() { xdg-open "https://patreon.com/stormux" exit 0 fi + # for games that require custom scripts before launch + if [[ "$game" =~ sequence-storm ]]; then + [[ -x ~/.SequenceStormReader ]] && ~/.SequenceStormReader & + fi local winePath="${game#*|}" winePath="${winePath%\\*.exe}" local wineExec="${game#*|}" @@ -592,6 +632,7 @@ case "${game}" in export winVer="win10" install_wine_bottle unzip -d "$WINEPREFIX/drive_c/Program Files/sequence-storm" "${cache}/sequence-storm-win64.zip" + write_sequence_storm_reader wget -O "$WINEPREFIX/drive_c/Program Files/sequence-storm/settings.json" "https://stormgames.wolfe.casa/downloads/sequencestorm-settings.json" add_launcher "c:\Program Files\sequence-storm\SequenceStorm.exe" ;;