From 008f73b3abeab161bc1d0288fb49caf00edcd7f9 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 5 Feb 2016 18:16:46 +1100 Subject: [PATCH 1/4] You can now print info without a subtitle! eg. "info memory" --- fetch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fetch b/fetch index c2ec6e45..f89b94ea 100755 --- a/fetch +++ b/fetch @@ -1784,10 +1784,6 @@ info () { string="${underline_color}${output}" ;; - linebreak | cols) - string="" - ;; - *) string="${bold}${subtitle_color}${subtitle}${clear}" string+="${colon_color}: ${info_color}${output}" @@ -1795,6 +1791,9 @@ info () { ;; esac + # If there's no subtitle don't print one + [ -z "$2" ] && string=${string/*: } + # Print the string printf "%b%s\n" "${padding}${string}${clear}" } From 517ae06c007f98cd818fcc0a7cd76dcae0fd380b Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 5 Feb 2016 18:19:24 +1100 Subject: [PATCH 2/4] Changelog --- 1.1.md | 1 + 1 file changed, 1 insertion(+) diff --git a/1.1.md b/1.1.md index e9059818..b6bc0d81 100644 --- a/1.1.md +++ b/1.1.md @@ -71,6 +71,7 @@ the distro ascii art and the automatic config creation. ### Info +- You can now display info without a subtitle. eg. `info memory` - Added `--disable` which allows you to stop an info line from appearing at launch.
```sh From 941c5560125e4e929e506c5d91e65e70667465e1 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 5 Feb 2016 22:08:32 +1100 Subject: [PATCH 3/4] Fixed doubled battery usage Windows --- fetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch b/fetch index f89b94ea..2b9e1b0c 100755 --- a/fetch +++ b/fetch @@ -1242,8 +1242,8 @@ getbattery () { battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining /value)" battery=${battery/EstimatedChargeRemaining'='} battery=${battery//[[:space:]]/ } - battery=${battery// } - battery+="${battery}%" + battery=${battery// } + battery+="%" ;; esac } From a80d50b0fff3ddab08c49da0b3a19da426cd07ad Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 6 Feb 2016 10:25:12 +1100 Subject: [PATCH 4/4] Added '--underline on/off' and '' to toggle it --- config/config | 4 ++++ fetch | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/config b/config/config index 5e22fc4b..1f6edb90 100644 --- a/config/config +++ b/config/config @@ -196,6 +196,10 @@ line_wrap="on" # --bold on/off bold="on" +# Enable/Disable Underline +# --underline on/off +underline="on" + # Underline character # --underline_char char underline_char="-" diff --git a/fetch b/fetch index 2b9e1b0c..e905a5b3 100755 --- a/fetch +++ b/fetch @@ -216,6 +216,10 @@ line_wrap="on" # --bold on/off bold="on" +# Enable/Disable Underline +# --underline on/off +underline="on" + # Underline character # --underline_char char underline_char="-" @@ -1827,8 +1831,13 @@ prin () { # Underline {{{ getunderline () { - underline=$(printf %"$length"s) - underline=${underline// /$underline_char} + case "$underline" in + "on") + underline=$(printf %"$length"s) + underline=${underline// /$underline_char} + ;; + "off") underline="" ;; + esac } # }}} @@ -2087,6 +2096,7 @@ while [ "$1" ]; do --info_color) info_color=$2 ;; # Text Formatting + --underline) underline="$2" ;; --underline_char) underline_char="$2" ;; --line_wrap) line_wrap="$2" ;; --bold) bold="$2" ;;