install.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/sh
  2. fancy_print() {
  3. printf "\033[31m#### $1\033[0m\n"
  4. }
  5. fancy_print "Linking dotfiles"
  6. for f in ".*"
  7. do
  8. case "$f" in
  9. *.git*) continue ;;
  10. *.swp) continue ;;
  11. esac
  12. ln -s $(realpath $f) ~/
  13. done
  14. fancy_print "Installing vim-plug"
  15. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  16. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  17. fancy_print "Sourcing .profile and .aliases"
  18. . ./.profile
  19. . ./.aliases
  20. fancy_print "Installing packages"
  21. xi -y $(cat packages.txt)
  22. fancy_print "Installing optional software"
  23. prompt_install()
  24. {
  25. while true
  26. do
  27. echo -n "Install $1? [y/n] "
  28. read yn
  29. case $yn in
  30. [Yy]* ) xi -y $1; break;;
  31. [Nn]* ) break;;
  32. * ) echo "Please answer yes or no.";;
  33. esac
  34. done
  35. }
  36. for line in $(cat optional_packages.txt)
  37. do
  38. prompt_install "$line"
  39. done
  40. git_make_install()
  41. {
  42. (
  43. mkdir -p "~/git$1";
  44. cd "~/git/$1";
  45. git clone "$2" .;
  46. make;
  47. sudo make install;
  48. )
  49. }
  50. fancy_print "Installing suckless forks"
  51. git_make_install "st" "https://gogs.tankernn.eu/Tankernn/st.git"
  52. git_make_install "dwm" "https://gogs.tankernn.eu/Tankernn/dwm.git"
  53. printf "\033[31m"
  54. figlet "Installation complete!"
  55. printf "\033[0m"