From 1954063895bb06cfafb50622d522649baf2a1f8d Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 21 Feb 2016 08:53:30 +1100 Subject: [PATCH] Use a variable so we don't calculate terminal height twice --- fetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fetch b/fetch index c3663d69..a016f6ac 100755 --- a/fetch +++ b/fetch @@ -1837,9 +1837,10 @@ getimage () { case "$image_size" in "auto") image_size=$((columns * font_width / 2)) + term_height=$((term_height - term_height / 4)) - [ "$((term_height - term_height / 4))" -lt "$image_size" ] && \ - image_size=$((term_height - term_height / 4)) + [ "$term_height" -lt "$image_size" ] && \ + image_size="$term_height" ;; *"%")