install.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 packages"
  15. sudo xbps-install -Suy $(cat packages.txt)
  16. fancy_print "Installing optional software"
  17. prompt_install()
  18. {
  19. while true
  20. do
  21. echo -n "Install $1? [y/n] "
  22. read yn
  23. case $yn in
  24. [Yy]* ) xi -y $1; break;;
  25. [Nn]* ) break;;
  26. * ) echo "Please answer yes or no.";;
  27. esac
  28. done
  29. }
  30. for line in $(cat optional_packages.txt)
  31. do
  32. prompt_install "$line"
  33. done
  34. git_make_install()
  35. {
  36. (
  37. mkdir -p "~/git$1";
  38. cd "~/git/$1";
  39. git clone "$2" .;
  40. make;
  41. sudo make install;
  42. )
  43. }
  44. fancy_print "Installing vim-plug"
  45. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  46. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  47. fancy_print "Installing suckless forks"
  48. git_make_install "st" "https://gogs.tankernn.eu/Tankernn/st.git"
  49. git_make_install "dwm" "https://gogs.tankernn.eu/Tankernn/dwm.git"
  50. printf "\033[31m"
  51. figlet "Installation complete!"
  52. printf "\033[0m"