From 206fa8d7263dde235b5c59230803c644df887982 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 20 Aug 2022 20:10:53 -0400 Subject: [PATCH] [F] Fix chromeOS (again!) https://github.com/dylanaraps/neofetch/issues/1949 https://github.com/dylanaraps/neofetch/issues/1653 https://github.com/dylanaraps/neofetch/issues/1384 --- neofetch | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/neofetch b/neofetch index c5deb210..51f51736 100755 --- a/neofetch +++ b/neofetch @@ -1130,14 +1130,8 @@ 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='Chrome OS' - elif [[ -f /etc/vzlinux-release ]]; then + elif [[ -f /etc/vzlinux-release ]]; then distro='VzLinux' elif type -p guix >/dev/null; then @@ -1200,14 +1194,19 @@ get_distro() { *) distro+=" on Windows $windows_version" ;; esac + # 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='Chrome OS' + elif [[ $(< /proc/version) == *chrome-bot* || -f /dev/cros_ec ]]; then [[ $distro != *Chrome* ]] && case $distro_shorthand in - on) distro+=" [Chrome OS]" ;; + on) distro="Chrome OS $distro" ;; tiny) distro="Chrome OS" ;; - *) distro+=" on Chrome OS" ;; + *) distro="Chrome OS $distro" ;; esac - distro=${distro## on } fi distro=$(trim_quotes "$distro")