Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
a1b7c787
Commit
a1b7c787
authored
Oct 15, 2016
by
Dylan Araps
Committed by
GitHub
Oct 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #361 from konimex/mac_shorthand
Expanded distro_shorthand to Mac OS X and Solaris
parents
4d9ac5c1
710fd498
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
31 deletions
+32
-31
README.md
README.md
+1
-3
config
config/config
+1
-9
neofetch
neofetch
+29
-12
neofetch.1
neofetch.1
+1
-7
No files found.
README.md
View file @
a1b7c787
...
@@ -357,8 +357,6 @@ alias neofetch2="neofetch \
...
@@ -357,8 +357,6 @@ alias neofetch2="neofetch \
in the output.
in the output.
NOTE: You can supply multiple args. eg.
NOTE: You can supply multiple args. eg.
'neofetch --disable cpu gpu disk shell'
'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 OS architecture.
--os_arch on/off Hide/Show OS architecture.
--speed_type type Change the type of cpu speed to display.
--speed_type type Change the type of cpu speed to display.
Possible values: current, min, max, bios,
Possible values: current, min, max, bios,
...
@@ -368,7 +366,7 @@ alias neofetch2="neofetch \
...
@@ -368,7 +366,7 @@ alias neofetch2="neofetch \
Possible values: name, speed, tiny, on, off
Possible values: name, speed, tiny, on, off
--cpu_cores on/off Whether or not to display the number of CPU cores
--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)
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
NOTE: This is only possible on Linux
NOTE: This is only possible on Linux
, Mac OS X, and Solaris
--kernel_shorthand on/off Shorten the output of kernel
--kernel_shorthand on/off Shorten the output of kernel
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--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
--refresh_rate on/off Whether to display the refresh rate of each monitor
...
...
config/config
View file @
a1b7c787
...
@@ -62,17 +62,9 @@ kernel_shorthand="on"
...
@@ -62,17 +62,9 @@ kernel_shorthand="on"
# Distro
# Distro
# Shorten the output of distro (tiny, on, off)
# Shorten the output of distro (tiny, on, off)
# NOTE: This is only possible on Linux
# NOTE: This is only possible on Linux
, Mac OS X, and Solaris
distro_shorthand
=
"off"
distro_shorthand
=
"off"
# Mac OS X hide/show build version
# --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.
# Show 'x86_64' and 'x86' in 'Distro:' output.
# --os_arch on/off
# --os_arch on/off
os_arch
=
"on"
os_arch
=
"on"
...
...
neofetch
View file @
a1b7c787
...
@@ -188,6 +188,20 @@ getdistro() {
...
@@ -188,6 +188,20 @@ getdistro() {
*) codename="Mac OS X" ;;
*) codename="Mac OS X" ;;
esac
esac
distro="$codename $osx_version $osx_build"
distro="$codename $osx_version $osx_build"
case "$distro_shorthand" in
"on") distro="${distro/ ${osx_build}}" ;;
"tiny")
case "$osx_version" in
"10.4"*|"10.5"*|"10.6"*|"10.7"*)
distro="${distro/${codename}/Mac OS X}" ;;
"10.8"*|"10.9"*|"10.10"*|"10.11"*)
distro="${distro/${codename}/OS X}" ;;
"10.12"*)
distro="${distro/${codename}/macOS}" ;;
esac
distro="${distro/ ${osx_build}}" ;;
esac
;;
;;
"iPhone OS")
"iPhone OS")
...
@@ -217,7 +231,10 @@ getdistro() {
...
@@ -217,7 +231,10 @@ getdistro() {
;;
;;
"Solaris"
)
"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
esac
...
@@ -225,12 +242,6 @@ getdistro() {
...
@@ -225,12 +242,6 @@ getdistro() {
[
"
$os_arch
"
==
"on"
] && \
[
"
$os_arch
"
==
"on"
] && \
distro+=
"
$(
uname
-m
)
"
distro+=
"
$(
uname
-m
)
"
[
"
$osx_codename
"
==
"off"
] && \
distro=
"
${
distro
/
${
codename
}
/Mac OS X
}
"
[
"
$osx_buildversion
"
==
"off"
] && \
distro=
"
${
distro
/
${
osx_build
}}
"
[
"
${
ascii_distro
:-
auto
}
"
==
"auto"
] && \
[
"
${
ascii_distro
:-
auto
}
"
==
"auto"
] && \
ascii_distro=
"
$(
trim
"
$distro
"
)
"
ascii_distro=
"
$(
trim
"
$distro
"
)
"
}
}
...
@@ -2692,6 +2703,15 @@ err() {
...
@@ -2692,6 +2703,15 @@ err() {
# }}}
# }}}
# Check for old flags {{{
checkoldflags() {
[ -n "
$osx_buildversion
" ] && err "
\$
osx_buildversion is deprecated, use
\$
distro_shorthand instead.
"
[ -n "
$osx_codename
" ] && err "
\$
osx_codename is deprecated, use
\$
distro_shorthand instead.
"
}
# }}}
# Get script directory {{{
# Get script directory {{{
getscriptdir() {
getscriptdir() {
...
@@ -2884,8 +2904,6 @@ usage() { cat << EOF
...
@@ -2884,8 +2904,6 @@ usage() { cat << EOF
in the output.
in the output.
NOTE: You can supply multiple args. eg.
NOTE: You can supply multiple args. eg.
'neofetch --disable cpu gpu disk shell'
'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 OS architecture.
--os_arch on/off Hide/Show OS architecture.
--speed_type type Change the type of cpu speed to display.
--speed_type type Change the type of cpu speed to display.
Possible values: current, min, max, bios,
Possible values: current, min, max, bios,
...
@@ -2895,7 +2913,7 @@ usage() { cat << EOF
...
@@ -2895,7 +2913,7 @@ usage() { cat << EOF
Possible values: name, speed, tiny, on, off
Possible values: name, speed, tiny, on, off
--cpu_cores on/off Whether or not to display the number of CPU cores
--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)
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
NOTE: This is only possible on Linux
NOTE: This is only possible on Linux
, Mac OS X, and Solaris
--kernel_shorthand on/off Shorten the output of kernel
--kernel_shorthand on/off Shorten the output of kernel
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--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
--refresh_rate on/off Whether to display the refresh rate of each monitor
...
@@ -3018,8 +3036,6 @@ getargs() {
...
@@ -3018,8 +3036,6 @@ getargs() {
case
$1
in
case
$1
in
# Info
# Info
--os_arch
)
os_arch
=
"
$2
"
;;
--os_arch
)
os_arch
=
"
$2
"
;;
--osx_buildversion
)
osx_buildversion
=
"
$2
"
;;
--osx_codename
)
osx_codename
=
"
$2
"
;;
--cpu_cores
)
cpu_cores
=
"
$2
"
;;
--cpu_cores
)
cpu_cores
=
"
$2
"
;;
--speed_type
)
speed_type
=
"
$2
"
;;
--speed_type
)
speed_type
=
"
$2
"
;;
--distro_shorthand
)
distro_shorthand
=
"
$2
"
;;
--distro_shorthand
)
distro_shorthand
=
"
$2
"
;;
...
@@ -3201,6 +3217,7 @@ getargs() {
...
@@ -3201,6 +3217,7 @@ getargs() {
main
()
{
main
()
{
getos
getos
getdefaultconfig 2>/dev/null
getdefaultconfig 2>/dev/null
checkoldflags
getargs
"
$@
"
getargs
"
$@
"
getdistro
getdistro
...
...
neofetch.1
View file @
a1b7c787
...
@@ -19,12 +19,6 @@ NOTE: You can supply multiple args. eg.
...
@@ -19,12 +19,6 @@ NOTE: You can supply multiple args. eg.
.br
.br
\'neofetch --disable cpu gpu disk shell\'
\'neofetch --disable cpu gpu disk shell\'
.TP
.TP
.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'
.B \--os_arch 'on/off'
Hide/Show OS architecture.
Hide/Show OS architecture.
.TP
.TP
...
@@ -47,7 +41,7 @@ Whether or not to display the number of CPU cores
...
@@ -47,7 +41,7 @@ Whether or not to display the number of CPU cores
.B \--distro_shorthand 'on/off'
.B \--distro_shorthand 'on/off'
Shorten the output of distro (tiny, on, off)
Shorten the output of distro (tiny, on, off)
.br
.br
NOTE: This is only possible on Linux
NOTE: This is only possible on Linux
, Mac OS X, and Solaris
.TP
.TP
.B \--kernel_shorthand 'on/off'
.B \--kernel_shorthand 'on/off'
Shorten the output of kernel
Shorten the output of kernel
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment