From f7353a6b643f089cd6875dfe5e2a24d9c539b526 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 27 Aug 2016 08:48:43 +1000 Subject: [PATCH] Model: Add checks for more files --- neofetch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 35b63e50..5220093e 100755 --- a/neofetch +++ b/neofetch @@ -41,8 +41,17 @@ getos() { getmodel() { case "$os" in "Linux") - model="$(cat /sys/devices/virtual/dmi/id/product_{name,version} 2>/dev/null)" - model="${model/To Be Filled*}" + if [ -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*}" + + elif [ -f /sys/firmware/devicetree/base/model ]; then + model="$(< /sys/firmware/devicetree/base/model)" + + elif [ -f /tmp/sysinfo/model ]; then + model="$(< /tmp/sysinfo/model)" + fi ;; "Mac OS X") model="$(sysctl -n hw.model)" ;;