From e9b0a6acd2d04242655d0459b941f2845e8677c1 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Thu, 22 Sep 2022 20:42:26 +0200 Subject: [PATCH] Refactor fzf fontnames script --- .bin/fzf-fontnames | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bin/fzf-fontnames b/.bin/fzf-fontnames index 848ef06..bb21288 100755 --- a/.bin/fzf-fontnames +++ b/.bin/fzf-fontnames @@ -11,11 +11,11 @@ update() { font_list=$(fc-list -f "%{fullname}\n") - echo "$font_list" | while read line ; do + echo "$font_list" | while read -r line ; do first="$(echo "$line" | cut -d',' -f1)" last="$(echo "$line" | cut -d',' -f2)" - if $(contains_dash "$first"); then + if "$(contains_dash "$first")"; then echo "$last" >> "$fn" else echo "$first" >> "$fn" @@ -25,5 +25,5 @@ update() { case "$1" in --update) update;; - *) cat "$fn" | sort | uniq | awk 'NF' | fzf;; + *) sort "$fn" | uniq | awk 'NF' | fzf;; esac