From 21c76cd90e9b1870e94b706e809bb84de9b71123 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 1 Feb 2016 08:53:00 +1100 Subject: [PATCH] Move some getimage blocks down so they only run in image mode --- fetch | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fetch b/fetch index 9a919c8b..400905fe 100755 --- a/fetch +++ b/fetch @@ -1548,23 +1548,7 @@ getimage () { image="ascii" fi - # Image size is half of the terminal - imgsize=$((columns * font_width / split_size)) - - # Where to draw the image - case "$image_position" in - "left") - # Padding is half the terminal width + gap - padding="\033[$((columns / split_size + gap))C" - ;; - - "right") - padding="\033[0C" - xoffset=$((columns * font_width / split_size - gap)) - ;; - esac - - # If wall=on, Get image to display from current wallpaper. + # Call function based on $image case "$image" in "wall") getwallpaper @@ -1593,6 +1577,22 @@ getimage () { return fi + # Image size is half of the terminal + imgsize=$((columns * font_width / split_size)) + + # Where to draw the image + case "$image_position" in + "left") + # Padding is half the terminal width + gap + padding="\033[$((columns / split_size + gap))C" + ;; + + "right") + padding="\033[0C" + xoffset=$((columns * font_width / split_size - gap)) + ;; + esac + # Lines equals terminal height lines=$(tput lines)