From b5485bea7a3e8329158de54794970bb5503dbbe4 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 5 Dec 2016 09:13:19 +1100 Subject: [PATCH] Distro add back full lsb_release support. Closes #493 --- neofetch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index bc5a92dc..a3062429 100755 --- a/neofetch +++ b/neofetch @@ -64,6 +64,14 @@ get_distro() { *) distro="Red Star OS $(awk -F'[^0-9*]' '$0=$2' /etc/redstar-release)" esac + elif type -p lsb_release >/dev/null; then + case "$distro_shorthand" in + "on") lsb_flags="-sir" ;; + "tiny") lsb_flags="-si" ;; + *) lsb_flags="-sd" ;; + esac + distro="$(lsb_release $lsb_flags)" + elif type -p guix >/dev/null; then distro="GuixSD" @@ -83,15 +91,6 @@ get_distro() { source "$file" && break done - # If the os-release file identifies the system as "Ubuntu" - # we then use /etc/lsb-release to get the distro information. - # This is required since Linux Mint and other distros - # aren't using the os-release file correctly. - if [[ "$NAME" =~ "Ubuntu" ]]; then - source /etc/lsb-release - unset NAME VERSION_ID PRETTY_NAME UBUNTU_CODENAME - fi - # Format the distro name. case "$distro_shorthand" in "on") distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;;