From 3de37dc6a04cb91d3e5ce3d447fca7f69f893e46 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 16 Nov 2016 20:16:11 +1100 Subject: [PATCH] Distro: Prefer /etc/os-release, break on successful source --- neofetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 55902725..988bfd42 100755 --- a/neofetch +++ b/neofetch @@ -131,6 +131,7 @@ get_distro() { esac ascii_distro="Windows 10" + # TODO: Install Red Star OS and check if this is really needed. elif [[ -f "/etc/redstar-release" ]]; then case "$distro_shorthand" in "on" | "tiny") distro="Red Star OS" ;; @@ -160,8 +161,8 @@ get_distro() { else # Source the os-release file - for file in /etc/*ease /usr/lib/*ease; do - source "$file" + for file in /etc/os-release /etc/*ease /usr/lib/*ease; do + source "$file" && break done # The 3rd line down matches the fold marker syntax. {{{