#! /bin/sh
# .gnome2/nautilus-scripts/word-count

PROG=$(basename $0)

if [ "$1" = "-h" ]; then
  echo "Usage: $PROG FILE..."
  exit 0
fi

XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage

font=monospace
[ "$XMESSAGE" = xmessage ] && font=fixed

[ "$#" -ge 1 ] &&
  wc "$@" 2>&1 | $XMESSAGE ${font:+-fn "$font"}     \
                         -title "$PROG"             \
                         -nearmouse                 \
                         -buttons GTK_STOCK_CLOSE:0 \
                         -default GTK_STOCK_CLOSE   \
                         -file -

