install.sh 1.9 KB

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