#!/bin/csh -f
#+
# start_tklogger -- launch Tklogger widget
#
# Purpose:
#	Start the Tklogger widget, a crude alarm handler which 
#	warns OSIRIS observers about certain errors
#
# Usage:
#	start_tklogger [display]
# 
# Arguments:
#	display = name of the X display on which to show window
# 
# Exit values:
#	0 = normal completion
# 
# Side effects:
#	The TkLogger widget is launched and iconified
# 
# Restrictions:
#	- Must be run on polo
#	- DISPLAY must be properly set or included as arg
# 
# Example:
#	1) Launch the TkLogger widget:
#		start_tklogger
#
#	2) Launch the TkLogger widget on display foobar:0.1:
#		start_tklogger foobar:0.1
# 
#-
# Modification history:
#	2000-Dec-19	GDW	Original version
#	2001-Mar-13	GDW	Allow multiple instances of tklogger
#	2002-Feb-02	GDW	Removed 'ct' call
#	2002-Oct-03	GDW	Adapted for DEIMOS
#       2021-Mar-17     jlyke   Updated for new OSIRIS host
#-----------------------------------------------------------------------

set buf = $0
set cmd = $buf:t
set usage = "Usage: $cmd [display]"

# verify args...
if ( $#argv > 1 ) then
    echo "$usage"
    exit 1
endif

# get args...
if ( $#argv >= 1 ) then
    set display = $1
    shift
endif

# set DISPLAY...
if ( $?display ) then
    setenv DISPLAY $display
endif

# launch the widget...
$BINDIR/tklogger -f $DATDIR/tklogger.config &
