Skip to content

Commit

Permalink
[F] Fix shellcheck warnings dylanaraps/neofetch#2356
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Aug 10, 2023
1 parent 391ff75 commit 526c97f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 526c97f

Please sign in to comment.