install.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. .) continue ;;
  10. ..) continue ;;
  11. .git) continue ;;
  12. *.swp) continue ;;
  13. esac
  14. ln -s $(realpath $f) ~/
  15. done
  16. fancy_print "Installing packages"
  17. sudo xbps-install -Suy $(cat packages.txt)
  18. fancy_print "Installing optional software"
  19. prompt_install()
  20. {
  21. while true
  22. do
  23. echo -n "Install $1? [y/n] "
  24. read yn
  25. case $yn in
  26. [Yy]* ) xi -y $1; break;;
  27. [Nn]* ) break;;
  28. * ) echo "Please answer yes or no.";;
  29. esac
  30. done
  31. }
  32. for line in $(cat optional_packages.txt)
  33. do
  34. prompt_install "$line"
  35. done
  36. git_make_install()
  37. {
  38. (
  39. mkdir -p "$HOME/git/$1"
  40. cd "$HOME/git/$1"
  41. git clone "$2" .
  42. make
  43. sudo make install
  44. )
  45. }
  46. fancy_print "Installing Oh My Zsh"
  47. sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  48. # Replace default Oh My Zsh config
  49. ln -sf $(realpath .zshrc) ~
  50. fancy_print "Installing Oh My Zsh plugins"
  51. git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  52. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  53. fancy_print "Installing fzf"
  54. git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
  55. ~/.fzf/install --key-bindings --completion --no-update-rc
  56. fancy_print "Installing vim-plug"
  57. curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
  58. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  59. fancy_print "Installing suckless forks"
  60. git_make_install "st" "https://gogs.tankernn.eu/Tankernn/st.git"
  61. git_make_install "dwm" "https://gogs.tankernn.eu/Tankernn/dwm.git"
  62. git_make_install "mpv-prescalers" "https://github.com/bjin/mpv-prescalers.git"
  63. printf "\033[31m"
  64. figlet "Installation complete!"
  65. printf "\033[0m"