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.

31 righe
923 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 uninstall
  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. if test ! -d "$font_dir" ; then
  13. echo "It seems there are no powerline fonts installed on your system. Uninstall not needed."
  14. exit 0
  15. fi
  16. fi
  17. # Remove all fonts from user fonts directory
  18. echo "Removing fonts..."
  19. find "$powerline_fonts_dir" \( -name "$prefix*.[ot]tf" -or -name "$prefix*.pcf.gz" \) -type f -print0 | xargs -n1 -0 -I % sh -c "rm -f \"\$0/\${1##*/}\"" "$font_dir" %
  20. # Reset font cache on Linux
  21. if which fc-cache >/dev/null 2>&1 ; then
  22. echo "Resetting font cache, this may take a moment..."
  23. fc-cache -f "$font_dir"
  24. fi
  25. echo "Powerline fonts uninstalled from $font_dir"