Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Macbook identifaction
Browse files Browse the repository at this point in the history
  • Loading branch information
EriksRemess committed Nov 4, 2021
1 parent 3f1c1e4 commit 0fd3a6a
Showing 1 changed file with 69 additions and 7 deletions.
76 changes: 69 additions & 7 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,69 @@ get_model() {
if [[ $(kextstat | grep -F -e "FakeSMC" -e "VirtualSMC") != "" ]]; then
model="Hackintosh (SMBIOS: $(sysctl -n hw.model))"
else
model=$(sysctl -n hw.model)
mac_model=$(sysctl -n hw.model)
case $mac_model in
MacBookPro18,[3-4]): "MacBook Pro (14-inch, 2021)" ;;
MacBookPro18,[1-2]): "MacBook Pro (16-inch, 2021)" ;;
MacBookPro17,1): "MacBook Pro (13-inch, M1, 2020)" ;;
MacBookPro16,4): "MacBook Pro (16-inch, 2019)" ;;
MacBookPro16,3): "MacBook Pro (13-inch, 2020, Two Thunderbolt 3 ports)" ;;
MacBookPro16,2): "MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)" ;;
MacBookPro16,1): "MacBook Pro (16-inch, 2019)" ;;
MacBookPro15,4): "MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports)" ;;
MacBookPro15,3): "MacBook Pro (15-inch, 2019)" ;;
MacBookPro15,2): "MacBook Pro (13-inch, 2018/2019, Four Thunderbolt 3 ports)" ;;
MacBookPro15,1): "MacBook Pro (15-inch, 2018/2019)" ;;
MacBookPro14,3): "MacBook Pro (15-inch, 2017)" ;;
MacBookPro14,2): "MacBook Pro (13-inch, 2017, Four Thunderbolt 3 ports)" ;;
MacBookPro14,1): "MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)" ;;
MacBookPro13,3): "MacBook Pro (15-inch, 2016)" ;;
MacBookPro13,2): "MacBook Pro (13-inch, 2016, Four Thunderbolt 3 ports)" ;;
MacBookPro13,1): "MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)" ;;
MacBookPro12,1): "MacBook Pro (Retina, 13-inch, Early 2015)" ;;
MacBookPro11,[4-5]): "MacBook Pro (Retina, 15-inch, Mid 2015)" ;;
MacBookPro11,[2-3]): "MacBook Pro (Retina, 15-inch, Late 2013/Mid 2014)" ;;
MacBookPro11,1): "MacBook Pro (Retina, 13-inch, Late 2013/Mid 2014)" ;;
MacBookPro10,2): "MacBook Pro (Retina, 13-inch, Late 2012/Early 2013)" ;;
MacBookPro10,1): "MacBook Pro (Retina, 15-inch, Mid 2012/Early 2013)" ;;
MacBookPro9,2): "MacBook Pro (13-inch, Mid 2012)" ;;
MacBookPro9,1): "MacBook Pro (15-inch, Mid 2012)" ;;
MacBookPro8,3): "MacBook Pro (17-inch, 2011)" ;;
MacBookPro8,2): "MacBook Pro (15-inch, 2011)" ;;
MacBookPro8,1): "MacBook Pro (13-inch, 2011)" ;;
MacBookPro7,1): "MacBook Pro (13-inch, Mid 2010)" ;;
MacBookPro6,2): "MacBook Pro (15-inch, Mid 2010)" ;;
MacBookPro6,1): "MacBook Pro (17-inch, Mid 2010)" ;;
MacBookPro5,5): "MacBook Pro (13-inch, Mid 2009)" ;;
MacBookPro5,3): "MacBook Pro (15-inch, Mid 2009)" ;;
MacBookPro5,2): "MacBook Pro (17-inch, Mid/Early 2009)" ;;
MacBookPro5,1): "MacBook Pro (15-inch, Late 2008)" ;;
MacBookPro4,1): "MacBook Pro (17/15-inch, Early 2008)" ;;
MacBookAir10,1): "MacBook Air (M1, 2020)" ;;
MacBookAir9,1): "MacBook Air (Retina, 13-inch, 2020)" ;;
MacBookAir8,2): "MacBook Air (Retina, 13-inch, 2019)" ;;
MacBookAir8,1): "MacBook Air (Retina, 13-inch, 2018)" ;;
MacBookAir7,2): "MacBook Air (13-inch, Early 2015/2017)" ;;
MacBookAir7,1): "MacBook Air (11-inch, Early 2015)" ;;
MacBookAir6,2): "MacBook Air (13-inch, Mid 2013/Early 2014)" ;;
MacBookAir6,1): "MacBook Air (11-inch, Mid 2013/Early 2014)" ;;
MacBookAir5,2): "MacBook Air (13-inch, Mid 2012)" ;;
MacBookAir5,1): "MacBook Air (11-inch, Mid 2012)" ;;
MacBookAir4,2): "MacBook Air (13-inch, Mid 2011)" ;;
MacBookAir4,1): "MacBook Air (11-inch, Mid 2011)" ;;
MacBookAir3,2): "MacBook Air (13-inch, Late 2010)" ;;
MacBookAir3,1): "MacBook Air (11-inch, Late 2010)" ;;
MacBookAir2,1): "MacBook Air (Mid 2009)" ;;
MacBook10,1): "MacBook (Retina, 12-inch, 2017)" ;;
MacBook9,1): "MacBook (Retina, 12-inch, Early 2016)" ;;
MacBook8,1): "MacBook (Retina, 12-inch, Early 2015)" ;;
MacBook7,1): "MacBook (13-inch, Mid 2010)" ;;
MacBook6,1): "MacBook (13-inch, Late 2009)" ;;
MacBook5,2): "MacBook (13-inch, Early/Mid 2009)" ;;
*): "$mac_model" ;;
esac

model=$_
fi
;;

Expand Down Expand Up @@ -1306,13 +1368,13 @@ get_model() {
iPhone8,1): "iPhone 6s" ;;
iPhone8,2): "iPhone 6s Plus" ;;
iPhone8,4): "iPhone SE" ;;
iPhone9,[1-3]): "iPhone 7" ;;
iPhone9,[2-4]): "iPhone 7 Plus" ;;
iPhone10,[1-4]): "iPhone 8" ;;
iPhone10,[2-5]): "iPhone 8 Plus" ;;
iPhone10,[3-6]): "iPhone X" ;;
iPhone9,[13]): "iPhone 7" ;;
iPhone9,[24]): "iPhone 7 Plus" ;;
iPhone10,[14]): "iPhone 8" ;;
iPhone10,[25]): "iPhone 8 Plus" ;;
iPhone10,[36]): "iPhone X" ;;
iPhone11,2): "iPhone XS" ;;
iPhone11,[4-6]): "iPhone XS Max" ;;
iPhone11,[46]): "iPhone XS Max" ;;
iPhone11,8): "iPhone XR" ;;
iPhone12,1): "iPhone 11" ;;
iPhone12,3): "iPhone 11 Pro" ;;
Expand Down

0 comments on commit 0fd3a6a

Please sign in to comment.