aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-10-03 10:18:34 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-10-03 10:18:34 +0300
commit3f5845e20c60d3ab3dc927d1d7f0b07231ce18d6 (patch)
treeb4e9592b8d9dc341ca626a18e8da3ee391489ff6
parentc94e2c5d9d20d64bc82254227977e3bd2d6ff6b6 (diff)
downloadpfetch-3f5845e20c60d3ab3dc927d1d7f0b07231ce18d6.tar.gz
pfetch: android support
-rwxr-xr-xpfetch8
1 files changed, 7 insertions, 1 deletions
diff --git a/pfetch b/pfetch
index 800b503..631314c 100755
--- a/pfetch
+++ b/pfetch
@@ -129,7 +129,7 @@ get_os() {
case $os in
Linux*)
- # Some Linux disttributions (which are based on others)
+ # Some Linux distributions (which are based on others)
# fail to identify as they **do not** change the upstream
# distributions identification packages or files.
#
@@ -154,6 +154,12 @@ get_os() {
if command -v lsb_release; then
distro=$(lsb_release -sd)
+ # Android detection works by checking for the existence of
+ # the follow two directories. I don't think there's a simpler
+ # method than this.
+ elif [ -d /system/app ] && [ -d /system/priv-app ]; then
+ distro="Android $(getprop ro.build.version.release)"
+
else
# This used to be a simple '. /etc/os-release' but I believe
# this is insecure as we blindly executed whatever was in the