install 1.6 KB

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