aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2021-06-11 08:04:35 +0000
committerDylan Araps <dylan.araps@gmail.com>2021-06-11 08:04:35 +0000
commitacaf6ed00c5c27d4ff869aa8b4068ecadb7a8fc7 (patch)
tree951ee86ef86e8c89d6d06f4469529bb2496120dd
parentff04c7f62d36601d5b1f833cd2c682fc435ca490 (diff)
downloadpfetch-acaf6ed00c5c27d4ff869aa8b4068ecadb7a8fc7.tar.gz
os: iOS support.
-rwxr-xr-xpfetch13
1 files changed, 12 insertions, 1 deletions
diff --git a/pfetch b/pfetch
index 8088632..d223d7d 100755
--- a/pfetch
+++ b/pfetch
@@ -310,7 +310,12 @@ get_os() {
# directly as it contains the key's value.
ProductVersion)
IFS='<>' read -r _ _ mac_version _
- break
+ continue
+ ;;
+
+ ProductName)
+ IFS='<>' read -r _ _ mac_product _
+ continue
;;
esac
done < /System/Library/CoreServices/SystemVersion.plist
@@ -335,6 +340,11 @@ get_os() {
(*) distro='macOS' ;;
esac
+ # Use the ProductName to determine if we're running in iOS.
+ case $mac_product in
+ (iP*) distro='iOS' ;;
+ esac
+
distro="$distro $mac_version"
;;
@@ -589,6 +599,7 @@ get_pkgs() {
(Darwin*)
# Commands which print packages one per line.
has pkgin && pkgin list
+ has dpkg && dpkg-query -f '.\n' -W
# Directories containing packages.
has brew && printf '%s\n' /usr/local/Cellar/*