Merge branch 'master' into 100
This commit is contained in:
commit
6ba15d6ef1
|
@ -8,6 +8,10 @@
|
||||||
|
|
||||||
- Config file now has a `.conf` suffix.
|
- Config file now has a `.conf` suffix.
|
||||||
- Neofetch now assumes target directories (config file and ASCII directory) at install time, this fixes problems with systems such as NixOS.
|
- Neofetch now assumes target directories (config file and ASCII directory) at install time, this fixes problems with systems such as NixOS.
|
||||||
|
- `stdout` mode is now reimplemented.
|
||||||
|
- This mode prints the information in plain text.
|
||||||
|
- You can use it with `--stdout`.
|
||||||
|
- Example: https://gist.github.com/dylanaraps/151c205322cf3acae62661b76464a3f7
|
||||||
|
|
||||||
|
|
||||||
## Operating System
|
## Operating System
|
||||||
|
@ -46,6 +50,10 @@
|
||||||
- Fixed inaccurate speed output in systems with CPU speed less than 1 GHz.
|
- Fixed inaccurate speed output in systems with CPU speed less than 1 GHz.
|
||||||
- Deprecated `cpu_shorthand` in favor of `cpu_brand`.
|
- Deprecated `cpu_shorthand` in favor of `cpu_brand`.
|
||||||
|
|
||||||
|
**GPU**
|
||||||
|
|
||||||
|
- [Linux] Filter out duplicate entries.
|
||||||
|
|
||||||
**Uptime**
|
**Uptime**
|
||||||
|
|
||||||
- [AIX/IRIX] Fixed Neofetch crashing when calculating uptime.
|
- [AIX/IRIX] Fixed Neofetch crashing when calculating uptime.
|
||||||
|
|
|
@ -717,6 +717,12 @@ image_host="teknik"
|
||||||
|
|
||||||
# Misc Options
|
# Misc Options
|
||||||
|
|
||||||
|
# Stdout mode
|
||||||
|
# Turn off all colors and disables image backend (ASCII/Image).
|
||||||
|
# Useful for piping into another command.
|
||||||
|
# Default: 'off'
|
||||||
|
# Values: 'on', 'off'
|
||||||
|
stdout="off"
|
||||||
|
|
||||||
# Config version.
|
# Config version.
|
||||||
#
|
#
|
||||||
|
|
29
neofetch
29
neofetch
|
@ -1153,7 +1153,9 @@ get_gpu() {
|
||||||
"Linux")
|
"Linux")
|
||||||
# Read GPUs into array.
|
# Read GPUs into array.
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}'))
|
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
|
||||||
|
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a)
|
||||||
|
{if(!seen[a[i]]++) print a[i]}}'))
|
||||||
IFS="$old_ifs"
|
IFS="$old_ifs"
|
||||||
|
|
||||||
# Number the GPUs if more than one exists.
|
# Number the GPUs if more than one exists.
|
||||||
|
@ -2934,7 +2936,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))
|
||||||
|
@ -2947,7 +2949,7 @@ get_underline() {
|
||||||
if [[ "$underline_enabled" == "on" ]]; then
|
if [[ "$underline_enabled" == "on" ]]; then
|
||||||
printf -v underline "%${length}s"
|
printf -v underline "%${length}s"
|
||||||
printf "%b%b\n" "${text_padding:+\033[${text_padding}C}${zws}${underline_color}" \
|
printf "%b%b\n" "${text_padding:+\033[${text_padding}C}${zws}${underline_color}" \
|
||||||
"${underline// /$underline_char}${reset} "
|
"${underline// /$underline_char}${reset}"
|
||||||
unset -v length
|
unset -v length
|
||||||
fi
|
fi
|
||||||
prin=1
|
prin=1
|
||||||
|
@ -3771,6 +3773,22 @@ 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
|
||||||
|
unset color_blocks
|
||||||
|
unset get_line_break
|
||||||
|
}
|
||||||
|
|
||||||
err() {
|
err() {
|
||||||
err+="$(color 1)[!]\033[0m $1\n"
|
err+="$(color 1)[!]\033[0m $1\n"
|
||||||
}
|
}
|
||||||
|
@ -4354,6 +4372,7 @@ SCREENSHOT:
|
||||||
OTHER:
|
OTHER:
|
||||||
--config /path/to/config Specify a path to a custom config file
|
--config /path/to/config Specify a path to a custom config file
|
||||||
--config none Launch the script without a config file
|
--config none Launch the script without a config file
|
||||||
|
--stdout Turn off all colors and disables any ASCII/image backend.
|
||||||
--help Print this text and exit
|
--help Print this text and exit
|
||||||
--version Show neofetch version
|
--version Show neofetch version
|
||||||
-v Display error messages.
|
-v Display error messages.
|
||||||
|
@ -4572,6 +4591,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 ;;
|
||||||
|
@ -4596,9 +4616,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
|
||||||
|
|
||||||
|
|
|
@ -313,6 +313,9 @@ Specify a path to a custom config file
|
||||||
\fB\-\-config\fR none
|
\fB\-\-config\fR none
|
||||||
Launch the script without a config file
|
Launch the script without a config file
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-stdout\fR
|
||||||
|
Turn off all colors and disables any ASCII/image backend.
|
||||||
|
.TP
|
||||||
\fB\-\-help\fR
|
\fB\-\-help\fR
|
||||||
Print this text and exit
|
Print this text and exit
|
||||||
.TP
|
.TP
|
||||||
|
|
Reference in New Issue