Updated sequence storm reader script to use the newly available self-voicing function available to orca from simple orca plugin system.

This commit is contained in:
Storm Dragon 2020-12-19 20:07:42 -05:00
parent 4e1f3bd61e
commit 57f6ec1e4b

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
license() { license() {
cat << EOF cat << EOF
@ -93,15 +93,16 @@ write_sequence_storm_reader() {
# Here-document start # Here-document start
cat << "EOF" > ~/.SequenceStormReader cat << "EOF" > ~/.SequenceStormReader
#!/usr/bin/env bash #!/usr/bin/env bash
# Wait for the game to be launched # 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 sleep 0.05
done done
export DISPLAY=:0 export DISPLAY=:0
unset cliptext 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 if [[ "$(uname)" == "Darwin" ]]; then
tmp="$(pbpaste 2> /dev/null)" tmp="$(pbpaste 2> /dev/null)"
else else
@ -114,19 +115,27 @@ while pgrep -u $USER ^SequenceStorm &> /dev/null ; do
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
say -v alex -r 300 "$cliptext" say -v alex -r 300 "$cliptext"
else 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 fi
else else
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
say -v alex -r 300 "$cliptext" say -v alex -r 300 "$cliptext"
else 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 fi
fi fi
sleep 0.05 sleep 0.05
done done
exit 0 exit 0
EOF EOF
# Here-document end # Here-document end