Merge pull request #454 from dylanaraps/macos

Resolution: [MacOS] If refresh rate is empty don't append Hz
This commit is contained in:
Dylan Araps 2016-11-25 14:20:40 +11:00 committed by GitHub
commit 05a9251942
1 changed files with 4 additions and 0 deletions

View File

@ -1262,6 +1262,10 @@ get_resolution() {
scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)" scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)"
# If no refresh rate is empty.
[[ "$resolution" =~ "@ Hz" ]] && \
resolution="${resolution//@ Hz}"
(("${scale_factor%.*}" == 2)) && \ (("${scale_factor%.*}" == 2)) && \
resolution="${resolution// @/@2x @}" resolution="${resolution// @/@2x @}"