#!/bin/sh
#
#       XTREE.SH
#       Start utree on X terminal if possible
#       3.04-um klin, Sat May 23 17:19:18 1992
#       Usage:          xtree [xtree_options[ [utree_options]
#       Options:        Special xtree options for xterm are:
#                       -di[splay] server_name
#                       -ge[ometry] utree_geometry
#                       -fn normal_font
#                       -fb bold_font
#                       -cu[rsor] cursor_shape
#                       All utree options are allowed
#       Directory:      /usr/local/bin
#
#       SCCSID = @(#) utree 3.04-um (klin) May 23 1992 x11/xtree.sh
#       USAGE  = @(#) Usage: xtree [xtree_options] [utree_options]

XT=/usr/bin/X11/xterm                   # Path of terminal emulator xterm
UT=utree                                # Utree filesystem browser
UF=-XM                                  # Utree flags: use font and mouse
TI=utree                                # Title and name for utree window

if test -x $XT                          # Check xterm
then
  DI=                                   # Display
  GE=80x24                              # Default geometry of utree window
  CU=hand2                              # Default cursor shape
  FN=ut9x15                             # Default normal font
  FB=ut9x15                             # Default bold font
  while test $# -ge 1                   # Check and set options
  do
    case $1 in
      -di*) shift; DI="-display $1";;   # Display
      -ge*) shift; GE=$1;;              # Geometry
      -fn*) shift; FN=$1; FB=$1;;       # Normal = bold font
      -fb*) shift; FB=$1; FN=$1;;       # Bold = normal font
      -cu*) shift; CU=$1;;              # Cursor shape
      *)           UF="$UF $1";;        # Utree options and parameters
    esac
    shift
  done
  exec $XT $DI -g $GE -fn $FN -fb $FB -xrm "*pointerShape: $CU" -bw 2 +sb -T "$TI" -name "$TI" -e $UT $UF &
else
  exec $UT $*                           # Call utree
fi
