From 03152764aaf4293ab349e59460bc0f5e49c0bfd8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 29 Dec 2019 23:46:29 +0000 Subject: [PATCH] cols: Fix issues --- neofetch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index cf93a365..a5cef780 100755 --- a/neofetch +++ b/neofetch @@ -1975,8 +1975,8 @@ get_cpu() { # Select the right temperature file. for temp_dir in /sys/class/hwmon/*; do - [[ "$(< "${temp_dir}/name")" =~ (coretemp|fam15h_power|k10temp) ]] && \ - { temp_dir="${temp_dir}/temp1_input"; break; } + [[ "$(< "$temp_dir/name")" =~ (coretemp|fam15h_power|k10temp) ]] && + { temp_dir=$temp_dir/temp1_input; break; } done # Get CPU speed. @@ -3598,12 +3598,13 @@ get_cols() { printf -v block_spaces "%${block_height}s" # Convert the spaces into rows of blocks. - [[ "$blocks" ]] && cols+="${block_spaces// /${blocks}${reset}nl}" - [[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}${reset}nl}" + [[ "$blocks" ]] && cols+="${block_spaces// /${blocks}nl}" + [[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}nl}" # Add newlines to the string. - cols="${cols%%'nl'}" - cols="${cols//nl/\\n\\e[${text_padding}C${zws}}" + cols=${cols%%nl} + cols=${cols//nl/ +[${text_padding}C${zws}} # Add block height to info height. ((info_height+=block_range[1]>7?block_height+3:block_height+2))