Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

28 righe
760 B

  1. #!/bin/sh
  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 which fonts to install
  5. prefix="$1"
  6. if test "$(uname)" = "Darwin" ; then
  7. # MacOS
  8. font_dir="$HOME/Library/Fonts"
  9. else
  10. # Linux
  11. font_dir="$HOME/.local/share/fonts"
  12. mkdir -p $font_dir
  13. fi
  14. # Copy all fonts to user fonts directory
  15. echo "Copying fonts..."
  16. find "$powerline_fonts_dir" \( -name "$prefix*.[ot]tf" -or -name "$prefix*.pcf.gz" \) -type f -print0 | xargs -0 -n1 -I % cp "%" "$font_dir/"
  17. # Reset font cache on Linux
  18. if which fc-cache >/dev/null 2>&1 ; then
  19. echo "Resetting font cache, this may take a moment..."
  20. fc-cache -f "$font_dir"
  21. fi
  22. echo "Powerline fonts installed to $font_dir"