Height argument is now optional.
authorIain Patterson <me@iain.cx>
Wed, 29 Aug 2007 10:19:02 +0000 (10:19 +0000)
committerIain Patterson <me@iain.cx>
Wed, 29 Aug 2007 10:19:02 +0000 (10:19 +0000)
git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@68 6be0d1a5-5cfe-0310-89b6-964be062b18b

usize

diff --git a/usize b/usize
index 6a806ab..ec2b25d 100755 (executable)
--- a/usize
+++ b/usize
@@ -1,10 +1,23 @@
-#!/bin/bash
+#!/bin/bash -i
 #
 # $Id$
 #
+# usize: Set urxvt (or terminal which understands the same escape sequences) 
+#        size.
+# Usage: usize <width> [<height>]
+#
+
+width=$COLUMNS
+height=$LINES
+
+case $# in
+  0)
+    echo "Usage: usize $width $height"
+    exit 1
+  ;;
+  1) width=$1;;
+  2) width=$1; height=$2;;
+esac
 
-if [ $# -lt 2 ]; then
-  echo "Usage: usize <width> <height>"
-  exit 1
-fi
-echo -e "\e[8;$2;$1;t"
+echo -e "\033[8;$height;$width;t"
+exit 0