#!/bin/sh

# If running in a window system, determine the screen dimensions and
#  set SCREENWIDTH and SCREENHEIGHT

if [ -n "${DISPLAY}" ]; then
	export SCREENWIDTH SCREENHEIGHT
	eval `xwininfo -root | \
		sed -n -e 's/Height: /SCREENHEIGHT=/p' \
		-e 's/Width: /SCREENWIDTH=/p'`
fi

echo Screen width: $SCREENWIDTH   height: $SCREENHEIGHT

# If running in a window system, change size of xterm
  
if [ -n "${DISPLAY}" ]; then
	if [ ${SCREENHEIGHT} -gt 480 ]; then
		echo "[8;35;t"                ## reset
	else
		echo "[4;${SCREENHEIGHT};t"   ## set at given size
	fi
fi


