From 6f004a244f49de4cbd9678313dcd1d02da2b13a2 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sun, 16 Oct 2016 00:39:07 +1100 Subject: [PATCH 1/3] macOS: add @2x label for retina resolutions --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index baf4b89c..1c63c43b 100755 --- a/neofetch +++ b/neofetch @@ -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}" From 52e08842503416d3f4c85247b6bc32d7527c3c83 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sun, 16 Oct 2016 00:43:20 +1100 Subject: [PATCH 2/3] remove test from if statement --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 1c63c43b..b24d5fe8 100755 --- a/neofetch +++ b/neofetch @@ -1326,7 +1326,7 @@ getresolution() { scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)" - if [ "${scale_factor%.*}" == "1" ]; then + if [ "${scale_factor%.*}" == "2" ]; then resolution="${resolution// @/@2x @}" fi From 2010d1132851dfebe3493b097b36468fc69cd08d Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sun, 16 Oct 2016 00:45:27 +1100 Subject: [PATCH 3/3] shorten if statement for retina check --- neofetch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/neofetch b/neofetch index b24d5fe8..3112bdb5 100755 --- a/neofetch +++ b/neofetch @@ -1326,9 +1326,8 @@ getresolution() { scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)" - if [ "${scale_factor%.*}" == "2" ]; then + [ "${scale_factor%.*}" == "2" ] && \ resolution="${resolution// @/@2x @}" - fi if [ "$refresh_rate" == "off" ]; then resolution="${resolution// @ [0-9][0-9]Hz}"