install.sh 1.1 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 "Sourcing .profile and .aliases"
  15. . ./.profile
  16. . ./.aliases
  17. fancy_print "Installing packages"
  18. xi -y $(cat packages.txt)
  19. fancy_print "Installing optional software"
  20. prompt_install()
  21. {
  22. while true
  23. do
  24. echo -n "Install $1? [y/n] "
  25. read yn
  26. case $yn in
  27. [Yy]* ) xi -y $1; break;;
  28. [Nn]* ) break;;
  29. * ) echo "Please answer yes or no.";;
  30. esac
  31. done
  32. }
  33. for line in $(cat optional_packages.txt)
  34. do
  35. prompt_install "$line"
  36. done
  37. git_make_install()
  38. {
  39. (
  40. mkdir -p "~/git$1";
  41. cd "~/git/$1";
  42. git clone "$2" .;
  43. make;
  44. sudo make install;
  45. )
  46. }
  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"