From 790401c6eafc66f319aab572c94b24802ef8194f Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Apr 2018 10:05:12 +1000 Subject: [PATCH] OS: Fix ChromeOS detection. --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index 585a4b3d..4f27f25f 100755 --- a/neofetch +++ b/neofetch @@ -107,6 +107,12 @@ get_distro() { elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then distro="Android $(getprop ro.build.version.release)" + # Chrome OS doesn't conform to the /etc/*-release standard. + # While the file is a series of variables they can't be sourced + # by the shell since the values aren't quoted. + 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