1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

scripts/fontawesome: load icons from local file

This commit is contained in:
Joe Groocock 2019-12-14 22:17:49 +00:00
parent 00a83da619
commit 4c634c402a
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -28,9 +28,12 @@ function download() {
echo -n > "$FONTAWESOME_FILE"
curl https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/advanced-options/metadata/icons.json | \
jq '.[] | "\\u" + .unicode + "\t" + .label' -r | \
xargs -0 printf \
cat /usr/share/fontawesome/icons.json | \
jq -r --argfile ctgs <(yq r -j /usr/share/fontawesome/categories.yml) \
'.[] | . as $icon | "\\\\u" + .unicode + "\t" + .label + "\t" + ( ([.search.terms,.styles,([select($ctgs[].icons[]|index($icon.label))|.label]|unique)]|add)|sort|join(", "))' | \
while IFS=$'\t' read icon name labels; do \
printf "%b\t%-120s\t%s\n" "$icon" "$name" "$labels";\
done \
> "$FONTAWESOME_FILE"
notify "$(basename "$0")" "We're all set!"