diff --git a/neofetch b/neofetch index 08bd6a9d..3d3f0a79 100755 --- a/neofetch +++ b/neofetch @@ -3828,13 +3828,13 @@ get_resolution() { if spdisplays_resolution="$(PlistBuddy -c "print 0:_items:${gpu}:spdisplays_ndrvs:${display}:_spdisplays_resolution" $temp_plist)" 2>/dev/null; then spdisplays_resolution="${spdisplays_resolution//.[0-9][0-9]/}" if spdisplays_pixels="$(PlistBuddy -c "print 0:_items:${gpu}:spdisplays_ndrvs:${display}:_spdisplays_pixels" $temp_plist)" 2>/dev/null; then - scaled_x="$(echo $spdisplays_resolution | awk '{print $1}')" - output_x="$(echo $spdisplays_pixels | awk '{print $1}')" - let scale_factor=$output_x/$scaled_x - [[ $scale_factor > 1 ]] && spdisplays_resolution="${spdisplays_resolution// @/ @${scale_factor}x @}" + scaled_x="$(echo "$spdisplays_resolution" | awk '{print $1}')" + output_x="$(echo "$spdisplays_pixels" | awk '{print $1}')" + (( scale_factor=output_x/scaled_x )) + [[ $scale_factor -gt 1 ]] && spdisplays_resolution="${spdisplays_resolution// @/ @${scale_factor}x @}" fi spdisplays_resolution="${spdisplays_resolution// x /x}" - [[ $gpu > 0 || $display > 0 ]] && resolution+=", " + [[ $gpu -gt 0 || $display -gt 0 ]] && resolution+=", " resolution+="${spdisplays_resolution}" else break