From 8e21a69ea0c01f59f44e5e912adac725e0b047e6 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Fri, 12 Jan 2018 21:18:13 +0100 Subject: [PATCH 1/2] distro: fix OpenWrt/LEDE detection --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index cb0e8fde..b6a1037d 100755 --- a/neofetch +++ b/neofetch @@ -122,8 +122,8 @@ get_distro() { elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then distro="Android $(getprop ro.build.version.release)" - elif [[ -f "/etc/os-release" || -f "/usr/lib/os-release" ]]; then - files=("/etc/os-release" "/usr/lib/os-release") + elif [[ -f "/etc/os-release" || -f "/usr/lib/os-release" || -f "/etc/openwrt_release" ]]; then + files=("/etc/os-release" "/usr/lib/os-release" "/etc/openwrt_release") # Source the os-release file for file in "${files[@]}"; do From 1506d3840f910ed4ebe65e39d80ceccf7832b79b Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sat, 13 Jan 2018 16:53:20 +0100 Subject: [PATCH 2/2] indent if conditions + remove some trailing spaces --- neofetch | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/neofetch b/neofetch index b6a1037d..66daa1a0 100755 --- a/neofetch +++ b/neofetch @@ -122,7 +122,9 @@ get_distro() { elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then distro="Android $(getprop ro.build.version.release)" - elif [[ -f "/etc/os-release" || -f "/usr/lib/os-release" || -f "/etc/openwrt_release" ]]; then + elif [[ -f "/etc/os-release" || \ + -f "/usr/lib/os-release" || \ + -f "/etc/openwrt_release" ]]; then files=("/etc/os-release" "/usr/lib/os-release" "/etc/openwrt_release") # Source the os-release file @@ -231,7 +233,7 @@ get_distro() { "IRIX") distro="IRIX ${kernel_version}" ;; - + "FreeMiNT") distro="FreeMiNT" ;; @@ -682,7 +684,7 @@ get_de() { *neod*) de="NeoDesk" ;; *zdesk*) de="zDesk" ;; *mdesk*) de="mDesk" ;; - esac + esac done ;; @@ -805,7 +807,7 @@ get_wm() { *myaes*) wm="MyAES" ;; *naes*) wm="N.AES" ;; geneva) wm="Geneva" ;; - esac + esac done ;; esac @@ -1239,7 +1241,7 @@ get_cpu_usage() { "iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;; "AIX") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;; "IRIX") cores="$(sysconf NPROC_ONLN)" ;; - "FreeMiNT") cores="$(sysctl -n hw.ncpu)" + "FreeMiNT") cores="$(sysctl -n hw.ncpu)" esac fi