install 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
  3. elemIn() {
  4. for e in "${@:2}"; do
  5. [[ "$e" = "$1" ]] && return 1
  6. done
  7. return 0
  8. }
  9. link() {
  10. if [ -e "$1/.$2" ]; then
  11. read -p "$1/.$2 exists! Delete? [y/N] " -n 1 -r
  12. if [[ $REPLY =~ ^[Yy]$ ]]; then
  13. rm -rf "$1/.$2"
  14. ln -sn "$DIR/$2" "$1/.$2"
  15. fi
  16. echo ""
  17. else
  18. ln -sn "$DIR/$2" "$1/.$2"
  19. fi
  20. }
  21. exclude=("scripts" "README.md")
  22. configs=("conky" "openbox" "tint2")
  23. for i in $(ls "$DIR"); do
  24. elemIn "$i" "${exclude[@]}"
  25. if [[ $? == 1 ]]; then continue; fi
  26. elemIn "$i" "${configs[@]}"
  27. if [[ $? == 1 ]]; then
  28. link "$HOME/.config" "$i"
  29. else
  30. link "$HOME" "$i"
  31. fi
  32. done
  33. git submodule update --init --recursive
  34. git submodule foreach git pull origin master
  35. ln -fsn "$DIR"/vim/pathogen/autoload "$DIR"/vim/
  36. mkdir -p "$DIR"/vim/tmp/{backup,swap,undo}
  37. #Very specific to Arch
  38. read -p "Install boost and powerline? [y/N] " -n 1 -r
  39. if [[ $REPLY =~ ^[Yy]$ ]]; then
  40. yaourt -S boost python2-powerline-git
  41. fi
  42. echo ""
  43. read -p "Auto compile YouCompleteMe? [y/N] " -n 1 -r
  44. if [[ $REPLY =~ ^[Yy]$ ]]; then
  45. echo ""
  46. echo "Compiling YouCompleteMe"
  47. cd "$DIR"/vim/bundle/YouCompleteMe
  48. ./install.sh
  49. fi
  50. echo ""
  51. read -p "Auto compile exuberant-ctags? [y/N] " -n 1 -r
  52. if [[ $REPLY =~ ^[Yy]$ ]]; then
  53. echo ""
  54. git clone git://github.com/jakedouglas/exuberant-ctags.git "$DIR"/exuberant-ctags
  55. cd "$DIR"/exuberant-ctags
  56. ./configure
  57. make
  58. sudo make install
  59. rm -rf "$DIR"/exuberant-ctags
  60. fi
  61. echo ""