Initial commit. Added obs-chat-monitor script

This commit is contained in:
David Thurstenson 2022-01-13 12:29:08 -06:00
commit 3f4076c321
3 changed files with 29 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
obs-chat/obs-chat-monitor.conf

25
obs-chat/obs-chat-monitor.bash Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Move pwd to the same dir where the script is located
scriptpath=$(dirname "$0")
cd "$scriptpath" || exit
# Source untracked variables
source ./obs-chat-monitor.conf
# Remaining operational vars
sedscript="./weechat-massage.sed"
foldwidth=50
maxlines=15
outfile="/tmp/obs-chat.txt"
# Clear $outfile
printf '%.0s\n' $(seq $maxlines) > "$outfile"
ssh "$remotehost" \
tail -fn0 "$remotelog" | \
sed -u -r -f "$sedscript" | \
stdbuf -i0 -o0 \
fold -s -w "$foldwidth" | \
tee -a "$outfile"

View File

@ -0,0 +1,3 @@
s/^[[:digit:]]+-[[:digit:]]+-[[:digit:]]+ [[:digit:]]+:[[:digit:]]+:[[:digit:]]+\t/\n/g
/.?--.?\t/d
s/(.*)\t/\1:\n/