Skip to content

Instantly share code, notes, and snippets.

@itsthatguy
Created November 9, 2014 20:38
Show Gist options
  • Select an option

  • Save itsthatguy/ac5acb88dd97383d700f to your computer and use it in GitHub Desktop.

Select an option

Save itsthatguy/ac5acb88dd97383d700f to your computer and use it in GitHub Desktop.
easily clear mac font cache
#!/usr/bin/env bash
# Script to clear font cache
color() {
echo -e "\e[$1;38;5;$2m"
}
no_color() {
echo -e "\e[0m"
}
report() {
$* |
while IFS= read line
do
echo -e "$(color 0 7) > $line$no_color"
done
}
echo -e "$(color 0 1)Clearing font cache..."
report sudo atsutil databases -remove
echo -e "\n$(color 0 1)Restarting the ATS (Apple Type Solution) Server..."
report atsutil server -shutdown && report atsutil server -ping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment