diff --git a/README.md b/README.md index 686f4b78..6857f8de 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,7 @@ alias fetch2="fetch \ NOTE: You can supply multiple args. eg. 'fetch --disable cpu gpu disk shell' --osx_buildversion on/off Hide/Show Mac OS X build version. + --osx_codename on/off Hide/Show Mac OS X codename. --os_arch on/off Hide/Show Windows architecture. --speed_type type Change the type of cpu speed to display. Possible values: current, min, max, bios, diff --git a/config/config b/config/config index 0a261c8b..31d671cf 100644 --- a/config/config +++ b/config/config @@ -62,6 +62,10 @@ kernel_shorthand="on" # --osx_buildversion on/off osx_buildversion="on" +# Mac OS X hide/show codename +# --osx_codename on/off +osx_codename="on" + # Show 'x86_64' and 'x86' in 'Distro:' output. # --os_arch on/off os_arch="on" diff --git a/neofetch b/neofetch index c0908de2..3ad1c8c1 100755 --- a/neofetch +++ b/neofetch @@ -84,6 +84,10 @@ kernel_shorthand="on" # --osx_buildversion on/off osx_buildversion="on" +# Mac OS X hide/show codename +# --osx_codename on/off +osx_codename="on" + # Show 'x86_64' and 'x86' in 'Distro:' output. # --os_arch on/off os_arch="on" @@ -464,7 +468,21 @@ case "$os" in ;; "Mac OS X") - distro="Mac OS X $(sw_vers -productVersion)" + osx_version=$(sw_vers -productVersion) + + case "${osx_version%.*}" in + "10.4") codename="Mac OS X Tiger" ;; + "10.5") codename="Mac OS X Leopard" ;; + "10.6") codename="Mac OS X Snow Leopard" ;; + "10.7") codename="Mac OS X Lion" ;; + "10.8") codename="OS X Mountain Lion" ;; + "10.9") codename="OS X Mavericks" ;; + "10.10") codename="OS X Yosemite" ;; + "10.11") codename="OS X El Capitan" ;; + *) codename="Mac OS X" ;; + esac + distro="$codename $osx_version" + [ "$osx_buildversion" == "on" ] && distro+=" $(sw_vers -buildVersion)" ;; @@ -2209,8 +2227,9 @@ colors () { setcolors 4 8 ;; - "Mac"* | "Manjaro"* | "Deepin"*) + *"OS X"* ) setcolors 2 3 1 1 5 4 + ascii_distro="mac" ;; "OpenMandriva"*) @@ -2242,7 +2261,7 @@ colors () { setcolors 3 3 6 1 8 ;; - "OpenSuse"*) + "OpenSuse"* | "Manjaro"* | "Deepin"*) setcolors 2 7 ;; @@ -2448,6 +2467,7 @@ usage () { cat << EOF NOTE: You can supply multiple args. eg. 'neofetch --disable cpu gpu disk shell' --osx_buildversion on/off Hide/Show Mac OS X build version. + --osx_codename on/off Hide/Show Mac OS X codename. --os_arch on/off Hide/Show Windows architecture. --speed_type type Change the type of cpu speed to display. Possible values: current, min, max, bios, @@ -2569,6 +2589,7 @@ while [ "$1" ]; do # Info --os_arch) os_arch="$2" ;; --osx_buildversion) osx_buildversion="$2" ;; + --osx_codename) osx_codename="$2" ;; --speed_type) speed_type="$2" ;; --kernel_shorthand) kernel_shorthand="$2" ;; --uptime_shorthand) uptime_shorthand="$2" ;; @@ -2709,6 +2730,16 @@ done # }}} +# OS overides {{{ + +# Overide OS X codename +case "$osx_codename" in + "off") distro=${distro/${codename}/Mac OS X} ;; +esac + +# }}} + + # Call Functions and Finish Up {{{ @@ -2779,6 +2810,5 @@ if [ "$scrot" == "on" ]; then takescrot fi - # }}} diff --git a/neofetch.1 b/neofetch.1 index 99449f7c..af8716fc 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -22,6 +22,9 @@ NOTE: You can supply multiple args. eg. .B \--osx_buildversion 'on/off' Hide/Show Mac OS X build version. .TP +.B \--osx_codename 'on/off' +Hide/Show Mac OS X codename. +.TP .B \--os_arch 'on/off' Hide/Show Windows architecture. .TP