git.lucas.co / fontpreview
git clone https://git.lucas.co/fontpreview.git

commit8fc1aa1454c9829234f0921ad05325d97ac569f8
parente3dca9319a
authorSiddharth Dushantha <[email protected]>
date2020-02-09 12:32
use better regex for awk, credits: @SmartFinn

the previous commit had a copy/paste mistake

 fontpreview | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fontpreview b/fontpreview
index 7e21128..eafbf38 100755
--- a/fontpreview
+++ b/fontpreview
@@ -98,7 +98,7 @@ main(){
     while true; do
         # List out all the fonts which imagemagick is able to find, extract
         # the font names and then pass them to fzf
-        font=$(convert -list font | awk -F: '/^\s *Font: /{print substr($NF,2)}' | fzf --prompt="$SEARCH_PROMPT")
+        font=$(convert -list font | awk -F: '/^[ ]*Font: /{print substr($NF,2)}' | fzf --prompt="$SEARCH_PROMPT")
 
         # Exit if nothing is returned by fzf, which also means that the user
         # has pressed [ESCAPE]