commit dee9c507ee7789f0e9d41fd162a9b3acc7c6fbd3
parent ed4cb003a1a09e0bc590c8a84100843b6d98e1ec
Author: sin <sin@2f30.org>
Date: Tue, 15 Apr 2014 09:42:14 +0100
Rename eventmonitor to pm-monitor
No need to source .config from the join script.
Diffstat:
4 files changed, 31 insertions(+), 33 deletions(-)
diff --git a/eventmonitor b/eventmonitor
@@ -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
diff --git a/hysteria b/hysteria
@@ -3,8 +3,8 @@
. ./config
rm -rf irc
-tmux new-session -s hysteria -d ./eventmonitor
-tmux rename-window "event-monitor"
+tmux new-session -s hysteria -d ./pm-monitor
+tmux rename-window "pm-monitor"
for h in $hosts; do
./connectserver "$h"
diff --git a/join b/join
@@ -12,8 +12,6 @@ if [ $? -eq 1 ]; then
exit 1
fi
-. ./config
-
host=$(echo $1 | awk -F: '{print $1}')
shift
for c in $*; do
diff --git a/pm-monitor b/pm-monitor
@@ -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