2015-02-24 17:46:42 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Set source and target directories
|
|
|
|
powerline_fonts_dir="${PWD}/patched-fonts"
|
|
|
|
|
|
|
|
find_command="find \"$powerline_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0"
|
|
|
|
|
|
|
|
if [[ $(uname) == 'Darwin' ]]; then
|
|
|
|
# MacOS
|
|
|
|
font_dir="$HOME/Library/Fonts"
|
|
|
|
else
|
|
|
|
# Linux
|
2016-01-06 09:23:27 +02:00
|
|
|
font_dir="$HOME/.local/share/fonts"
|
2015-02-24 17:46:42 +02:00
|
|
|
mkdir -p "$font_dir"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Copy all fonts to user fonts directory
|
|
|
|
eval "$find_command" | xargs -0 -I % cp "%" "$font_dir/"
|
|
|
|
|
|
|
|
# Reset font cache on Linux
|
|
|
|
if [[ -n $(which fc-cache) ]]; then
|
|
|
|
fc-cache -f "$font_dir"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "All fonts installed to $font_dir"
|