#!/bin/bash
#
# g3x -- throw a G3 file (Digifax or raw) onto the desktop.
#
# Ralph Schleicher
# rs@purple.in-ulm.de


for arg
do
  if [ -f $arg ]
  then
    g3=$arg
  elif [ -f $arg.g3 ]
  then
    g3=$arg.g3
  else
    echo "$0:$arg[.g3]: No such file"; continue
  fi

  tmp="/tmp/g3x.`basename $arg`.$$"

  g3cat $g3 >$tmp 2>/dev/null
  xli -pixmap $tmp >/dev/null 2>&1
  rm -f $tmp >/dev/null 2>&1
done
