install.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 fzf"
  40. git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
  41. ~/.fzf/install --key-bindings --completion --no-update-rc
  42. fancy_print "Installing vim-plug"
  43. curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
  44. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  45. fancy_print "Installing suckless forks"
  46. if prompt "Install st and dwm?" ; then
  47. git_make_install "st" "https://gogs.tankernn.eu/Tankernn/st.git"
  48. git_make_install "dwm" "https://gogs.tankernn.eu/Tankernn/dwm.git"
  49. fi
  50. fancy_print "Installation complete!"