[F] Fix shellcheck warnings https://github.com/dylanaraps/neofetch/pull/2356
This commit is contained in:
parent
391ff75cd1
commit
526c97fde6
1 changed files with 5 additions and 5 deletions
10
neofetch
10
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
|
||||
|
|
Loading…
Reference in a new issue