macOS: add @2x label for retina resolutions

This commit is contained in:
Andrew Titmuss 2016-10-16 00:39:07 +11:00
parent 6ed294e94d
commit 6f004a244f
No known key found for this signature in database
GPG key ID: 8AF42975C787E0B2

View file

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