From 4d9dd065233b4b046a5a9c6d24d189b4a7edc544 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 16 Nov 2020 17:44:23 -0500 Subject: [PATCH] Improvements to Sequence Storm installations. --- audiogame-manager.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 8e6bd73..022392b 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -35,20 +35,20 @@ write_sequence_storm_reader() { cat << "EOF" > ~/.SequenceStormReader #! /bin/bash +# Wait for the game to be launched +while ! pgrep -u $USER ^SequenceStorm &> /dev/null ; do + sleep 0.05 +done + export DISPLAY=:0 -close=-1 unset cliptext -while [[ $close -ne 0 ]]; do +while pgrep -u $USER ^SequenceStorm &> /dev/null ; 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