Clearing The Noto Font Clutter

The Noto (“No Tofu”) font family includes nearly All. The. Languages., which is certainly a noble goal, but I’m just not ever going to need fonts like these:

./NotoSerifTelugu-Regular.ttf
./NotoSansBengali-Bold.ttf
./NotoSansGurmukhiUI-Bold.ttf
./NotoSansGurmukhi-Bold.ttf
./NotoSerifTamil-Regular.ttf
./NotoSansOriyaUI-Bold.ttf
./NotoSerifSinhala-Regular.ttf
./NotoSerifSinhala-Bold.ttf
./NotoSerifMalayalam-Bold.ttf
./NotoSansTelugu-Bold.ttf
./NotoSansAvestan-Regular.ttf
… and so forth and so on …

A bit of searching & listing identified the few I might ever use, so armor those against the coming catastrophe:

cd /usr/share/fonts/truetype/noto/
sudo chmod a-w NotoMono-Regular.ttf
sudo chmod a-w NotoSans-Bold*
sudo chmod a-w NotoSansDisplay-*
sudo chmod a-w NotoSans-Italic.ttf
sudo chmod a-w NotoSansGothic-Regular.ttf
sudo chmod a-w NotoSansMono-*
sudo chmod a-w NotoSans-Regular.ttf 
sudo chmod a-w NotoSansSymbols-*
sudo chmod a-w NotoSerif-Bold*
sudo chmod a-w NotoSerifDisplay-*
sudo chmod a-w NotoSerif-Italic.ttf 
sudo chmod a-w NotoSerif-Regular.ttf

There seems no regex-ish way of picking those out; next time, I’ll recycle the list as a script.

With armor in place, remove the rest:

find . -perm -u=w -type f -exec sudo rm '{}' \;

Rebuild the font caches:

sudo fc-cache -v -f

Maybe do such things near the end of the day, when you’re going to shut down anyway, because you’ll want to restart any programs using fonts in any nontrivial way.

Making the desired fonts read-only may confuse the next update involving the Noto fonts, but this setup (Xubuntu 18.04 LTS) is getting old and maybe something else will happen when I get around to installing a whole new release.