From 78b00ac62a042b61b4fc7f347ef1d012aa833395 Mon Sep 17 00:00:00 2001 From: bel Date: Sun, 2 Apr 2023 11:40:10 -0600 Subject: [PATCH] less sudo and 2 virtual devices --- config.d/mayhem-party.d/v01-live.yaml | 26 ++++++++--------- git.d/mayhem-party.d | 2 +- git.d/rusty-pipe.d | 2 +- server.sh | 42 +++++++++++++++++---------- 4 files changed, 41 insertions(+), 31 deletions(-) diff --git a/config.d/mayhem-party.d/v01-live.yaml b/config.d/mayhem-party.d/v01-live.yaml index 680abe9..f846167 100644 --- a/config.d/mayhem-party.d/v01-live.yaml +++ b/config.d/mayhem-party.d/v01-live.yaml @@ -4,8 +4,8 @@ feedback: users: bel: meta: - lasttsms: 1680454187304 - lastlag: 103 + lasttsms: 1680371007738 + lastlag: 0 state: player: 1 message: "" @@ -26,17 +26,17 @@ users: vote: "" players: - transformation: - "1": "6" - "2": "7" - "3": "8" - "4": "9" - "5": "0" - a: f - d: h - e: "y" - q: r - s: g - w: t + "1": "6" # a + "2": "7" # b + "3": "8" # x + "4": "9" # y + "5": "0" # start + a: f # stickLeft + d: h # stickRight + e: "y" # r + q: r # l + s: g # stickDown + w: t # stickUp quiet: false broadcast: message: "" diff --git a/git.d/mayhem-party.d b/git.d/mayhem-party.d index 342e2ee..934158b 160000 --- a/git.d/mayhem-party.d +++ b/git.d/mayhem-party.d @@ -1 +1 @@ -Subproject commit 342e2eef93f3d772b7e1eda7feaaf0852534bd53 +Subproject commit 934158b7a3adbf81cc24baaf1ed050076e6046b7 diff --git a/git.d/rusty-pipe.d b/git.d/rusty-pipe.d index 324a7b0..31bdb6d 160000 --- a/git.d/rusty-pipe.d +++ b/git.d/rusty-pipe.d @@ -1 +1 @@ -Subproject commit 324a7b07b0dfcc1373b28a7f85a5d2ea070caec2 +Subproject commit 31bdb6d92e40103c4be000f46ebcf5d2e2ff5920 diff --git a/server.sh b/server.sh index 9af1377..6c889d3 100644 --- a/server.sh +++ b/server.sh @@ -36,11 +36,15 @@ log() { } _discord() { + echo read -p "pls start discord" + echo } _dolphin() { + echo read -p "pls start dolphin" + echo } _mayhem_party() { @@ -81,28 +85,34 @@ _stt() { | awk "{print \$NF}" \ | head -n 1 ) - ( - echo "pcm.pulse_monitor {" - echo " type pulse" - echo " device $device" - echo "}" - echo "ctl.pulse_monitor {" - echo " type pulse" - echo " device $device" - echo "}" - ) | sudo tee /etc/asound.conf + if ! test -f /etc/asound.conf || ! grep "$device" /etc/asound.conf; then + ( + echo "pcm.pulse_monitor {" + echo " type pulse" + echo " device $device" + echo "}" + echo "ctl.pulse_monitor {" + echo " type pulse" + echo " device $device" + echo "}" + ) | sudo tee /etc/asound.conf + fi for i in $(pactl list short modules | grep secret | cut -f1); do pactl unload-module $i done name='my_secret_sink' - if ! pactl list | grep -q $name; then - pactl load-module module-null-sink sink_name=$name channels=1 - pactl load-module module-remap-source master=$name.monitor source_name=shared-$name source_properties="device.description=shared-$name" #channels=1 - mic_name="$(pactl list | grep -A 100 Name:.$name.monitor | grep device.description.=. | head -n 1 | sed 's/.* = //' | tr -d '"') Monitor" - fi + for i in 1 2; do + if ! pactl list | grep -q $name$i; then + pactl load-module module-null-sink sink_name=$name$i channels=1 + pactl load-module module-remap-source master=$name$i.monitor source_name=shared-$name$i source_properties="device.description=shared-$name$i" + mic_name="$(pactl list | grep -A 100 Name:.$name$i.monitor | grep device.description.=. | head -n 1 | sed 's/.* = //' | tr -d '"') Monitor" + fi + done - read -p "pavucontrol to change input to $mic_name, ok? " + echo + read -p "pavucontrol to change input to $name, ok? " + echo log launching stt ( export HOTWORDS=../../config.d/mayhem-party.d/v01-live.yaml@.users[].state.gm.alias