From cbec0064b5061844a0b59801d18d26ff83477e57 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Sat, 18 Feb 2023 17:07:29 +0100 Subject: [PATCH] test-powerlines: Add more glyphs and colorize [why] The last missing powerline-extra glyphs should also be in this set. The intermediate line's color is not visible in some terminals. [note] Also fix that E0CF is shown twice. Signed-off-by: Fini Jastrow --- bin/scripts/test-powerlines.sh | 39 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/bin/scripts/test-powerlines.sh b/bin/scripts/test-powerlines.sh index 868d3ec4c..5dabbd15e 100755 --- a/bin/scripts/test-powerlines.sh +++ b/bin/scripts/test-powerlines.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Nerd Fonts Version: 2.3.3 -# Script Version: 1.2.0 +# Script Version: 1.3.0 # Give any parameter to allow some glyphs to be 2 'cells' wide. # This might or might not be how they are currently handled while patching @@ -8,35 +8,30 @@ text1='Testing' text2='Nerd Fonts' -leftSymbolsCodes=('E0B0' 'E0B4' 'E0B8' 'E0BC' 'E0C0' 'E0C4' 'E0C6' 'E0C8' 'E0CC' 'E0CE' 'E0CF' 'E0CF' 'E0D1' 'E0D2') -leftSymbols=('' '' '' '' '' '' '' '' '' '' '' '' '' '') -rightSymbolsCodes=('E0B2' 'E0B6' 'E0BA' 'E0BE' 'E0C2' 'E0C5' 'E0C7' 'E0CA' 'E0CC' 'E0CE' 'E0CF' 'E0CF' 'E0D1' 'E0D4') -rightSymbols=('' '' '' '' '' '' '' '' '' '' '' '' '' '') -isWide=(0 0 0 0 1 1 1 1 1 1 1 1 1 0) +leftSymbolsCodes=('E0B0' 'E0B4' 'E0B8' 'E0BC' 'E0C0' 'E0C4' 'E0C6' 'E0C8' 'E0CC' 'E0CD' 'E0CE' 'E0CF' 'E0D0' 'E0D1' 'E0D2') +leftSymbols=('' '' '' '' '' '' '' '' '' '' '' '' '' '' '') +rightSymbolsCodes=('E0B2' 'E0B6' 'E0BA' 'E0BE' 'E0C2' 'E0C5' 'E0C7' 'E0CA' 'E0CC' 'E0CD' 'E0CE' 'E0CF' 'E0D0' 'E0D1' 'E0D4') +rightSymbols=('' '' '' '' '' '' '' '' '' '' '' '' '' '' '') +isWide=(0 0 0 0 1 1 1 1 1 1 1 1 1 1 0) -# shellcheck disable=SC2034 -# don't check unused vars we might want to use them later on colorReset='\033[0m' colorBgWhite='\033[107m' -# shellcheck disable=SC2034 -# don't check unused vars we might want to use them later on -colorBgLightBlue='\033[104m' # light blue, bright green is 102 +colorBgLightBlue='\033[104m' +colorBgYellow='\033[103m' colorBgBlack='\033[40m' colorBg1='\033[100m' colorBg2=$colorBgBlack -# shellcheck disable=SC2034 -# don't check unused vars we might want to use them later on +colorBg3=$colorBgYellow + colorFgLightBlue='\033[94m' colorFgLightGray='\033[90m' -# shellcheck disable=SC2034 -# don't check unused vars we might want to use them later on colorFgLightYellow='\033[93m' colorFgBlack='\033[30m' colorFg1=$colorFgBlack colorFg2=$colorFgLightGray colorBgDefault='\033[49m' -echo -e "$colorReset Nerd Fonts :: Testing Powerline Symbol size and alignment" +echo -e "$colorReset Nerd Fonts :: Testing Powerline Symbol size and alignment$colorBg3\\n$colorReset" for i in "${!leftSymbolsCodes[@]}"; do pad=' ' @@ -58,8 +53,16 @@ for i in "${!leftSymbolsCodes[@]}"; do pad2=' ' fi - echo -e "$colorBg1$colorFg1$text1 $code $colorFg2$colorBg2$symbol$pad $text2 $pad$colorFg1$colorBgDefault$symbol -- $colorFg1$colorBgDefault$symbol2$colorFg2$colorBg2$pad2 $text2 $pad2$symbol2$colorBg1$colorFg1 $code2 $colorReset$colorBgWhite\\n$colorReset" + echo -e "$colorBg1$colorFg1$text1 $code $colorFg2$colorBg2$symbol$pad $text2 $pad$colorFg1$colorBgDefault$symbol -- $colorFg1$colorBgDefault$symbol2$colorFg2$colorBg2$pad2 $text2 $pad2$symbol2$colorBg1$colorFg1 $code2 $colorReset$colorBg3\\n$colorReset" done -printf "\\n" +viSymbolsCodes=('E0A0' 'E0A1' 'E0A2' 'E0A3') +viSymbols=('' '' '' '') + +for i in "${!viSymbolsCodes[@]}"; do + symbol=${viSymbols[$i]} + code="${viSymbolsCodes[$i]}" + printf "$colorBg1$colorFg1$text1 $code $colorFg1$colorBgDefault$symbol" +done +echo -e "$colorBg1$colorFg1$text2$colorReset$colorBg3\\n$colorReset"