-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·36 lines (28 loc) · 1021 Bytes
/
install.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
30
31
32
33
34
35
36
#!/bin/sh
# Script adopted from powerline/fonts
# https://github.com/powerline/fonts/blob/master/install.sh
# Clone chrissimpkins/codeface
git clone https://github.com/chrissimpkins/codeface.git
# Set source and target directories
codeface_fonts_dir="$( cd "$( dirname "$0" )/codeface/fonts" && pwd )"
if test "$(uname)" = "Darwin" ; then
# MacOS
fonts_dir="$HOME/Library/Fonts"
else
# Linux
fonts_dir="$HOME/.local/share/fonts"
mkdir -p $fonts_dir
fi
# Copy all fonts to user fonts directory
echo "Copying fonts..."
find "$codeface_fonts_dir" \( -name "*.[ot]tf" -or -name "*.pcf.gz" \) -type f -print0 | xargs -0 -n1 -I % cp "%" "$fonts_dir/"
if test "$(uname)" = "Darwin" ; then
# Copy SF Mono for MacOS
cp /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/*.otf "$fonts_dir/"
fi
# Reset font cache on Linux
if which fc-cache >/dev/null 2>&1 ; then
echo "Resetting font cache, this may take a moment..."
fc-cache -f "$fonts_dir"
fi
echo "shifty fonts installed to $fonts_dir"