#!/bin/tcsh

# NOTE!  If you're debugging this and an instance was already running,
# you have to kill -both- this process -and- the nc that it's spawned,
# or the leftover nc will hog the port and the new instantiation of this
# will just err...

set in  = /tmp/fz-eas.in.$$

set bgcolor = PeachPuff1

while (1)
  nc -l -p 56789 > $in
  if (-z $in) then
    echo "Somehow $in was empty."
  else
    xmessage -bg $bgcolor -buttons '' -geometry +1600+0 -file $in &
    eas-beep
    sleep 1		# Wait around for xmessage to finish reading it...
  endif
  rm -f $in
end
