From 4420a2cb380c5153b1ee70a25e8df935d5e9ea73 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 19 Aug 2016 23:01:18 +1000 Subject: [PATCH] Remove stdout mode --- 1.8.md | 2 ++ README.md | 6 ------ config/config | 8 -------- neofetch | 53 +++------------------------------------------------ neofetch.1 | 9 --------- 5 files changed, 5 insertions(+), 73 deletions(-) diff --git a/1.8.md b/1.8.md index e104f79d..d513413a 100644 --- a/1.8.md +++ b/1.8.md @@ -19,6 +19,8 @@ - See [trim()](https://github.com/dylanaraps/neofetch/commit/d3c87cdaacf1ea9fbf245146c910dc53b49dba08#diff-e863270127ca6116fd30e708cdc582fcR2789) - Only call `tput` when we really need to. - Supress `getconfig` and `getscriptdir` errors. +- Removed `stdout` mode since it's been broken for a while now and I don't see the +point in fixing it. - Fix issue when title and background were both color `7`. - Added `--version` to print the neofetch version. - The title at the top is now much more colorful. diff --git a/README.md b/README.md index 2fa64ad6..c40526b5 100644 --- a/README.md +++ b/README.md @@ -446,12 +446,6 @@ alias neofetch2="neofetch \ Supported distros: Arch, Gentoo, Crux, OpenBSD. --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: --scrot /path/to/img Take a screenshot, if path is left empty the screen- shot function will use \$scrot_dir and \$scrot_name. diff --git a/config/config b/config/config index 2425557e..dc41e3a4 100644 --- a/config/config +++ b/config/config @@ -396,14 +396,6 @@ scrot_dir="$HOME/Pictures/" scrot_name="neofetch-$(date +%F-%T).png" -# }}} - -# Stdout options {{{ - -# Separator for stdout mode -# --stdout_separator string -stdout_separator=" " - # }}} # Config Options {{{ diff --git a/neofetch b/neofetch index ae22c880..c4f82f7b 100755 --- a/neofetch +++ b/neofetch @@ -783,8 +783,6 @@ getcpu() { esac [ "$cpu" ] && prin "$subtitle" "$cpu" - - [ "$stdout_mode" != "on" ] && unset cpu } # }}} @@ -1135,7 +1133,7 @@ getsong() { esac # Display Artist and Title on seperate lines. - if [ "$song_shorthand" == "on" ] && [ "$stdout_mode" != "on" ]; then + if [ "$song_shorthand" == "on" ]; then artist="${song/ -*}" song="${song/$artist - }" @@ -1537,7 +1535,7 @@ getbattery() { title="$subtitle" # 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="${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 {{{ getunderline() { @@ -2780,12 +2750,6 @@ usage() { cat << EOF Supported distros: Arch, Gentoo, Crux, OpenBSD. --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: --scrot /path/to/img Take a screenshot, if path is left empty the screen- shot function will use \$scrot_dir and \$scrot_name. @@ -2813,7 +2777,7 @@ getargs() { # Check the commandline flags early for '--config none/off' case "$@" in *"--config off"* | *'--config "off"'* | *"--config 'off'"* | \ - *"--config none"* | *'--config "none"'* | *"--config 'none'"* | *"--stdout"*) + *"--config none"* | *'--config "none"'* | *"--config 'none'"*) config="off" ;; @@ -2951,17 +2915,6 @@ getargs() { ;; --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 --config) case "$2" in diff --git a/neofetch.1 b/neofetch.1 index a456ba03..5808b945 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -223,15 +223,6 @@ Possible values: small, normal .B \--ascii_bold 'on/off' 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 .TP .B \--scrot 'path'