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
04c22a8e
Commit
04c22a8e
authored
Aug 03, 2017
by
Muhammad Herdiansyah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc: Reimplement stdout
parent
e9f6ffc2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
neofetch
neofetch
+19
-3
No files found.
neofetch
View file @
04c22a8e
...
@@ -2801,7 +2801,7 @@ prin() {
...
@@ -2801,7 +2801,7 @@ prin() {
string="${subtitle_color}${bold}${string}"
string="${subtitle_color}${bold}${string}"
# Print the info.
# Print the info.
printf "%b\n" "${text_padding:+\033[${text_padding}C}${zws}${string}${reset}
"
printf "%b\n" "${text_padding:+\033[${text_padding}C}${zws}${string}${reset}"
# Calculate info height.
# Calculate info height.
((++info_height))
((++info_height))
...
@@ -2813,7 +2813,7 @@ prin() {
...
@@ -2813,7 +2813,7 @@ prin() {
get_underline() {
get_underline() {
if [[ "$underline_enabled" == "on" ]]; then
if [[ "$underline_enabled" == "on" ]]; then
printf -v underline "%${length}s"
printf -v underline "%${length}s"
printf "%b\n" "${text_padding:+\033[${text_padding}C}${zws}${underline_color}${underline// /$underline_char}${reset}
"
printf "%b\n" "${text_padding:+\033[${text_padding}C}${zws}${underline_color}${underline// /$underline_char}${reset}"
unset -v length
unset -v length
fi
fi
prin=1
prin=1
...
@@ -3636,6 +3636,20 @@ color() {
...
@@ -3636,6 +3636,20 @@ color() {
# OTHER
# OTHER
stdout() {
image_backend="
off
"
unset subtitle_color
unset colon_color
unset info_color
unset underline_color
unset bold
unset title_color
unset at_color
unset text_padding
unset zws
unset reset
}
err() {
err() {
err+="
$(
color 1
)
[!]
\0
33[0m
$1
\n
"
err+="
$(
color 1
)
[!]
\0
33[0m
$1
\n
"
}
}
...
@@ -4401,6 +4415,7 @@ get_args() {
...
@@ -4401,6 +4415,7 @@ get_args() {
;;
;;
esac
esac
;;
;;
"--stdout"
)
stdout
=
"on"
;;
"-v"
)
verbose
=
"on"
;;
"-v"
)
verbose
=
"on"
;;
"-vv"
)
set
-x
;
verbose
=
"on"
;;
"-vv"
)
set
-x
;
verbose
=
"on"
;;
"--help"
)
usage
;;
"--help"
)
usage
;;
...
@@ -4421,9 +4436,10 @@ main() {
...
@@ -4421,9 +4436,10 @@ main() {
get_distro
get_distro
get_bold
get_bold
get_distro_colors
get_distro_colors
[[
"
$stdout
"
==
"on"
]]
&&
stdout
# Minix doesn't support these sequences.
# Minix doesn't support these sequences.
if
[[
"
$TERM
"
!=
"minix"
]]
;
then
if
[[
"
$TERM
"
!=
"minix"
&&
"
$stdout
"
!=
"on"
]]
;
then
# If the script exits for any reason, unhide the cursor.
# If the script exits for any reason, unhide the cursor.
trap
'printf "\033[?25h\033[?7h"'
EXIT
trap
'printf "\033[?25h\033[?7h"'
EXIT
...
...
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