diff --git a/neofetch b/neofetch index 814f1cea..0b050758 100755 --- a/neofetch +++ b/neofetch @@ -877,6 +877,23 @@ get_distro() { esac distro="$(lsb_release "$lsb_flags")" + 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 + source "$file" && break + done + + # Format the distro name. + case "$distro_shorthand" in + "on") distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;; + "tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;; + "off") distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;; + esac + elif [[ -f "/etc/GoboLinuxVersion" ]]; then case "$distro_shorthand" in "on" | "tiny") distro="GoboLinux" ;; @@ -906,23 +923,6 @@ get_distro() { elif [[ -f "/etc/lsb-release" && "$(< /etc/lsb-release)" == *CHROMEOS* ]]; then distro="$(awk -F '=' '/NAME|VERSION/ {printf $2 " "}' /etc/lsb-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 - source "$file" && break - done - - # Format the distro name. - case "$distro_shorthand" in - "on") distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;; - "tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;; - "off") distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;; - esac - elif type -p guix >/dev/null; then case "$distro_shorthand" in "on" | "tiny") distro="GuixSD" ;;