install 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. git submodule foreach git pull origin master
  37. ln -fsn "$DIR"/vim/pathogen/autoload "$DIR"/vim/
  38. mkdir -p "$DIR"/vim/tmp/{backup,swap,undo}
  39. #Very specific to Arch
  40. read -p "Install boost and powerline? [y/N] " -n 1 -r
  41. if [[ $REPLY =~ ^[Yy]$ ]]; then
  42. yaourt -S boost python2-powerline-git
  43. fi
  44. echo ""
  45. read -p "Auto compile YouCompleteMe? [y/N] " -n 1 -r
  46. if [[ $REPLY =~ ^[Yy]$ ]]; then
  47. echo ""
  48. echo "Compiling YouCompleteMe"
  49. cd "$DIR"/vim/bundle/YouCompleteMe
  50. ./install.sh
  51. fi
  52. echo ""
  53. read -p "Auto compile exuberant-ctags? [y/N] " -n 1 -r
  54. if [[ $REPLY =~ ^[Yy]$ ]]; then
  55. echo ""
  56. git clone git://github.com/jakedouglas/exuberant-ctags.git "$DIR"/exuberant-ctags
  57. cd "$DIR"/exuberant-ctags
  58. ./configure
  59. make
  60. sudo make install
  61. rm -rf "$DIR"/exuberant-ctags
  62. fi
  63. echo ""