#!/bin/sh
# ~jhs/public_html/bin/.sh/telno
# Purpose: ???? Called by telno_x
# See Also:
#  ~/public_html/src/bsd/jhs/bin/public/phone/index.lmth
#  ~/.procmailrc_private_router_logs
#  vi -c/Purpose:		\
#   ~/bin/.csh/telno_dsl	\
#   ~/bin/.csh/telno_dslx	\
#   ~/bin/.sh/telno		\
#   ~/bin/.sh/telno_2		\
#   ~/bin/.sh/telno_expt	\
#   ~/bin/.sh/telno_router	\
#   ~/bin/.sh/telno_x

# Show who is calling me
# Run it on an ISDN gateway host.
# Called direct by a human logged in on gate, And
# Also called by /etc/isdn/isdn -> /site/etc/isdn/isdn.

. /site/domain/js.berklix.net/etc/gate/variables.sh

#	This script runs on gates that use DISPLAY on another host, eg
#	DISPLAY=user:0
#	(where "user" is a BIND/named cname for a host)
display=`printenv DISPLAY`
# echo "Display: $display"
# "__dimensions:____1280x960_pixels_(338x254_millimeters)"

screen=`xdpyinfo -d $display | grep dimensions | awk '{printf "%s\n",$2}'`
# echo "Screen Pixels: $screen"

# Geometry:	JJLATER fine tune list below.
case $screen in	#{
	"1024x768" )	#{
		geom="80x3-0-63"	# JJLATER consider change
		font="fixed"
		;;	#}
	"1280x960")	#{
		geom="99x3-0-104"	# OK @ 2015-06-19
		font="fixed"		# OK @ 2015-06-19
		;;	#}
	"1600x1200")	#{
		geom="80x3-0-90"	# JJLATER consider change
		font="fixed"		# JJLATER consider change eg 9x15bold
		;;	#}
	*)		#{
		geom="99x3-0-90"	# JJLATER consider change
		font="fixed"
		;;	#}
	esac	#}
# echo "Window Geometry: $geom"

# JJLATER rsh currently pointless as variables.sh exits prior to this
# if not host=isdn.

rsh isdn "xterm -bg `host2colour isdn`	\
 -display $display	\
 -g $geom	\
 -fn $font	\
 -n telno	\
 -T \"Phone Incoming (telno)\"	\
 -e ~/public_html/bin/.sh/telno_2" &

# echo $! > $telno_pid
#	$telno_pid name set by domain/js.berklix.net/etc/gate/variables.sh
#	$telno_pid content may later be used for
#		/site/domain/js.berklix.net/etc/isdn/isdn
