From 5f39250003a6b1740a5d5c7706dc80edbff605f8 Mon Sep 17 00:00:00 2001 From: BomberFish <87151697+BomberFish@users.noreply.github.com> Date: Wed, 15 Mar 2023 12:26:15 -0400 Subject: [PATCH 1/2] add cros fixes --- neofetch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 48b96d21..397ca454 100755 --- a/neofetch +++ b/neofetch @@ -1066,7 +1066,7 @@ get_distro() { # 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 + elif grep -q CHROMEOS /etc/lsb-release; then distro='Chrome OS' elif type -p guix >/dev/null; then @@ -1112,11 +1112,14 @@ get_distro() { esac elif [[ $(< /proc/version) == *chrome-bot* || -f /dev/cros_ec ]]; then + # gets chrome os version from /etc/lsb-release. + # totally not written by chatgpt :trolley: + cros_version=$(grep -oE 'CHROMEOS_RELEASE_BRANCH_NUMBER=([0-9]+)' /etc/lsb-release | cut -d= -f2) [[ $distro != *Chrome* ]] && case $distro_shorthand in - on) distro+=" [Chrome OS]" ;; - tiny) distro="Chrome OS" ;; - *) distro+=" on Chrome OS" ;; + on) distro+=" [Chrome OS $cros_version]" ;; + tiny) distro="Chrome OS $cros_version" ;; + *) distro+="Chrome OS $cros_version" ;; esac distro=${distro## on } fi From 93639996bb62e336cd406da7d9bdeee9824d62bd Mon Sep 17 00:00:00 2001 From: BomberFish <87151697+BomberFish@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:44:59 -0400 Subject: [PATCH 2/2] oops --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 397ca454..a33fc6d4 100755 --- a/neofetch +++ b/neofetch @@ -1114,7 +1114,7 @@ get_distro() { elif [[ $(< /proc/version) == *chrome-bot* || -f /dev/cros_ec ]]; then # gets chrome os version from /etc/lsb-release. # totally not written by chatgpt :trolley: - cros_version=$(grep -oE 'CHROMEOS_RELEASE_BRANCH_NUMBER=([0-9]+)' /etc/lsb-release | cut -d= -f2) + cros_version=$(grep -oE 'CHROMEOS_RELEASE_CHROME_MILESTONE=([0-9]+)' /etc/lsb-release | cut -d= -f2) [[ $distro != *Chrome* ]] && case $distro_shorthand in on) distro+=" [Chrome OS $cros_version]" ;;