pfetch: iOS support
This commit is contained in:
parent
c20823937c
commit
987d3b61fd
26
pfetch
26
pfetch
|
@ -210,19 +210,27 @@ get_os() {
|
|||
# says "populate $line with the third field's contents".
|
||||
while IFS='<>' read -r _ _ line _; do
|
||||
case $line in
|
||||
# Match 'ProductVersion' and read the next line
|
||||
# Match the key and read the next line
|
||||
# directly as it contains the key's value.
|
||||
ProductVersion)
|
||||
IFS='<>' read -r _ _ mac_version _
|
||||
#
|
||||
# Define a shell variable using the key's value.
|
||||
ProductName|ProductVersion)
|
||||
IFS='<>' read -r _ _ "${line?}" _
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < /System/Library/CoreServices/SystemVersion.plist
|
||||
|
||||
# Use the ProductVersion to determine which macOS/OS X codename
|
||||
# the system has. As far as I'm aware there's no "dynamic" way
|
||||
# of grabbing this information.
|
||||
case $mac_version in
|
||||
case ${ProductName?} in
|
||||
iPhone*)
|
||||
distro="iOS ${ProductVersion?}"
|
||||
;;
|
||||
|
||||
*)
|
||||
# Use the ProductVersion to determine which macOS/OS X
|
||||
# codename the system has. As far as I'm aware there's
|
||||
# no "dynamic" way of grabbing this information.
|
||||
case ${ProductVersion?} in
|
||||
10.4*) distro='Mac OS X Tiger' ;;
|
||||
10.5*) distro='Mac OS X Leopard' ;;
|
||||
10.6*) distro='Mac OS X Snow Leopard' ;;
|
||||
|
@ -238,7 +246,9 @@ get_os() {
|
|||
*) distro='macOS' ;;
|
||||
esac
|
||||
|
||||
distro="$distro $mac_version"
|
||||
distro="$distro ${ProductVersion?}"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
Haiku)
|
||||
|
|
Loading…
Reference in New Issue
Block a user