Better OS detection and distro detection
This commit is contained in:
parent
ffab8e2f75
commit
90447980bd
17
neofetch
17
neofetch
|
@ -447,13 +447,12 @@ shopt -s nocasematch extglob
|
||||||
|
|
||||||
# Operating System {{{
|
# Operating System {{{
|
||||||
|
|
||||||
case "$(uname -sm)" in
|
case "$(uname)" in
|
||||||
"Linux"*) os="Linux" ;;
|
"Linux") os="Linux" ;;
|
||||||
*"iPhone"* | *"iPad"* | *"iPod"*) os="iOS" ;;
|
"Darwin") os="$(sw_vers -productName)" ;;
|
||||||
"Darwin"*) os="Mac OS X" ;;
|
"OpenBSD") os="OpenBSD" ;;
|
||||||
"OpenBSD"*) os="OpenBSD" ;;
|
*"BSD") os="BSD" ;;
|
||||||
"FreeBSD"* | "NetBSD"*) os="BSD" ;;
|
"CYGWIN"*) os="Windows" ;;
|
||||||
"CYGWIN"*) os="Windows" ;;
|
|
||||||
*) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;;
|
*) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -501,6 +500,10 @@ getdistro () {
|
||||||
distro="$codename $osx_version $osx_build"
|
distro="$codename $osx_version $osx_build"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"iPhone OS")
|
||||||
|
distro="iOS $(sw_vers -productVersion)"
|
||||||
|
;;
|
||||||
|
|
||||||
"OpenBSD")
|
"OpenBSD")
|
||||||
distro="OpenBSD"
|
distro="OpenBSD"
|
||||||
;;
|
;;
|
||||||
|
|
Reference in New Issue