From fe6588d8b6bfedc0763da6cddc2df89282629dc6 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Fri, 14 Oct 2016 19:09:57 +0700 Subject: [PATCH] Expanded distro_shorthand to Solaris --- README.md | 2 +- config/config | 2 +- neofetch | 7 +++++-- neofetch.1 | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7c7555dc..41e7702b 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,7 @@ alias neofetch2="neofetch \ Possible values: name, speed, tiny, on, off --cpu_cores on/off Whether or not to display the number of CPU cores --distro_shorthand on/off Shorten the output of distro (tiny, on, off) - NOTE: This is only possible on Linux and Mac OS X + NOTE: This is only possible on Linux, Mac OS X, and Solaris --kernel_shorthand on/off Shorten the output of kernel --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --refresh_rate on/off Whether to display the refresh rate of each monitor diff --git a/config/config b/config/config index 066dec4a..89199832 100644 --- a/config/config +++ b/config/config @@ -62,7 +62,7 @@ kernel_shorthand="on" # Distro # Shorten the output of distro (tiny, on, off) -# NOTE: This is only possible on Linux and Mac OS X +# NOTE: This is only possible on Linux, Mac OS X, and Solaris distro_shorthand="off" # Show 'x86_64' and 'x86' in 'Distro:' output. diff --git a/neofetch b/neofetch index 3a7ebf83..16b96b26 100755 --- a/neofetch +++ b/neofetch @@ -231,7 +231,10 @@ getdistro() { ;; "Solaris") - distro="$(awk 'NR==1{print $1 " " $2;}' /etc/release)" + case "$distro_shorthand" in + "on" | "tiny") distro="$(awk 'NR==1{print $1 " " $2;}' /etc/release)" ;; + *) distro="$(awk 'NR==1{print $1 " " $2 " " $3;}' /etc/release)" ;; + esac ;; esac @@ -2901,7 +2904,7 @@ usage() { cat << EOF Possible values: name, speed, tiny, on, off --cpu_cores on/off Whether or not to display the number of CPU cores --distro_shorthand on/off Shorten the output of distro (tiny, on, off) - NOTE: This is only possible on Linux and Mac OS X + NOTE: This is only possible on Linux, Mac OS X, and Solaris --kernel_shorthand on/off Shorten the output of kernel --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --refresh_rate on/off Whether to display the refresh rate of each monitor diff --git a/neofetch.1 b/neofetch.1 index d294ccd5..986fb72c 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -41,7 +41,7 @@ Whether or not to display the number of CPU cores .B \--distro_shorthand 'on/off' Shorten the output of distro (tiny, on, off) .br -NOTE: This is only possible on Linux and Mac OS X +NOTE: This is only possible on Linux, Mac OS X, and Solaris .TP .B \--kernel_shorthand 'on/off' Shorten the output of kernel