From d0cd21c01e3e73dc4af5026d8b25d31c11d3eb81 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Wed, 13 Mar 2019 19:02:18 +0100 Subject: [PATCH 1/6] cache_uname: improve reading from 'SystemVersion.plist' on macOS and iOS and thus fix neofetch for iOS 11.3+ --- neofetch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 55e53238..1063a950 100755 --- a/neofetch +++ b/neofetch @@ -4199,11 +4199,16 @@ cache_uname() { kernel_machine="${uname[2]}" if [[ "$kernel_name" == "Darwin" ]]; then - IFS=$'\n' read -d "" -ra sw_vers < <(awk -F'<|>' '/string/ {print $3}' \ + IFS=$'\n' read -d "" -ra sw_vers < <(awk -F'<|>' '/key|string/ {print $3}' \ "/System/Library/CoreServices/SystemVersion.plist") - darwin_name="${sw_vers[2]}" - osx_version="${sw_vers[3]}" - osx_build="${sw_vers[0]}" + for i in "${!sw_vers[@]}"; do + local value="${sw_vers[(( $i + 1 ))]}" + case "${sw_vers[$i]}" in + "ProductName") darwin_name="$value" ;; + "ProductVersion") osx_version="$value" ;; + "ProductBuildVersion") osx_build="$value" ;; + esac + done fi } From b7ffa9e9bfbd4496377acb4c551f749a1bccd054 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Fri, 22 Mar 2019 18:45:57 +0100 Subject: [PATCH 2/6] cache_uname: change reading variables from 'SystemVersion.plist' as suggested in review --- neofetch | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/neofetch b/neofetch index 1063a950..ff5b551d 100755 --- a/neofetch +++ b/neofetch @@ -4201,14 +4201,13 @@ cache_uname() { if [[ "$kernel_name" == "Darwin" ]]; then IFS=$'\n' read -d "" -ra sw_vers < <(awk -F'<|>' '/key|string/ {print $3}' \ "/System/Library/CoreServices/SystemVersion.plist") - for i in "${!sw_vers[@]}"; do - local value="${sw_vers[(( $i + 1 ))]}" - case "${sw_vers[$i]}" in - "ProductName") darwin_name="$value" ;; - "ProductVersion") osx_version="$value" ;; - "ProductBuildVersion") osx_build="$value" ;; + for ((i=0;i<${#sw_vers[@]};i+=2)) { + case ${sw_vers[i]} in + ProductName) darwin_name=${sw_vers[i+1]} ;; + ProductVersion) osx_version=${sw_vers[i+1]} ;; + ProductBuildVersion) osx_build=${sw_vers[i+1]} ;; esac - done + } fi } From fa3684b3953ac9f0b30628c5769a6878ba76dfa3 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Tue, 16 Apr 2019 03:35:51 +0200 Subject: [PATCH 3/6] add device information for latest ios devices - iPhone9,[1-4] (gpu) - iPhone10,[1-6] (cpu) - iPhone11,2 iPhone11,4 iPhone11,6 iPhone11,8 (model, cpu, gpu) - iPad6,11 iPad6,12 (cpu, gpu) - iPad7,[1-4] (cpu) - iPad7,[5-6] (model, cpu, gpu) - iPad8,[1-8] (model, cpu) - iPad11,[1-4] (model, cpu) source: https://en.wikipedia.org/wiki/List_of_iOS_devices --- neofetch | 57 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/neofetch b/neofetch index ff5b551d..30d7408b 100755 --- a/neofetch +++ b/neofetch @@ -1081,20 +1081,25 @@ get_model() { "iPhone OS") case "$kernel_machine" in - "iPad1,1"): "iPad" ;; - "iPad2,"[1-4]): "iPad 2" ;; - "iPad3,"[1-3]): "iPad 3" ;; - "iPad3,"[4-6]): "iPad 4" ;; - "iPad4,"[1-3]): "iPad Air" ;; - "iPad5,"[3-4]): "iPad Air 2" ;; - "iPad6,"[7-8]): "iPad Pro (12.9 Inch)" ;; - "iPad6,"[3-4]): "iPad Pro (9.7 Inch)" ;; - "iPad7,"[1-2]): "iPad Pro 2 (12.9 Inch)" ;; - "iPad7,"[3-4]): "iPad Pro (10.5 Inch)" ;; - "iPad2,"[5-7]): "iPad mini" ;; - "iPad4,"[4-6]): "iPad mini 2" ;; - "iPad4,"[7-9]): "iPad mini 3" ;; - "iPad5,"[1-2]): "iPad mini 4" ;; + "iPad1,1"): "iPad" ;; + "iPad2,"[1-4]): "iPad 2" ;; + "iPad3,"[1-3]): "iPad 3" ;; + "iPad3,"[4-6]): "iPad 4" ;; + "iPad7,"[5-6]): "iPad 6" ;; + "iPad4,"[1-3]): "iPad Air" ;; + "iPad5,"[3-4]): "iPad Air 2" ;; + "iPad11,"[3-4]): "iPad Air 3" ;; + "iPad6,"[7-8]): "iPad Pro (12.9 Inch)" ;; + "iPad6,"[3-4]): "iPad Pro (9.7 Inch)" ;; + "iPad7,"[1-2]): "iPad Pro 2 (12.9 Inch)" ;; + "iPad7,"[3-4]): "iPad Pro (10.5 Inch)" ;; + "iPad8,"[1-4]): "iPad Pro (11 Inch)" ;; + "iPad8,"[5-8]): "iPad Pro 3 (12.9 Inch)" ;; + "iPad2,"[5-7]): "iPad mini" ;; + "iPad4,"[4-6]): "iPad mini 2" ;; + "iPad4,"[7-9]): "iPad mini 3" ;; + "iPad5,"[1-2]): "iPad mini 4" ;; + "iPad11,"[1-2]): "iPad mini 5" ;; "iPad6,11" | "iPad 6,12") : "iPad 5" @@ -1113,12 +1118,15 @@ get_model() { "iPhone8,1"): "iPhone 6s" ;; "iPhone8,2"): "iPhone 6s Plus" ;; "iPhone8,4"): "iPhone SE" ;; + "iPhone11,2"): "iPhone XS" ;; + "iPhone11,8"): "iPhone XR" ;; "iPhone9,1" | "iPhone9,3"): "iPhone 7" ;; "iPhone9,2" | "iPhone9,4"): "iPhone 7 Plus" ;; "iPhone10,1" | "iPhone10,4"): "iPhone 8" ;; "iPhone10,2" | "iPhone10,5"): "iPhone 8 Plus" ;; "iPhone10,3" | "iPhone10,6"): "iPhone X" ;; + "iPhone11,4" | "iPhone11,6"): "iPhone XS Max" ;; "iPod1,1"): "iPod touch" ;; "ipod2,1"): "iPod touch 2G" ;; @@ -1873,8 +1881,10 @@ get_cpu() { "iPhone5,"[1-4]): "Apple A6 (2) @ 1.3GHz" ;; "iPhone6,"[1-2]): "Apple A7 (2) @ 1.3GHz" ;; "iPhone7,"[1-2]): "Apple A8 (2) @ 1.4GHz" ;; - "iPhone8,"[1-4]): "Apple A9 (2) @ 1.85GHz" ;; - "iPhone9,"[1-4]): "Apple A10 Fusion (4) @ 2.34GHz" ;; + "iPhone8,"[1-4] | "iPad6,11" | "iPad6,12"): "Apple A9 (2) @ 1.85GHz" ;; + "iPhone9,"[1-4] | "iPad7,"[5-6]): "Apple A10 Fusion (4) @ 2.34GHz" ;; + "iPhone10,"[1-6]): "Apple A11 (6) @ 2.39GHz" ;; + "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8" | "iPad11,"[1-4]): "Apple A12 (6) @ 2.49GHz" ;; "iPod2,1"): "Samsung S5L8720 (1) @ 533MHz" ;; "iPod3,1"): "Samsung S5L8922 (1) @ 600MHz" ;; "iPod7,1"): "Apple A8 (2) @ 1.1GHz" ;; @@ -1888,6 +1898,8 @@ get_cpu() { "iPad5,"[3-4]): "Apple A8X (3) @ 1.5GHz" ;; "iPad6,"[3-4]): "Apple A9X (2) @ 2.16GHz" ;; "iPad6,"[7-8]): "Apple A9X (2) @ 2.26GHz" ;; + "iPad7,"[1-4]): "Apple A10X (6) @ 2.39GHz" ;; + "iPad8,"[1-8]): "Apple A12X (8) @ 2.49GHz" ;; esac cpu="$_" ;; @@ -2183,7 +2195,6 @@ get_gpu() { case "$kernel_machine" in "iPhone1,"[1-2]): "PowerVR MBX Lite 3D" ;; "iPhone5,"[1-4]): "PowerVR SGX543MP3" ;; - "iPhone8,"[1-4]): "PowerVR GT7600" ;; "iPad3,"[1-3]): "PowerVR SGX534MP4" ;; "iPad3,"[4-6]): "PowerVR SGX554MP4" ;; "iPad5,"[3-4]): "PowerVR GXA6850" ;; @@ -2205,6 +2216,18 @@ get_gpu() { : "PowerVR GX6450" ;; + "iPhone8,"[1-4] | "iPad6,11" | "iPad6,12") + : "PowerVR GT7600" + ;; + + "iPhone9,"[1-4] | "iPad7,"[5-6]) + : "PowerVR GT7600 Plus" + ;; + + "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8") + : "G11P" + ;; + "iPod1,1" | "iPod2,1") : "PowerVR MBX Lite" ;; From c17173a93bf29cd9058a81d5bb3e5e33d5a137cd Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Tue, 16 Apr 2019 04:13:34 +0200 Subject: [PATCH 4/6] shorten too long line --- neofetch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 30d7408b..8c8fcd46 100755 --- a/neofetch +++ b/neofetch @@ -1884,7 +1884,11 @@ get_cpu() { "iPhone8,"[1-4] | "iPad6,11" | "iPad6,12"): "Apple A9 (2) @ 1.85GHz" ;; "iPhone9,"[1-4] | "iPad7,"[5-6]): "Apple A10 Fusion (4) @ 2.34GHz" ;; "iPhone10,"[1-6]): "Apple A11 (6) @ 2.39GHz" ;; - "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8" | "iPad11,"[1-4]): "Apple A12 (6) @ 2.49GHz" ;; + + "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8" | "iPad11,"[1-4]) + : "Apple A12 (6) @ 2.49GHz" + ;; + "iPod2,1"): "Samsung S5L8720 (1) @ 533MHz" ;; "iPod3,1"): "Samsung S5L8922 (1) @ 600MHz" ;; "iPod7,1"): "Apple A8 (2) @ 1.1GHz" ;; From 3cdcfc2d45ebb9a454c375f533225ee7b3e66b45 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Tue, 16 Apr 2019 15:12:18 +0200 Subject: [PATCH 5/6] include Fusion/Bionic in iDevice processor names --- neofetch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 8c8fcd46..7ac63ed5 100755 --- a/neofetch +++ b/neofetch @@ -1883,10 +1883,10 @@ get_cpu() { "iPhone7,"[1-2]): "Apple A8 (2) @ 1.4GHz" ;; "iPhone8,"[1-4] | "iPad6,11" | "iPad6,12"): "Apple A9 (2) @ 1.85GHz" ;; "iPhone9,"[1-4] | "iPad7,"[5-6]): "Apple A10 Fusion (4) @ 2.34GHz" ;; - "iPhone10,"[1-6]): "Apple A11 (6) @ 2.39GHz" ;; + "iPhone10,"[1-6]): "Apple A11 Bionic (6) @ 2.39GHz" ;; "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8" | "iPad11,"[1-4]) - : "Apple A12 (6) @ 2.49GHz" + : "Apple A12 Bionic (6) @ 2.49GHz" ;; "iPod2,1"): "Samsung S5L8720 (1) @ 533MHz" ;; @@ -1902,8 +1902,8 @@ get_cpu() { "iPad5,"[3-4]): "Apple A8X (3) @ 1.5GHz" ;; "iPad6,"[3-4]): "Apple A9X (2) @ 2.16GHz" ;; "iPad6,"[7-8]): "Apple A9X (2) @ 2.26GHz" ;; - "iPad7,"[1-4]): "Apple A10X (6) @ 2.39GHz" ;; - "iPad8,"[1-8]): "Apple A12X (8) @ 2.49GHz" ;; + "iPad7,"[1-4]): "Apple A10X Fusion (6) @ 2.39GHz" ;; + "iPad8,"[1-8]): "Apple A12X Bionic (8) @ 2.49GHz" ;; esac cpu="$_" ;; From ff53d8d30bc752e853f53ed476e5b89e329ca107 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Wed, 17 Apr 2019 13:03:36 +0200 Subject: [PATCH 6/6] get_cpu, get_gpu, get_model: shorten iPhone OS cases --- neofetch | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/neofetch b/neofetch index 7ac63ed5..2daf4e04 100755 --- a/neofetch +++ b/neofetch @@ -1085,6 +1085,7 @@ get_model() { "iPad2,"[1-4]): "iPad 2" ;; "iPad3,"[1-3]): "iPad 3" ;; "iPad3,"[4-6]): "iPad 4" ;; + "iPad6,1"[12]): "iPad 5" ;; "iPad7,"[5-6]): "iPad 6" ;; "iPad4,"[1-3]): "iPad Air" ;; "iPad5,"[3-4]): "iPad Air 2" ;; @@ -1101,10 +1102,6 @@ get_model() { "iPad5,"[1-2]): "iPad mini 4" ;; "iPad11,"[1-2]): "iPad mini 5" ;; - "iPad6,11" | "iPad 6,12") - : "iPad 5" - ;; - "iPhone1,1"): "iPhone" ;; "iPhone1,2"): "iPhone 3G" ;; "iPhone2,1"): "iPhone 3GS" ;; @@ -1118,16 +1115,15 @@ get_model() { "iPhone8,1"): "iPhone 6s" ;; "iPhone8,2"): "iPhone 6s Plus" ;; "iPhone8,4"): "iPhone SE" ;; + "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,"[46]): "iPhone XS Max" ;; "iPhone11,8"): "iPhone XR" ;; - "iPhone9,1" | "iPhone9,3"): "iPhone 7" ;; - "iPhone9,2" | "iPhone9,4"): "iPhone 7 Plus" ;; - "iPhone10,1" | "iPhone10,4"): "iPhone 8" ;; - "iPhone10,2" | "iPhone10,5"): "iPhone 8 Plus" ;; - "iPhone10,3" | "iPhone10,6"): "iPhone X" ;; - "iPhone11,4" | "iPhone11,6"): "iPhone XS Max" ;; - "iPod1,1"): "iPod touch" ;; "ipod2,1"): "iPod touch 2G" ;; "ipod3,1"): "iPod touch 3G" ;; @@ -1881,11 +1877,11 @@ get_cpu() { "iPhone5,"[1-4]): "Apple A6 (2) @ 1.3GHz" ;; "iPhone6,"[1-2]): "Apple A7 (2) @ 1.3GHz" ;; "iPhone7,"[1-2]): "Apple A8 (2) @ 1.4GHz" ;; - "iPhone8,"[1-4] | "iPad6,11" | "iPad6,12"): "Apple A9 (2) @ 1.85GHz" ;; + "iPhone8,"[1-4] | "iPad6,1"[12]): "Apple A9 (2) @ 1.85GHz" ;; "iPhone9,"[1-4] | "iPad7,"[5-6]): "Apple A10 Fusion (4) @ 2.34GHz" ;; "iPhone10,"[1-6]): "Apple A11 Bionic (6) @ 2.39GHz" ;; - "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8" | "iPad11,"[1-4]) + "iPhone11,"[2468] | "iPad11,"[1-4]) : "Apple A12 Bionic (6) @ 2.49GHz" ;; @@ -2197,12 +2193,13 @@ get_gpu() { "iPhone OS") case "$kernel_machine" in - "iPhone1,"[1-2]): "PowerVR MBX Lite 3D" ;; - "iPhone5,"[1-4]): "PowerVR SGX543MP3" ;; - "iPad3,"[1-3]): "PowerVR SGX534MP4" ;; - "iPad3,"[4-6]): "PowerVR SGX554MP4" ;; - "iPad5,"[3-4]): "PowerVR GXA6850" ;; - "iPad6,"[3-8]): "PowerVR 7XT" ;; + "iPhone1,"[1-2]): "PowerVR MBX Lite 3D" ;; + "iPhone5,"[1-4]): "PowerVR SGX543MP3" ;; + "iPhone11,"[2468]): "G11P" ;; + "iPad3,"[1-3]): "PowerVR SGX534MP4" ;; + "iPad3,"[4-6]): "PowerVR SGX554MP4" ;; + "iPad5,"[3-4]): "PowerVR GXA6850" ;; + "iPad6,"[3-8]): "PowerVR 7XT" ;; "iPhone2,1" | "iPhone3,"[1-3] | "iPod3,1" | "iPod4,1" | "iPad1,1") : "PowerVR SGX535" @@ -2220,7 +2217,7 @@ get_gpu() { : "PowerVR GX6450" ;; - "iPhone8,"[1-4] | "iPad6,11" | "iPad6,12") + "iPhone8,"[1-4] | "iPad6,1"[12]) : "PowerVR GT7600" ;; @@ -2228,10 +2225,6 @@ get_gpu() { : "PowerVR GT7600 Plus" ;; - "iPhone11,2" | "iPhone11,4" | "iPhone11,6" | "iPhone11,8") - : "G11P" - ;; - "iPod1,1" | "iPod2,1") : "PowerVR MBX Lite" ;;