From 7889c093b29eaebe849ceb6e0e370c7f11152c94 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Mon, 29 Aug 2016 21:20:46 +0700 Subject: [PATCH] Added and changed some Android commands Included: - Added model support for Android - Changed CPU command to use native Android ones --- neofetch | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index d8f08b6d..499ad62a 100755 --- a/neofetch +++ b/neofetch @@ -41,7 +41,10 @@ getos() { getmodel() { case "$os" in "Linux") - if [ -f /sys/devices/virtual/dmi/id/product_name ] ||\ + if [ -d "/system/app/" ] && [ -d "/system/priv-app" ]; then + model="$(getprop ro.product.brand) $(getprop ro.product.model)" + + elif [ -f /sys/devices/virtual/dmi/id/product_name ] ||\ [ -f /sys/devices/virtual/dmi/id/product_version ]; then model="$(cat /sys/devices/virtual/dmi/id/product_{name,version} 2>/dev/null)" model="${model/To Be Filled*}" @@ -640,7 +643,12 @@ getcpu() { case "$os" in "Linux" | "Windows") # Get cpu name - cpu="$(awk -F ': | @' '/model name|Processor/ {printf $2; exit}' /proc/cpuinfo)" + case "$distro" in + "Android"*) + cpu="$(getprop ro.product.board)" ;; + *) + cpu="$(awk -F ': | @' '/model name|Processor/ {printf $2; exit}' /proc/cpuinfo)" ;; + esac # Get cpu speed if [ -d "/sys/devices/system/cpu/cpu0/cpufreq" ]; then