Distro: Apply suggestion
This commit is contained in:
parent
2bad735fb3
commit
e4d7baecaf
1 changed files with 6 additions and 4 deletions
10
neofetch
10
neofetch
|
@ -54,7 +54,7 @@ get_distro() {
|
|||
|
||||
case "$os" in
|
||||
"Linux" | "BSD" | "MINIX")
|
||||
if [[ "$(< /proc/version)" == *"Microsoft"* || "$(< /proc/sys/kernel/osrelease)" == *"Microsoft"* ]]; then ## ERRORS NEED TO BE SUPPRESSED!
|
||||
if [[ "$(< /proc/version)" == *"Microsoft"* || "$(< /proc/sys/kernel/osrelease)" == *"Microsoft"* ]]; then
|
||||
case "$distro_shorthand" in
|
||||
"on") distro="$(lsb_release -sir) [Windows 10]" ;;
|
||||
"tiny") distro="Windows 10" ;;
|
||||
|
@ -109,11 +109,13 @@ get_distro() {
|
|||
esac
|
||||
|
||||
# Workarounds for distros that go against the os-release standard.
|
||||
[[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease /usr/lib/*ease)"
|
||||
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/*ease /usr/lib/*ease)"
|
||||
[[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/os-release /usr/lib/os-release)"
|
||||
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/os-release /usr/lib/os-release)"
|
||||
|
||||
else
|
||||
distro="$(cat /etc/*-release)" # UUOC, but using usual bash $(< *-file) returns "ambiguous redirect"
|
||||
for release_file in /etc/*-release; do
|
||||
distro+="$(< "$release_file")"
|
||||
done
|
||||
if [[ -z "$distro" ]]; then
|
||||
case "$distro_shorthand" in
|
||||
"on" | "tiny") distro="$kernel_name" ;;
|
||||
|
|
Loading…
Reference in a new issue