You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
5.3 KiB

2 years ago
  1. #!/bin/sh
  2. DIR="$(realpath "$(dirname "$0")")"
  3. # script must start at home directory
  4. cd "$HOME" || exit 1;
  5. dependencies() {
  6. sudo apt update -y
  7. sudo apt install -y make curl sudo git zip unzip || exit 1
  8. if ! (type sudo 2>&1) > /dev/null; then
  9. echo "sudo is not installed.";
  10. exit 1
  11. fi
  12. echo "Updating APT and adding PPA's"
  13. curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
  14. sudo apt update -y || exit 1
  15. sudo apt install -y nodejs golang cargo tmux g++ gcc || exit 1
  16. }
  17. sysinfo() {
  18. echo "Dylan Araps scripts"
  19. cd "$HOME" || exit 1;
  20. mkdir -p repos
  21. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  22. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  23. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  24. cd "$HOME/repos/pfetch" || exit 1;
  25. sudo make install || exit 2;
  26. cd "$HOME" || exit 1;
  27. cd "$HOME/repos/neofetch" || exit 1;
  28. sudo make install || exit 2;
  29. cd "$HOME" || exit 1;
  30. cd "$HOME/repos/fff" || exit 1;
  31. sudo make install || exit 2;
  32. cd "$HOME" || exit 1;
  33. }
  34. browsers() {
  35. sudo apt remove -y firefox
  36. # install brave
  37. sudo apt install apt-transport-https -y || exit 1
  38. sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg || exit 1
  39. echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list || exit 1
  40. sudo apt update -y
  41. sudo apt install brave-browser -y || exit 1
  42. }
  43. torbrowser() {
  44. sudo apt install -y torbrowser-launcher
  45. }
  46. popshell() {
  47. mkdir -p "$HOME/repos"
  48. sudo apt install git node-typescript make -y
  49. git clone https://github.com/pop-os/shell.git "$HOME/repos/shell"
  50. cd "$HOME/repos/shell" || exit 1
  51. make depcheck
  52. make compile
  53. make install
  54. make configure
  55. }
  56. meetings() {
  57. mkdir -p "$HOME/repos"
  58. # install skype
  59. curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb"
  60. sudo apt install "$HOME/repos/skypeforlinux.deb" -y
  61. # install zoom
  62. curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb"
  63. sudo apt install "$HOME/repos/zoomus.deb" -y
  64. # install mt
  65. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  66. sudo chmod +x /usr/local/bin/mt
  67. }
  68. dotfiles() {
  69. echo "Adding zsh and tmux configs"
  70. # zsh plugins
  71. sudo apt install -y zsh tmux shellcheck fzf
  72. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  73. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  74. # dotfiles
  75. if ! test -d "$DIR/dots"; then
  76. echo "$DIR/dots folder not found.";
  77. exit 1;
  78. fi
  79. cp "$DIR/dots/zshrc" "$HOME/.zshrc"
  80. cp "$DIR/dots/tmux.conf" "$HOME/.tmux.conf"
  81. git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm || exit 1
  82. tmux start \; \
  83. new -d \; \
  84. run "$HOME/.tmux/plugins/tpm/scripts/install_plugins.sh" \; \
  85. kill-session || exit 1
  86. mkdir -p "$HOME/.local/bin" || exit 1
  87. cp -r "$DIR/scripts/." "$HOME/.local/bin/" || exit 1
  88. }
  89. neovim() {
  90. # install neovim
  91. curl https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.deb -LJo "$HOME/repos/nvim-linux64.deb" || exit 1
  92. sudo apt install "$HOME/repos/nvim-linux64.deb" -y || exit 1
  93. sudo npm install -g tree-sitter-cli
  94. git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim || exit 1
  95. git clone https://git.junickim.me/junikimm717/nvim2023 ~/.config/nvim || exit 1
  96. nvim -c PackerSync -c 'sleep 10' -c qa --headless
  97. echo "sleeping to compile"
  98. nvim -c 'sleep 60' -c qa --headless
  99. }
  100. neovim_fonts() {
  101. sudo apt install -y fonts-jetbrains-mono
  102. mkdir -p "$HOME/.local/share/fonts/JB"
  103. cd "$HOME/.local/share/fonts/JB" || exit 1
  104. curl -LJO https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/JetBrainsMono.zip || exit 1
  105. unzip JetBrainsMono.zip || exit 1
  106. fc-cache -rv || exit 1
  107. sudo add-apt-repository ppa:aslatter/ppa -y
  108. sudo apt install alacritty -y || exit 1
  109. mkdir -p "$HOME/.config/alacritty" || exit 1
  110. cp "$DIR/dots/alacritty.yml" "$HOME/.config/alacritty/alacritty.yml" || exit 1
  111. }
  112. competitiveprogramming() {
  113. echo "CP Compilers..."
  114. sudo apt install clang clang-tools-extra
  115. cd "$HOME" || exit 1;
  116. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  117. }
  118. case "$1" in
  119. ssh|s)
  120. (dependencies && sysinfo && dotfiles && neovim) || exit 1
  121. ;;
  122. graphical|g)
  123. (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && popshell) || exit 1
  124. ;;
  125. full|f)
  126. (dependencies && sysinfo && browsers && torbrowser && meetings && dotfiles && neovim && neovim_fonts && popshell) || exit 1
  127. ;;
  128. cp|c)
  129. (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && competitiveprogramming && popshell) || exit 1
  130. ;;
  131. *)
  132. echo "First Argument should be one of ssh, graphical, full, or cp"
  133. ;;
  134. esac
  135. cat <<EOF
  136. Stuff to do:
  137. - Reboot to make all changes active
  138. - Copy over the mt config files
  139. EOF