Move some getimage blocks down so they only run in image mode

This commit is contained in:
Dylan 2016-02-01 08:53:00 +11:00
parent bc53d2eafe
commit 21c76cd90e
1 changed files with 17 additions and 17 deletions

34
fetch
View File

@ -1548,23 +1548,7 @@ getimage () {
image="ascii" image="ascii"
fi fi
# Image size is half of the terminal # Call function based on $image
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.
case "$image" in case "$image" in
"wall") "wall")
getwallpaper getwallpaper
@ -1593,6 +1577,22 @@ getimage () {
return return
fi 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 equals terminal height
lines=$(tput lines) lines=$(tput lines)