Refactor fzf fontnames script
							parent
							
								
									8951c2e56b
								
							
						
					
					
						commit
						e9b0a6acd2
					
				| 
						 | 
					@ -11,11 +11,11 @@ update() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  font_list=$(fc-list -f "%{fullname}\n")
 | 
					  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)"
 | 
					    first="$(echo "$line" | cut -d',' -f1)"
 | 
				
			||||||
    last="$(echo "$line" | cut -d',' -f2)"
 | 
					    last="$(echo "$line" | cut -d',' -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if $(contains_dash "$first"); then
 | 
					    if "$(contains_dash "$first")"; then
 | 
				
			||||||
      echo "$last" >> "$fn"
 | 
					      echo "$last" >> "$fn"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      echo "$first" >> "$fn"
 | 
					      echo "$first" >> "$fn"
 | 
				
			||||||
| 
						 | 
					@ -25,5 +25,5 @@ update() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$1" in
 | 
					case "$1" in
 | 
				
			||||||
  --update) update;;
 | 
					  --update) update;;
 | 
				
			||||||
  *) cat "$fn" | sort | uniq | awk 'NF' | fzf;;
 | 
					  *) sort "$fn" | uniq | awk 'NF' | fzf;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue