From 43c439853ca5ca036b338a7b500cb7b3f61d2c96 Mon Sep 17 00:00:00 2001 From: xynxynxyn Date: Tue, 14 Aug 2018 03:48:53 +0200 Subject: [PATCH 1/4] make seperator changeable --- neofetch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 79a15c30..32707f20 100755 --- a/neofetch +++ b/neofetch @@ -3876,8 +3876,18 @@ prin() { length="${#length}" fi + # Make sure $sep is unset + unset -v sep + + # Check if $seperator is set + if [[ $seperator ]]; then + sep=$seperator + else + sep=":" + fi + # Format the output. - string="${string/:/${reset}${colon_color}:${info_color}}" + string="${string/:/${reset}${colon_color}${sep}${info_color}}" string="${subtitle_color}${bold}${string}" # Print the info. @@ -4498,6 +4508,7 @@ get_args() { "--underline") underline_enabled="$2" ;; "--underline_char") underline_char="$2" ;; "--bold") bold="$2" ;; + "--seperator") seperator="$2" ;; # Color Blocks "--color_blocks") color_blocks="$2" ;; From 9b29d3f669ac9f96e8fe618989c2264e7e656ea7 Mon Sep 17 00:00:00 2001 From: xynxynxyn Date: Thu, 16 Aug 2018 10:04:24 +0200 Subject: [PATCH 2/4] replace if statement with parameter expansion --- neofetch | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/neofetch b/neofetch index 32707f20..3566e1ae 100755 --- a/neofetch +++ b/neofetch @@ -3876,18 +3876,8 @@ prin() { length="${#length}" fi - # Make sure $sep is unset - unset -v sep - - # Check if $seperator is set - if [[ $seperator ]]; then - sep=$seperator - else - sep=":" - fi - # Format the output. - string="${string/:/${reset}${colon_color}${sep}${info_color}}" + string="${string/:/${reset}${colon_color}${separator:=:}${info_color}}" string="${subtitle_color}${bold}${string}" # Print the info. @@ -4508,7 +4498,7 @@ get_args() { "--underline") underline_enabled="$2" ;; "--underline_char") underline_char="$2" ;; "--bold") bold="$2" ;; - "--seperator") seperator="$2" ;; + "--separator") separator="$2" ;; # Color Blocks "--color_blocks") color_blocks="$2" ;; From 95a8ecfa71afc3d6109b3ee11fe342a5cd6c95d1 Mon Sep 17 00:00:00 2001 From: xynxynxyn Date: Thu, 18 Oct 2018 14:28:33 +0200 Subject: [PATCH 3/4] add documentation --- neofetch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/neofetch b/neofetch index 3566e1ae..5a84d660 100755 --- a/neofetch +++ b/neofetch @@ -482,6 +482,22 @@ song_shorthand="off" mpc_args=() +# Separator + + +# Modify separator +# +# Default: ':' +# Flag: --separator +# +# Replace the default separator with the specified string. +# +# Example: +# separator="->": 'Shell-> bash' +# separator=" =": `WM = dwm` +separator=":" + + # Text Colors @@ -4307,6 +4323,8 @@ INFO: --music_player player-name Manually specify a player to use. Available values are listed in the config file + --separator string Changes the default ':' separator to the specified string. + TEXT FORMATTING: --colors x x x x x x Changes the text colors in this order: title, @, underline, subtitle, colon, info From fc12e550521d6b0a8fbfb1c7c930566119b5b4d9 Mon Sep 17 00:00:00 2001 From: xynxynxyn Date: Thu, 18 Oct 2018 17:04:53 +0200 Subject: [PATCH 4/4] use correct apostrophe --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 5a84d660..598949c8 100755 --- a/neofetch +++ b/neofetch @@ -494,7 +494,7 @@ mpc_args=() # # Example: # separator="->": 'Shell-> bash' -# separator=" =": `WM = dwm` +# separator=" =": 'WM = dwm' separator=":"