From 9da18ed22b25eaffe868fd6e68a60035bcdf3063 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 19 Dec 2011 11:49:57 +0000 Subject: [PATCH] Allow X multiplier for usize. Use X3 to use the same multiplier for both width and height. --- opt/bin/usize | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opt/bin/usize b/opt/bin/usize index c287fa1..e965db3 100755 --- a/opt/bin/usize +++ b/opt/bin/usize @@ -4,6 +4,7 @@ # size. # Usage: usize [] # Usage: usize x [x] +# Usage: usize X # width=${COLUMNS:-80} @@ -20,12 +21,16 @@ case $# in esac # Allow, eg, x2 for width or height. -if [ ! "${width#x}" = "${width}" ]; then +if [ ! "${width#X}" = "$width" ]; then + width="${width/X/x}" + height=$width +fi +if [ ! "${width#x}" = "$width" ]; then # Add a column for dividers. width=${width#x} width=$((width-1+(87*width))) fi -if [ ! "${height#x}" = "${height}" ]; then +if [ ! "${height#x}" = "$height" ]; then height=${height#x} height=$((24*height)) # Add a row for tmux. -- 2.20.1