Initial commit
This commit is contained in:
parent
ffecb33bef
commit
13c87a4423
60
GFontInstaller.sh
Normal file
60
GFontInstaller.sh
Normal file
@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
SCRIPTLOC=$FIXME
|
||||
|
||||
#Check for root
|
||||
if [[ $EUID -ne "0" ]]
|
||||
then
|
||||
echo "You must be root - try: sudo $0 or sudo bash $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Ask for user
|
||||
echo "Please enter the username for which you would like Google Fonts installed: "
|
||||
read username
|
||||
|
||||
#Ask for update frequency
|
||||
PS3="Please enter the frequency at which you would like the fonts updated (daily/weekly/monthly):"
|
||||
options=("Daily (Not Recommended)" "Weekly" "Monthly" "Quit")
|
||||
select opt in "${options[@]}"
|
||||
do
|
||||
case $opt in
|
||||
"Daily (Not Recommended)")
|
||||
updatefreq=daily
|
||||
;;
|
||||
"Weekly")
|
||||
updatefreq=weekly
|
||||
;;
|
||||
"Monthly")
|
||||
updatefreq=monthly
|
||||
;;
|
||||
"Quit")
|
||||
break
|
||||
;;
|
||||
*) echo "invalid option $REPLY";;
|
||||
esac
|
||||
done
|
||||
|
||||
#Setup directory in /opt and fetch script
|
||||
mkdir -p /opt/gfontinstallermac
|
||||
|
||||
wget -o $SCRIPTLOC /opt/gfontinstallermac/fontupdater.sh
|
||||
|
||||
chmod +x /opt/gfontinstallermac/fontupdater.sh
|
||||
|
||||
#Setup config file
|
||||
touch /opt/gfontinstallermac/config
|
||||
|
||||
echo "USER=$username" >> /opt/gfontinstallermac/config
|
||||
|
||||
#Run initial git clone
|
||||
pushd /Users/$username/Library/Fonts/
|
||||
git clone https://github.com/google/fonts.git google-fonts
|
||||
chown -R $username:staff google-fonts
|
||||
popd
|
||||
|
||||
#Setup auto-update
|
||||
mkdir -p /usr/local/etc/periodic/$updatefreq
|
||||
ln -sf /usr/local/etc/periodic/$updatefreq/fontupdater /opt/gfontinstallermac/fontupdater.sh
|
||||
|
||||
#Finished
|
||||
echo "Google Fonts installed in /Users/$username/Library/Fonts and set to update $updatefreq."
|
12
README.md
12
README.md
@ -1,3 +1,13 @@
|
||||
# GFontInstallerMac
|
||||
|
||||
Google Font installer and updater for Mac. Tested on Big Sur. Requires git to be installed.
|
||||
Google Font installer and updater for Mac. Tested on Big Sur. Requires git and wget to be installed.
|
||||
|
||||
## Installation
|
||||
* Download the latest `GFontInstaller.sh` script from the [releases page](https://gogs.tfmm.co/tfmm/GFontInstallerMac/releases)
|
||||
* Run script as root: `sudo GFontInstaller.sh`
|
||||
* Follow Prompts
|
||||
|
||||
## Information
|
||||
You will be prompted for a frequency at which to update the fonts from the Google Git repository, I would recommend weekly at the most frequent, as daily just seems like a lot.
|
||||
|
||||
You will be prompted for which user to install the fonts, at this point in time they can only be installed for one user per machine.
|
8
fontupdater.sh
Normal file
8
fontupdater.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Source config file
|
||||
. ${PWD}/config
|
||||
|
||||
#Move to font directory
|
||||
cd /Users/$USER/Library/Fonts/google-fonts
|
||||
sudo -u $USER git pull
|
Loading…
Reference in New Issue
Block a user