From ae82f4234a2bf4a5b61def2bbfb74e054bfd6058 Mon Sep 17 00:00:00 2001 From: Srijan R Shetty Date: Tue, 24 Feb 2015 21:16:42 +0530 Subject: [PATCH] Install script for Ubuntu --- install.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 000000000..403d2da0a --- /dev/null +++ b/install.sh @@ -0,0 +1,25 @@ +#!/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 + font_dir="$HOME/.fonts" + 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"