From 526c97fde60f4b4aed35323745b4924fdd5d3a87 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:13:50 -0700 Subject: [PATCH] [F] Fix shellcheck warnings https://github.com/dylanaraps/neofetch/pull/2356 --- neofetch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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