From 442c5d936bbe528f24a33c8c3d60816fa8a5866d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 10 Jun 2016 18:31:19 +1000 Subject: [PATCH] Reduce size of term_size format block --- neofetch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index b78f19f0..dc2ba915 100755 --- a/neofetch +++ b/neofetch @@ -2290,16 +2290,15 @@ getimage () { read -t 1 ${read_flags} -s -r term_size stty echo + + # 83;28;8;15 + # Split the string if [ "$image_backend" == "tycat" ]; then - lines=${term_size%%';'*} - columns=${term_size%';'*';'*} - columns=${columns#*';'} - font_height=${term_size##*';'} - font_weight=${term_size#*';'*';'} - font_weight=${font_weight%';'*} - term_height=$((font_height * columns)) - term_width=$((font_weight * lines)) + term_size=(${term_size//;/ }) + term_width=$((term_size[2] * term_size[0])) + term_height=$((term_size[3] * term_size[1])) + else term_size=${term_size//'['} term_size=${term_size/';'} @@ -2311,7 +2310,7 @@ getimage () { # If $img isn't a file or the terminal doesn't support xterm escape sequences, # fallback to ascii mode. - if [ ! -f "$img" ] || [ ${#term_size} -le 5 ]; then + if [ ! -f "$img" ] || [ ${#term_size} -le 5 ] && [ "$image_backend" != "tycat" ]; then image="ascii" getascii