git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copy became script to target directory.
[profile.git]
/
opt
/
bin
/
usize
diff --git
a/opt/bin/usize
b/opt/bin/usize
index
c287fa1
..
e965db3
100755
(executable)
--- a/
opt/bin/usize
+++ b/
opt/bin/usize
@@
-4,6
+4,7
@@
# size.
# Usage: usize <width> [<height>]
# Usage: usize x<width_multiplier> [x<height_multiplier>]
# size.
# Usage: usize <width> [<height>]
# Usage: usize x<width_multiplier> [x<height_multiplier>]
+# Usage: usize X<multiplier>
#
width=${COLUMNS:-80}
#
width=${COLUMNS:-80}
@@
-20,12
+21,16
@@
case $# in
esac
# Allow, eg, x2 for width or height.
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
# 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.
height=${height#x}
height=$((24*height))
# Add a row for tmux.