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