Remove stdout mode

This commit is contained in:
Dylan Araps 2016-08-19 23:01:18 +10:00
parent 5148b1edfa
commit 4420a2cb38
5 changed files with 5 additions and 73 deletions

2
1.8.md
View file

@ -19,6 +19,8 @@
- See [trim()](https://github.com/dylanaraps/neofetch/commit/d3c87cdaacf1ea9fbf245146c910dc53b49dba08#diff-e863270127ca6116fd30e708cdc582fcR2789) - See [trim()](https://github.com/dylanaraps/neofetch/commit/d3c87cdaacf1ea9fbf245146c910dc53b49dba08#diff-e863270127ca6116fd30e708cdc582fcR2789)
- Only call `tput` when we really need to. - Only call `tput` when we really need to.
- Supress `getconfig` and `getscriptdir` errors. - Supress `getconfig` and `getscriptdir` errors.
- Removed `stdout` mode since it's been broken for a while now and I don't see the<br\>
point in fixing it.
- Fix issue when title and background were both color `7`. - Fix issue when title and background were both color `7`.
- Added `--version` to print the neofetch version. - Added `--version` to print the neofetch version.
- The title at the top is now much more colorful. - The title at the top is now much more colorful.

View file

@ -446,12 +446,6 @@ alias neofetch2="neofetch \
Supported distros: Arch, Gentoo, Crux, OpenBSD. Supported distros: Arch, Gentoo, Crux, OpenBSD.
--ascii_bold on/off Whether or not to bold the ascii logo. --ascii_bold on/off Whether or not to bold the ascii logo.
Stdout:
--stdout info info Launch neofetch in stdout mode which prints the info
in a plain-text format that you can use with
lemonbar etc.
--stdout_separator string String to use as a separator in stdout mode.
Screenshot: Screenshot:
--scrot /path/to/img Take a screenshot, if path is left empty the screen- --scrot /path/to/img Take a screenshot, if path is left empty the screen-
shot function will use \$scrot_dir and \$scrot_name. shot function will use \$scrot_dir and \$scrot_name.

View file

@ -396,14 +396,6 @@ scrot_dir="$HOME/Pictures/"
scrot_name="neofetch-$(date +%F-%T).png" scrot_name="neofetch-$(date +%F-%T).png"
# }}}
# Stdout options {{{
# Separator for stdout mode
# --stdout_separator string
stdout_separator=" "
# }}} # }}}
# Config Options {{{ # Config Options {{{

View file

@ -783,8 +783,6 @@ getcpu() {
esac esac
[ "$cpu" ] && prin "$subtitle" "$cpu" [ "$cpu" ] && prin "$subtitle" "$cpu"
[ "$stdout_mode" != "on" ] && unset cpu
} }
# }}} # }}}
@ -1135,7 +1133,7 @@ getsong() {
esac esac
# Display Artist and Title on seperate lines. # Display Artist and Title on seperate lines.
if [ "$song_shorthand" == "on" ] && [ "$stdout_mode" != "on" ]; then if [ "$song_shorthand" == "on" ]; then
artist="${song/ -*}" artist="${song/ -*}"
song="${song/$artist - }" song="${song/$artist - }"
@ -1537,7 +1535,7 @@ getbattery() {
title="$subtitle" title="$subtitle"
# If shorthand is on, print each value on the same line # If shorthand is on, print each value on the same line
if [ "$battery_shorthand" == "on" ] || [ "$stdout_mode" == "on" ]; then if [ "$battery_shorthand" == "on" ]; then
battery="${batteries[*]}" battery="${batteries[*]}"
battery="${battery// /%, }" battery="${battery// /%, }"
battery="${battery}%" battery="${battery}%"
@ -2226,34 +2224,6 @@ prin() {
# }}} # }}}
# Stdout {{{
stdout() {
# Read args early for the separator
stdout_separator_flag="$(awk -F '--stdout_separator ' '{printf $2}' <<< "${args[@]}")"
stdout_separator_flag="${stdout_separator_flag/ '--'*}"
[ "$stdout_separator_flag" ] && \
stdout_separator="$stdout_separator_flag"
for func in "${args[@]}"; do
case "$func" in
"--"*) break ;;
*)
"get$func" 2>/dev/null
eval output="\$$func"
output="$(trim "$output")"
stdout+="${output}${stdout_separator}"
;;
esac
done
printf "%s" "${stdout%%${stdout_separator}}"
exit
}
# }}}
# Underline {{{ # Underline {{{
getunderline() { getunderline() {
@ -2780,12 +2750,6 @@ usage() { cat << EOF
Supported distros: Arch, Gentoo, Crux, OpenBSD. Supported distros: Arch, Gentoo, Crux, OpenBSD.
--ascii_bold on/off Whether or not to bold the ascii logo. --ascii_bold on/off Whether or not to bold the ascii logo.
Stdout:
--stdout info info Launch neofetch in stdout mode which prints the info
in a plain-text format that you can use with
lemonbar etc.
--stdout_separator string String to use as a separator in stdout mode.
Screenshot: Screenshot:
--scrot /path/to/img Take a screenshot, if path is left empty the screen- --scrot /path/to/img Take a screenshot, if path is left empty the screen-
shot function will use \$scrot_dir and \$scrot_name. shot function will use \$scrot_dir and \$scrot_name.
@ -2813,7 +2777,7 @@ getargs() {
# Check the commandline flags early for '--config none/off' # Check the commandline flags early for '--config none/off'
case "$@" in case "$@" in
*"--config off"* | *'--config "off"'* | *"--config 'off'"* | \ *"--config off"* | *'--config "off"'* | *"--config 'off'"* | \
*"--config none"* | *'--config "none"'* | *"--config 'none'"* | *"--stdout"*) *"--config none"* | *'--config "none"'* | *"--config 'none'"*)
config="off" config="off"
;; ;;
@ -2951,17 +2915,6 @@ getargs() {
;; ;;
--scrot_cmd) scrot_cmd="$2" ;; --scrot_cmd) scrot_cmd="$2" ;;
# Stdout
--stdout)
unset info_color prin clear bar
stdout_mode="on"
config="off"
case "$2" in
"--"* | "") printf "%s\n" "--stdout requires at least one argument"; exit ;;
*) shift; args=("$@"); stdout ;;
esac
;;
# Other # Other
--config) --config)
case "$2" in case "$2" in

View file

@ -223,15 +223,6 @@ Possible values: small, normal
.B \--ascii_bold 'on/off' .B \--ascii_bold 'on/off'
Whether or not to bold the ascii logo. Whether or not to bold the ascii logo.
.SH STDOUT
.TP
.B \--stdout info info
Launch fetch in stdout mode which prints the info in
a plain-text format that you can use with lemonbar etc.
.TP
.B \--stdout_separator 'string'
String to use as a separator in stdout mode.
.SH SCREENSHOT .SH SCREENSHOT
.TP .TP
.B \--scrot 'path' .B \--scrot 'path'