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() {
cat << EOF
@ -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