os: iOS support.

This commit is contained in:
Dylan Araps 2021-06-11 08:04:35 +00:00
parent ff04c7f62d
commit acaf6ed00c

13
pfetch
View File

@ -310,7 +310,12 @@ get_os() {
# directly as it contains the key's value. # directly as it contains the key's value.
ProductVersion) ProductVersion)
IFS='<>' read -r _ _ mac_version _ IFS='<>' read -r _ _ mac_version _
break continue
;;
ProductName)
IFS='<>' read -r _ _ mac_product _
continue
;; ;;
esac esac
done < /System/Library/CoreServices/SystemVersion.plist done < /System/Library/CoreServices/SystemVersion.plist
@ -335,6 +340,11 @@ get_os() {
(*) distro='macOS' ;; (*) distro='macOS' ;;
esac esac
# Use the ProductName to determine if we're running in iOS.
case $mac_product in
(iP*) distro='iOS' ;;
esac
distro="$distro $mac_version" distro="$distro $mac_version"
;; ;;
@ -589,6 +599,7 @@ get_pkgs() {
(Darwin*) (Darwin*)
# Commands which print packages one per line. # Commands which print packages one per line.
has pkgin && pkgin list has pkgin && pkgin list
has dpkg && dpkg-query -f '.\n' -W
# Directories containing packages. # Directories containing packages.
has brew && printf '%s\n' /usr/local/Cellar/* has brew && printf '%s\n' /usr/local/Cellar/*