diff options
author | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2024-07-28 23:05:45 -0400 |
---|---|---|
committer | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2024-07-28 23:05:45 -0400 |
commit | 8c4a6f932b129df4f9a63b7b2e2bcaea6f215866 (patch) | |
tree | d51cea169cae19b05025a0b26670a9a09505e8fe /fonts/powerline/install.sh |
Took snapshot of my main dotfiles
Diffstat (limited to 'fonts/powerline/install.sh')
-rwxr-xr-x | fonts/powerline/install.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fonts/powerline/install.sh b/fonts/powerline/install.sh new file mode 100755 index 0000000..eeb7042 --- /dev/null +++ b/fonts/powerline/install.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Set source and target directories +powerline_fonts_dir=$( cd "$( dirname "$0" )" && pwd ) + +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/.local/share/fonts" + mkdir -p $font_dir +fi + +# Copy all fonts to user fonts directory +echo "Copying fonts..." +eval $find_command | xargs -0 -I % cp "%" "$font_dir/" + +# Reset font cache on Linux +if command -v fc-cache @>/dev/null ; then + echo "Resetting font cache, this may take a moment..." + fc-cache -f $font_dir +fi + +echo "All Powerline fonts installed to $font_dir" |