Created
February 22, 2021 17:45
-
-
Save wesleyit/e84aceed0253a79827d5e9a601e00b07 to your computer and use it in GitHub Desktop.
Fixes the name of all TTF files in the current folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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