From fac8c8bfad9facc45556cf52092cb2fbf084be3e Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 12 Jun 2025 02:22:11 -0400 Subject: [PATCH] new command for fifo interaction status. --- extras/barnard-sound.sh | 12 ++++++++++++ ui.go | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/extras/barnard-sound.sh b/extras/barnard-sound.sh index 4eaee6c..4f50ad2 100755 --- a/extras/barnard-sound.sh +++ b/extras/barnard-sound.sh @@ -86,6 +86,18 @@ pm() { [[ $notify ]] && notify "$1 from $2: $3" } +status() { + # If transmitting: Payphone coin drop tones (1700+2200 Hz simultaneous, like quarter = 5 tones) + # If not transmitting: Special Information Tone (SIT) - call failed (913.8, 1370.6, 1776.7 Hz) + if [[ "$3" == "transmitting" ]]; then + [[ $sound ]] && play -n synth .025 sin 1700 sin 2200 remix - norm -12 pad 0 .025 repeat 4 + [[ $notify ]] && notify "You are transmitting." + else + [[ $sound ]] && play -n synth .250 sin 913.8 pad 0 .080 : synth .250 sin 1370.6 pad 0 .080 : synth .350 sin 1776.7 remix - norm -12 + [[ $notify ]] && notify "You are not transmitting." + fi +} + if is_function "$1" ; then eval "$1" "$1" "$2" "$3" &> /dev/null else diff --git a/ui.go b/ui.go index 1c5307a..2792ab8 100644 --- a/ui.go +++ b/ui.go @@ -181,6 +181,14 @@ func (b *Barnard) CommandExit(ui *uiterm.Ui, cmd string) { b.Ui.Close() } +func (b *Barnard) CommandStatus(ui *uiterm.Ui, cmd string) { + if b.Tx { + b.Notify("status", "me", "transmitting") + } else { + b.Notify("status", "me", "not transmitting") + } +} + func (b *Barnard) OnClearPress(ui *uiterm.Ui, key uiterm.Key) { b.UiOutput.Clear() } @@ -283,6 +291,7 @@ func (b *Barnard) OnUiInitialize(ui *uiterm.Ui) { b.Ui.AddCommandListener(b.CommandTalk, "toggle") b.Ui.AddCommandListener(b.CommandTalk, "talk") b.Ui.AddCommandListener(b.CommandExit, "exit") + b.Ui.AddCommandListener(b.CommandStatus, "status") b.Ui.AddKeyListener(b.OnFocusPress, b.Hotkeys.SwitchViews) b.Ui.AddKeyListener(b.OnVoiceToggle, b.Hotkeys.Talk) b.Ui.AddKeyListener(b.OnTimestampToggle, b.Hotkeys.ToggleTimestamps)