Added and changed some Android commands
Included: - Added model support for Android - Changed CPU command to use native Android ones
This commit is contained in:
parent
26de54e555
commit
7889c093b2
1 changed files with 10 additions and 2 deletions
12
neofetch
12
neofetch
|
@ -41,7 +41,10 @@ getos() {
|
||||||
getmodel() {
|
getmodel() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux")
|
"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
|
[ -f /sys/devices/virtual/dmi/id/product_version ]; then
|
||||||
model="$(cat /sys/devices/virtual/dmi/id/product_{name,version} 2>/dev/null)"
|
model="$(cat /sys/devices/virtual/dmi/id/product_{name,version} 2>/dev/null)"
|
||||||
model="${model/To Be Filled*}"
|
model="${model/To Be Filled*}"
|
||||||
|
@ -640,7 +643,12 @@ getcpu() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "Windows")
|
"Linux" | "Windows")
|
||||||
# Get cpu name
|
# 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
|
# Get cpu speed
|
||||||
if [ -d "/sys/devices/system/cpu/cpu0/cpufreq" ]; then
|
if [ -d "/sys/devices/system/cpu/cpu0/cpufreq" ]; then
|
||||||
|
|
Loading…
Reference in a new issue