From 6f004a244f49de4cbd9678313dcd1d02da2b13a2 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sun, 16 Oct 2016 00:39:07 +1100 Subject: [PATCH] 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}"