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
3a826e16
Commit
3a826e16
authored
Mar 02, 2016
by
Dylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the separator in stdout mode configurable with '--stdout_separator' and '$stdout_separator'
parent
dc54ca53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
config
config/config
+8
-0
neofetch
neofetch
+20
-2
No files found.
config/config
View file @
3a826e16
...
@@ -323,6 +323,14 @@ scrot_name="neofetch-%Y-%m-%d-%H:%M.png"
...
@@ -323,6 +323,14 @@ scrot_name="neofetch-%Y-%m-%d-%H:%M.png"
# }}}
# }}}
# Stdout options {{{
# Separator for stdout mode
# --stdout_separator string
stdout_separator
=
" "
# }}}
# Config Options {{{
# Config Options {{{
...
...
neofetch
View file @
3a826e16
...
@@ -344,6 +344,14 @@ scrot_name="neofetch-%Y-%m-%d-%H:%M.png"
...
@@ -344,6 +344,14 @@ scrot_name="neofetch-%Y-%m-%d-%H:%M.png"
# }}}
# }}}
# Stdout options {{{
# Separator for stdout mode
# --stdout_separator string
stdout_separator
=
" "
# }}}
# Config Options {{{
# Config Options {{{
...
@@ -1955,15 +1963,25 @@ prin () {
...
@@ -1955,15 +1963,25 @@ prin () {
# Stdout {{{
# Stdout {{{
stdout () {
stdout () {
stdout_separator_flag="$(awk -F '
--stdout_separator
' '
{printf
$2
}
' <<< "
${
args
[@]
}
")"
stdout_separator_flag=
${
stdout_separator_flag
/
'--'
*
}
[ ! -z
"
$stdout_separator_flag
"
] && \
stdout_separator=
"
$stdout_separator_flag
"
index=0
for func in
"
${
args
[@]
}
"
; do
for func in
"
${
args
[@]
}
"
; do
case
"
$func
"
in
case
"
$func
"
in
"--"
*) break ;;
"--"
*) break ;;
*)
*)
"get
$func
"
2>/dev/null
"get
$func
"
2>/dev/null
eval output=
"
\$
$func
"
eval output=
"
\$
$func
"
printf "%s" "$output "
case
"
${
args
[
$((
index
+
1
))
]
}
"
in
"--"
*) unset stdout_separator ;; esac
printf
"%s"
"
${
output
}${
stdout_separator
}
"
;;
;;
esac
esac
index=
$((
index
+
1
))
done
done
exit
exit
}
}
...
@@ -2447,7 +2465,7 @@ while [ "$1" ]; do
...
@@ -2447,7 +2465,7 @@ while [ "$1" ]; do
unset info_color colors
unset info_color colors
case "
$2
" in
case "
$2
" in
"
--
"* | "") echo "
--stdout
requires at least one argument
"; exit ;;
"
--
"* | "") echo "
--stdout
requires at least one argument
"; exit ;;
*) shift; args=("
$@
"); config="
off
" stdout ;;
*) shift; args=("
$@
"); config="
off
"
;
stdout ;;
esac
esac
;;
;;
...
...
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