Merge pull request #366 from iandrewt/retina-fix

macOS: add @2x label for retina resolutions
This commit is contained in:
Dylan Araps 2016-10-16 00:46:18 +11:00 committed by GitHub
commit d0c67878fe

View file

@ -1324,6 +1324,11 @@ getresolution() {
awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')" awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')"
fi fi
scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)"
[ "${scale_factor%.*}" == "2" ] && \
resolution="${resolution// @/@2x @}"
if [ "$refresh_rate" == "off" ]; then if [ "$refresh_rate" == "off" ]; then
resolution="${resolution// @ [0-9][0-9]Hz}" resolution="${resolution// @ [0-9][0-9]Hz}"
resolution="${resolution// @ [0-9][0-9][0-9]Hz}" resolution="${resolution// @ [0-9][0-9][0-9]Hz}"