X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=usize;h=73b03469cb2d92319fe1efd9160d61bb9a6d4d8d;hp=6a806abd8da87392aae933493f0e93766ea7c124;hb=518d9698777610c32b50ac83d8a9463be91f0563;hpb=ccd9a2392417e22f770ba7d7eec7cfc5d997a799 diff --git a/usize b/usize index 6a806ab..73b0346 100755 --- 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=${COLUMNS:-80} +height=${LINES:-24} + +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 " - exit 1 -fi -echo -e "[8;$2;$1;t" +echo -e "\033[8;$height;$width;t" +exit 0