25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
698 B

  1. #!/bin/bash
  2. # Set source and target directories
  3. powerline_fonts_dir=$( cd "$( dirname "$0" )" && pwd )
  4. find_command="find \"$powerline_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0"
  5. if [[ `uname` == 'Darwin' ]]; then
  6. # MacOS
  7. font_dir="$HOME/Library/Fonts"
  8. else
  9. # Linux
  10. font_dir="$HOME/.local/share/fonts"
  11. mkdir -p $font_dir
  12. fi
  13. # Copy all fonts to user fonts directory
  14. echo "Copying fonts..."
  15. eval $find_command | xargs -0 -I % cp "%" "$font_dir/"
  16. # Reset font cache on Linux
  17. if command -v fc-cache @>/dev/null ; then
  18. echo "Resetting font cache, this may take a moment..."
  19. fc-cache -f $font_dir
  20. fi
  21. echo "All Powerline fonts installed to $font_dir"