Misc: Reimplement stdout
This commit is contained in:
parent
e9f6ffc2d9
commit
04c22a8edd
18
neofetch
18
neofetch
|
@ -3636,6 +3636,20 @@ color() {
|
|||
|
||||
# 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+="$(color 1)[!]\033[0m $1\n"
|
||||
}
|
||||
|
@ -4401,6 +4415,7 @@ get_args() {
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
"--stdout") stdout="on" ;;
|
||||
"-v") verbose="on" ;;
|
||||
"-vv") set -x; verbose="on" ;;
|
||||
"--help") usage ;;
|
||||
|
@ -4421,9 +4436,10 @@ main() {
|
|||
get_distro
|
||||
get_bold
|
||||
get_distro_colors
|
||||
[[ "$stdout" == "on" ]] && stdout
|
||||
|
||||
# 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.
|
||||
trap 'printf "\033[?25h\033[?7h"' EXIT
|
||||
|
||||
|
|
Reference in New Issue