forked from w0ng/googlefontdirectory
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathuninstall.sh
executable file
·29 lines (25 loc) · 955 Bytes
/
uninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#OS detect
osdetect=$(uname)
file_path="unknown"
if [[ "$osdetect" == 'Darwin' ]]; then
file_path="rm /Library/Fonts/"
elif [[ "$osdetect" == 'Linux' ]]; then
if [[ -d /usr/local/share/fonts/ ]]; then # Debian/Ubuntu and others.
file_path="sudo rm /usr/local/share/fonts/"
elif [[ -d /usr/share/fonts/ ]]; then # OpenSUSE, Arch and other distros using this directory structure
file_path="sudo rm /usr/share/fonts/google/"
else # Fallback to installing fonts locally to the user, this is a safe bet, as several distros use this location.
file_path="rm ~/.fonts/"
fi
fi
clear
echo "Un-Installing all Google Web Fonts onto your System"
echo "Downloading font list..."
cd /tmp/
curl -L https://raw.githubusercontent.com/qrpike/Web-Font-Load/master/list-of-fonts.txt -o list-of-fonts.txt
while read font; do
$file_path$font
done <list-of-fonts.txt
rm -rf list-of-fonts.txt
echo "All done! All Google Web Fonts removed."