Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

30 строки
794 B

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