install.sh 539 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # A simple srcipt that moves collected fonts to local font directory
  3. # get current path
  4. DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  5. FONT_DIR="$DIR/collections"
  6. echo "Found fonts:"
  7. find "$FONT_DIR" -mindepth 1 -type d -exec basename {} \;
  8. echo "------"
  9. # get target path
  10. if [[ $(uname) == 'Linux' ]]; then
  11. TARGET_DIR="$HOME/.local/share/fonts"
  12. else
  13. echo "This script only works on Linux."
  14. fi
  15. echo "Installing fonts to $TARGET_DIR"
  16. cp -r $FONT_DIR/* $TARGET_DIR
  17. echo "Refreshing font cache"
  18. fc-cache -f
  19. echo "Done"