From f275d53fa6af257c7e6cf2fa84c9a0c9598b9762 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 16 Oct 2016 10:44:05 +1100 Subject: [PATCH] Fix broken block_width --- neofetch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 9c40faf9..e21c4591 100755 --- a/neofetch +++ b/neofetch @@ -1901,14 +1901,15 @@ getbirthday() { getcols() { if [ "$color_blocks" == "on" ]; then # Convert the width to space chars. - block_width="$(printf "%$((block_width-=1))s")" + block_width="$(printf "%${block_width}s")" + block_width="${block_width// /█}" # Generate the string. while [ $start -le $end ]; do case "$start" in - [0-6]) blocks+="${reset}\033[3${start}m\033[4${start}m%${block_width}s" ;; - 7) blocks+="${reset}\033[3${start}m\033[4${start}m%${block_width}s" ;; - *) blocks2+="\033[38;5;${start}m\033[48;5;${start}m%${block_width}s" ;; + [0-6]) blocks+="${reset}\033[3${start}m\033[4${start}m${block_width}" ;; + 7) blocks+="${reset}\033[3${start}m\033[4${start}m${block_width}" ;; + *) blocks2+="\033[38;5;${start}m\033[48;5;${start}m${block_width}" ;; esac start="$((start+=1))" done