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
1 changed files with 6 additions and 0 deletions

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}"