Skip to content

Instantly share code, notes, and snippets.

@wesleyit
Created February 22, 2021 17:45
Show Gist options
  • Save wesleyit/e84aceed0253a79827d5e9a601e00b07 to your computer and use it in GitHub Desktop.
Save wesleyit/e84aceed0253a79827d5e9a601e00b07 to your computer and use it in GitHub Desktop.
Fixes the name of all TTF files in the current folder
#!/bin/bash
for font in *.ttf
do
new_name=$(
fc-query "$font" |
grep 'fullname:' |
cut -d '"' -f 2 |
tr ' ' '_'
).ttf
echo "Old name: $font"
echo "New name: $new_name"
mv "$font" "$new_name"
echo ---
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment