From cdfcfe8fd04d1d5719a7e6163a4c314ce73c93c1 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 24 Mar 2023 14:44:47 -0600 Subject: [PATCH] make rotate.sh first class citizen for receiving signal --- host.d/README.md | 22 ++++++------------- .../config.d/mayhem-party.d/remap.d/rotate.sh | 2 ++ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/host.d/README.md b/host.d/README.md index 1c48d68..7c8e74c 100644 --- a/host.d/README.md +++ b/host.d/README.md @@ -23,27 +23,19 @@ See `./config.d/rusty-pipe.d` ## `rusty-pipe` -```bash -INPUT_NAME=udp -INPUT_UDP_PORT=port -``` +`INPUT_NAME=udp INPUT_UDP_PORT=port rusty-pipe | ...` ## `mayhem-party` -`cd ./config.d/mayhem-party.d/remap.d; bash ./rotate.sh` and press enter at least once - ### Configs +`cd ./config.d/mayhem-party.d/remap.d; bash ./rotate.sh` + +> rotate anytime via stdin or `pkill -SIGUSR1 -f rotate.sh` + ### Binary -```bash -DEBUG=1 -INPUT_KEYBOARD=true -INPUT_REFRESH_ON_SIGUSR1=true -INPUT_REMAP_FILE=/tmp/mayhem-party.d/live -MAIN_INTERVAL_DURATION=5ms -OUTPUT_KEYBOARD=true -``` +`... | bash -c 'true; source ./config.d/mayhem-party.d/env.env; mayhem-party'` ## Game Playing @@ -51,5 +43,5 @@ Foreground ## `stt` -TODO pipe stt detecting relevant strings -> change the `/tmp/mayhem-party.d/live` link -> `SIGUSR1` to `mayhem-party` +TODO pipe stt detecting relevant strings -> change the `./config.d/mayhem-party.d/remap.d/live.yaml` link -> `SIGUSR1` to `mayhem-party` diff --git a/host.d/config.d/mayhem-party.d/remap.d/rotate.sh b/host.d/config.d/mayhem-party.d/remap.d/rotate.sh index 2fe9798..744fe5d 100644 --- a/host.d/config.d/mayhem-party.d/remap.d/rotate.sh +++ b/host.d/config.d/mayhem-party.d/remap.d/rotate.sh @@ -11,6 +11,8 @@ mayhem_party_rotate() { pkill -SIGUSR1 -f mayhem-party } +trap mayhem_party_rotate SIGUSR1 + if [ "$0" == "$BASH_SOURCE" ]; then NEXT=0 mayhem_party_rotate while read -p "$(date) > [press enter to rotate]"; do