From 1460f0c37df0425967f91b5cdd4ecb2d85023ba9 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Sat, 13 Jun 2020 21:32:46 -0500 Subject: [PATCH] Allow blinking multiple colors for blinkled --- scripts/core/sxmo_blinkled.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/core/sxmo_blinkled.sh b/scripts/core/sxmo_blinkled.sh index f5b814e..d11b171 100755 --- a/scripts/core/sxmo_blinkled.sh +++ b/scripts/core/sxmo_blinkled.sh @@ -1,4 +1,12 @@ #!/usr/bin/env sh -sxmo_setpineled "$1" 150 -sleep 0.01 -sxmo_setpineled "$1" 0 +PIDS="" +for i in "$@"; do + sxmo_setpineled "$i" 150 & + PIDS="$PIDS $!" +done + +echo "$PIDS" | grep -E '[^ ]+' | xargs wait + +for i in "$@"; do + sxmo_setpineled "$i" 0 +done