From 3b34a78c4cb1505e30491b4d262e9b9327cec676 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Tue, 20 Mar 2018 07:10:37 +0700 Subject: [PATCH 1/3] OS: Separate Windows 10 into its own if clause --- neofetch | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index 11392b19..a74ee28d 100755 --- a/neofetch +++ b/neofetch @@ -58,15 +58,7 @@ get_distro() { case "$os" in "Linux" | "BSD" | "MINIX") - if [[ "$(< /proc/version)" == *"Microsoft"* || - "$kernel_version" == *"Microsoft"* ]]; then - case "$distro_shorthand" in - "on") distro="$(lsb_release -sir) [Windows 10]" ;; - "tiny") distro="Windows 10" ;; - *) distro="$(lsb_release -sd) on Windows 10" ;; - esac - - elif [[ "$(< /proc/version)" == *"chrome-bot"* || -f "/dev/cros_ec" ]]; then + if [[ "$(< /proc/version)" == *"chrome-bot"* || -f "/dev/cros_ec" ]]; then case "$distro_shorthand" in "on") distro="$(lsb_release -sir) [Chrome OS]" ;; "tiny") distro="Chrome OS" ;; @@ -163,6 +155,15 @@ get_distro() { [[ -f "/etc/pacbsd-release" ]] && distro="PacBSD" fi fi + + if [[ "$(< /proc/version)" == *"Microsoft"* || + "$kernel_version" == *"Microsoft"* ]]; then + case "$distro_shorthand" in + "on") distro+=" [Windows 10]" ;; + "tiny") distro="Windows 10" ;; + *) distro+=" on Windows 10" ;; + esac + fi distro="$(trim_quotes "$distro")" distro="${distro/'NAME='}" ;; From 39cd3ede324e919ba58ff33a72dd3c840039ed1f Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sat, 24 Mar 2018 15:30:00 +0700 Subject: [PATCH 2/3] Distro: Separate ChromeOS detection --- neofetch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/neofetch b/neofetch index a74ee28d..3130af75 100755 --- a/neofetch +++ b/neofetch @@ -58,14 +58,7 @@ get_distro() { case "$os" in "Linux" | "BSD" | "MINIX") - if [[ "$(< /proc/version)" == *"chrome-bot"* || -f "/dev/cros_ec" ]]; then - case "$distro_shorthand" in - "on") distro="$(lsb_release -sir) [Chrome OS]" ;; - "tiny") distro="Chrome OS" ;; - *) distro="$(lsb_release -sd) on Chrome OS" ;; - esac - - elif [[ -f "/etc/redstar-release" ]]; then + if [[ -f "/etc/redstar-release" ]]; then case "$distro_shorthand" in "on" | "tiny") distro="Red Star OS" ;; *) distro="Red Star OS $(awk -F'[^0-9*]' '$0=$2' /etc/redstar-release)" @@ -163,7 +156,15 @@ get_distro() { "tiny") distro="Windows 10" ;; *) distro+=" on Windows 10" ;; esac + + elif [[ "$(< /proc/version)" == *"chrome-bot"* || -f "/dev/cros_ec" ]]; then + case "$distro_shorthand" in + "on") distro+=" [Chrome OS]" ;; + "tiny") distro="Chrome OS" ;; + *) distro+=" on Chrome OS" ;; + esac fi + distro="$(trim_quotes "$distro")" distro="${distro/'NAME='}" ;; From 741493714b5c4675732a48e522ce6d25cefd7341 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sat, 24 Mar 2018 15:33:08 +0700 Subject: [PATCH 3/3] docs: CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93335c11..4b954858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - Fixed detection bug with OpenWRT. [**@dawidd6**](https://github.com/dawidd6) - Fixed detection bug with LEDE. [**@dawidd6**](https://github.com/dawidd6) - Fixed detection bug with TrueOS. [**@dawidd6**](https://github.com/dawidd6) +- Fixed detection bug with Windows Subsystem for Linux and Crouton when an OS without lsb_release is installed. ## General