#!/bin/sh -

width=635	# my standard browser dimensions
height=993	# default assuming 1024 pixel screen height

# xresize - resize the selected X window
# Steve Kinzler, steve@kinzler.com, Mar 04/Jan 08
# https://kinzler.com/me/home.html#x11

# NOTE: For unknown reasons, this command can behave very strangely sometimes
#	when run from within a *twmrc file.

case "$1" in
-h)	(echo "usage: $0 [ -this ] [ width [ height ] ]"
	 echo "Default $width x $height") 1>&2; exit 1;;
esac

case "$1" in
-this)	shift; args=;;
*)	args=-select;;
esac

case "$1" in
[-+][0-9]*|[0-9]*)	width="$1";;
esac
case "$2" in
[-+][0-9]*|[0-9]*)	height="$2";;
esac

case "$width,$height" in
[-+]*|*,[-+]*)	echo "$0: relative resizing not yet supported" 1>&2
		exit;;
esac

xwit $args -resize "$width" "$height" > /dev/null &
