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
af6230f0
Unverified
Commit
af6230f0
authored
Jan 07, 2019
by
Dylan Araps
Committed by
GitHub
Jan 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1152 from dylanaraps/simple
Added new simple mode for script usage
parents
8aab756a
7e96b428
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
14 deletions
+54
-14
neofetch
neofetch
+35
-13
neofetch.1
neofetch.1
+19
-1
No files found.
neofetch
View file @
af6230f0
...
@@ -4047,18 +4047,9 @@ color() {
...
@@ -4047,18 +4047,9 @@ color() {
stdout() {
stdout() {
image_backend="off"
image_backend="off"
unset subtitle_color
unset subtitle_color colon_color info_color underline_color bold title_color at_color \
unset colon_color
text_padding zws reset color_blocks get_line_break bar_color_elapsed bar_color_total \
unset info_color
c1 c2 c3 c4 c5 c6 c7 c8
unset underline_color
unset bold
unset title_color
unset at_color
unset text_padding
unset zws
unset reset
unset color_blocks
unset get_line_break
}
}
err() {
err() {
...
@@ -4256,7 +4247,7 @@ decode_url() {
...
@@ -4256,7 +4247,7 @@ decode_url() {
# FINISH UP
# FINISH UP
usage() { printf "%s" "\
usage() { printf "%s" "\
Usage: neofetch --option \"value\" --option \"value\"
Usage: neofetch
func_name
--option \"value\" --option \"value\"
Neofetch is a CLI system information tool written in BASH. Neofetch
Neofetch is a CLI system information tool written in BASH. Neofetch
displays information about your system next to an image, your OS logo,
displays information about your system next to an image, your OS logo,
...
@@ -4267,6 +4258,23 @@ NOTE: Every launch flag has a config option.
...
@@ -4267,6 +4258,23 @@ NOTE: Every launch flag has a config option.
Options:
Options:
INFO:
INFO:
func_name Specify a function name (second part of info() from config) to
quickly display only that function's information.
Example: neofetch uptime --uptime_shorthand tiny
Example: neofetch uptime disk wm memory
This can be used in bars and scripts like so:
memory=\"\$(neofetch memory)\"; memory=\"\${memory##*: }\"
For multiple outputs at once (each line of info in an array):
IFS=\$'\\n' read -d \"\" -ra info < <(neofetch memory uptime wm)
info=(\"\${info[@]##*: }\")
--disable infoname Allows you to disable an info line from appearing
--disable infoname Allows you to disable an info line from appearing
in the output. 'infoname' is the function name from the
in the output. 'infoname' is the function name from the
'print_info()' function inside the config file.
'print_info()' function inside the config file.
...
@@ -4713,6 +4721,19 @@ get_args() {
...
@@ -4713,6 +4721,19 @@ get_args() {
done
done
}
}
get_simple() {
while [[ "$1" ]]; do
[[ $(type -t "get_$1") == function ]] && {
get_distro
stdout
simple=1
info "$1" "$1"
}
shift
done
((simple)) && exit
}
get_distro_ascii() {
get_distro_ascii() {
# This function gets the distro ascii art and colors.
# This function gets the distro ascii art and colors.
#
#
...
@@ -8710,6 +8731,7 @@ main() {
...
@@ -8710,6 +8731,7 @@ main() {
eval "$config"
eval "$config"
get_args "$@"
get_args "$@"
get_simple "$@"
[[ "$verbose" != "on" ]] && exec 2>/dev/null
[[ "$verbose" != "on" ]] && exec 2>/dev/null
get_distro
get_distro
get_bold
get_bold
...
...
neofetch.1
View file @
af6230f0
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
Neofetch \- A fast, highly customizable system info script
Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS
.SH SYNOPSIS
.B neofetch
.B neofetch
\fI\,--option "value" --option "value"\/\fR
\fI\,
func_name
--option "value" --option "value"\/\fR
.SH DESCRIPTION
.SH DESCRIPTION
Neofetch is a CLI system information tool written in BASH. Neofetch
Neofetch is a CLI system information tool written in BASH. Neofetch
displays information about your system next to an image, your OS logo,
displays information about your system next to an image, your OS logo,
...
@@ -14,6 +14,24 @@ NOTE: Every launch flag has a config option.
...
@@ -14,6 +14,24 @@ NOTE: Every launch flag has a config option.
.SH OPTIONS
.SH OPTIONS
.SS "INFO:"
.SS "INFO:"
.TP
.TP
func_name
Specify a function name (second part of info() from config) to
quickly display only that function's information.
.IP
Example: neofetch uptime \fB\-\-uptime_shorthand\fR tiny
.IP
Example: neofetch uptime disk wm memory
.IP
This can be used in bars and scripts like so:
.IP
memory="$(neofetch memory)"; memory="${memory##*: }"
.IP
For multiple outputs at once (each line of info in an array):
.IP
IFS=$'\en' read \fB\-d\fR "" \fB\-ra\fR info < <(neofetch memory uptime wm)
.IP
info=("${info[@]##*: }")
.TP
\fB\-\-disable\fR infoname
\fB\-\-disable\fR infoname
Allows you to disable an info line from appearing
Allows you to disable an info line from appearing
in the output. 'infoname' is the function name from the
in the output. 'infoname' is the function name from the
...
...
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