mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 11:39:53 +00:00
Distro: Apply suggestion
This commit is contained in:
10
neofetch
10
neofetch
@@ -54,7 +54,7 @@ get_distro() {
|
|||||||
|
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "BSD" | "MINIX")
|
"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
|
case "$distro_shorthand" in
|
||||||
"on") distro="$(lsb_release -sir) [Windows 10]" ;;
|
"on") distro="$(lsb_release -sir) [Windows 10]" ;;
|
||||||
"tiny") distro="Windows 10" ;;
|
"tiny") distro="Windows 10" ;;
|
||||||
@@ -109,11 +109,13 @@ get_distro() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Workarounds for distros that go against the os-release standard.
|
# 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 '/BLAG/ {print $1; exit}' /etc/os-release /usr/lib/os-release)"
|
||||||
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/*ease /usr/lib/*ease)"
|
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/os-release /usr/lib/os-release)"
|
||||||
|
|
||||||
else
|
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
|
if [[ -z "$distro" ]]; then
|
||||||
case "$distro_shorthand" in
|
case "$distro_shorthand" in
|
||||||
"on" | "tiny") distro="$kernel_name" ;;
|
"on" | "tiny") distro="$kernel_name" ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user