[PR] dylanaraps/neofetch#2356 from CarterLi - Resolution (macOS): improve detection
Upstream PR: https://github.com/dylanaraps/neofetch/pull/2356 Thanks to @CarterLi Co-authored-by: 李通洲 <zhangsongcui3371@sina.com>
This commit is contained in:
commit
afcf53f01f
1 changed files with 10 additions and 4 deletions
8
neofetch
8
neofetch
|
@ -3866,7 +3866,13 @@ get_resolution() {
|
|||
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 @}"
|
||||
if [[ $scale_factor -gt 1 ]]; then
|
||||
if [[ "$spdisplays_resolution" == *"@"* ]]; then
|
||||
spdisplays_resolution="${spdisplays_resolution// @/ @${scale_factor}x @}"
|
||||
else
|
||||
spdisplays_resolution="${spdisplays_resolution} @ ${scale_factor}x"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
spdisplays_resolution="${spdisplays_resolution// x /x}"
|
||||
[[ $gpu -gt 0 || $display -gt 0 ]] && resolution+=", "
|
||||
|
|
Loading…
Reference in a new issue