From 3c3aa125bfd097ba1127a83362cc3b7e951a59ac Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Mon, 15 Nov 2021 19:57:21 -0800 Subject: [PATCH] Wait fdr X-touch mini to be connected --- pamidi.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pamidi.sh b/pamidi.sh index 997ece9..1bec10c 100755 --- a/pamidi.sh +++ b/pamidi.sh @@ -39,10 +39,16 @@ initialize(){ echo "xdotool found" fi echo "Waiting for pulseaudio service to start..." - while [ ! $(systemctl --machine=joey@.host --user status pamidi.service) ]; do + while [[ $(systemctl --machine=joey@.host --user is-active --quiet pulseaudio) ]]; do echo "Pulseaudio service not started, waiting..." sleep 2 done + echo "Waiting for X-TOUCH MINI to be connected..." + while [[ ! $(lsusb | grep "X-TOUCH MINI") ]] + do + echo "X-TOUCH MINI not connected. Waiting..." + sleep 2 + done col_1_app_pid=-1 col_2_app_pid=-1 col_3_app_pid=-1