File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3863,10 +3863,16 @@ get_resolution() {
38633863 if spdisplays_resolution="$(PlistBuddy -c "print 0:_items:${gpu}:spdisplays_ndrvs:${display}:_spdisplays_resolution" $temp_plist)" 2>/dev/null; then
38643864 spdisplays_resolution="${spdisplays_resolution//.[0-9][0-9]/}"
38653865 if spdisplays_pixels="$(PlistBuddy -c "print 0:_items:${gpu}:spdisplays_ndrvs:${display}:_spdisplays_pixels" $temp_plist)" 2>/dev/null; then
3866- scaled_x="$(echo "$spdisplays_resolution" | awk '{print $1}')"
3867- output_x="$(echo "$spdisplays_pixels" | awk '{print $1}')"
3868- (( scale_factor=output_x/scaled_x ))
3869- [[ $scale_factor -gt 1 ]] && spdisplays_resolution="${spdisplays_resolution// @/ @${scale_factor}x @}"
3866+ scaled_x="$(echo "$spdisplays_resolution" | awk '{print $1}')"
3867+ output_x="$(echo "$spdisplays_pixels" | awk '{print $1}')"
3868+ (( scale_factor=output_x/scaled_x ))
3869+ if [[ $scale_factor -gt 1 ]]; then
3870+ if [[ "$spdisplays_resolution" == *"@"* ]]; then
3871+ spdisplays_resolution="${spdisplays_resolution// @/ @${scale_factor}x @}"
3872+ else
3873+ spdisplays_resolution="${spdisplays_resolution} @ ${scale_factor}x"
3874+ fi
3875+ fi
38703876 fi
38713877 spdisplays_resolution="${spdisplays_resolution// x /x}"
38723878 [[ $gpu -gt 0 || $display -gt 0 ]] && resolution+=", "
You can’t perform that action at this time.
0 commit comments