diff --git a/README.rst b/README.rst index 84983c8..9eb103a 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,16 @@ Powerline fonts This repository contains pre-patched and adjusted fonts for usage with the new Powerline plugin. +Installation +------------ + +Run ``./install.sh`` to install all Powerline Fonts or see the documentation_ for details. + +.. _documentation: https://powerline.readthedocs.org/en/latest/installation/linux.html#font-installation + +Font Families +------------- + ================================== =================== ==================================== Powerline Font Family Formerly Known As License ================================== =================== ==================================== @@ -19,9 +29,3 @@ the new Powerline plugin. Terminess Powerline Terminus SIL Open Font License, Version 1.1 Ubuntu Mono derivative Powerline Ubuntu Mono Ubuntu Font License, Version 1.0 ================================== =================== ==================================== - -**IMPORTANT:** If you're running Linux you may not have to use a -patched font! See the `Powerline font installation instructions`__ for -details. - -__ https://powerline.readthedocs.org/en/latest/installation/linux.html#font-installation diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..080d023 --- /dev/null +++ b/install.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Set source and target directories +powerline_fonts_dir=$( cd "$( dirname "$0" )" && pwd ) + +if [[ `uname` == 'Darwin' ]]; then + # MacOS + font_dir="$HOME/Library/Fonts" +else + # Linux + font_dir="$HOME/.fonts" + mkdir -p $font_dir +fi + +# Copy all fonts to user fonts directory +find_command="find $powerline_fonts_dir -name '*.[o,t]tf' -type f -print0" +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 Powerline fonts installed to $font_dir"