hysteria

ii wrapper script
git clone git://git.2f30.org/hysteria.git
Log | Files | Refs | README | LICENSE

commit 43d2d4b62e2c585b39d5e4d5864ba6a7f91add08
parent fee1a1f3a269985c82427cd22499dba3efd6fb52
Author: sin <sin@2f30.org>
Date:   Tue Apr 15 00:04:55 +0100

Rename monitor to eventmonitor

Diffstat:
eventmonitor | 29+++++++++++++++++++++++++++++
hysteria | 2+-
monitor | 29-----------------------------
3 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/eventmonitor b/eventmonitor @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Monitor for private messages and create a new split tmux window + +while :; do + for n in $(find irc -type f -name "out" 2>/dev/null); do + echo $n | awk -F/ '{if (NF == 4) print $3}' | \ + grep '^#' >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + continue + fi + title=$(echo $n | awk -F/ '{if (NF == 4) print $2":"$3}') + if test -z $title; then + continue + fi + found=0 + for t in $(tmux list-windows -F '#W'); do + if test "$t" == "$title"; then + found=1 + fi + done + if test $found -eq 0; then + tmux new-window "tail -f $n | ./highlight" + tmux split-window -p 1 "cat > $(dirname $n)/in" + tmux rename-window "$title" + fi + done + sleep 1 +done diff --git a/hysteria b/hysteria @@ -3,7 +3,7 @@ . ./config rm -rf irc -tmux new-session -s hysteria -d ./monitor +tmux new-session -s hysteria -d ./eventmonitor tmux rename-window "event-monitor" ./connectserver "irc.freenode.net" diff --git a/monitor b/monitor @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Monitor for private messages and create a new split tmux window - -while :; do - for n in $(find irc -type f -name "out" 2>/dev/null); do - echo $n | awk -F/ '{if (NF == 4) print $3}' | \ - grep '^#' >/dev/null 2>/dev/null - if [ $? -eq 0 ]; then - continue - fi - title=$(echo $n | awk -F/ '{if (NF == 4) print $2":"$3}') - if test -z $title; then - continue - fi - found=0 - for t in $(tmux list-windows -F '#W'); do - if test "$t" == "$title"; then - found=1 - fi - done - if test $found -eq 0; then - tmux new-window "tail -f $n | ./highlight" - tmux split-window -p 1 "cat > $(dirname $n)/in" - tmux rename-window "$title" - fi - done - sleep 1 -done