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.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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. sudo snap remove firefox
  37. # install brave
  38. sudo apt install apt-transport-https -y
  39. sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
  40. 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
  41. sudo apt update -y
  42. sudo apt install brave-browser -y
  43. }
  44. torbrowser() {
  45. sudo apt install -y torbrowser-launcher
  46. }
  47. popshell() {
  48. mkdir -p "$HOME/repos"
  49. sudo apt install git node-typescript make -y
  50. git clone https://github.com/pop-os/shell.git "$HOME/repos/shell"
  51. cd "$HOME/repos/shell" || exit 1
  52. make depcheck
  53. make compile
  54. make install
  55. make configure
  56. }
  57. meetings() {
  58. mkdir -p "$HOME/repos"
  59. # install skype
  60. curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb"
  61. sudo apt install "$HOME/repos/skypeforlinux.deb" -y
  62. # install zoom
  63. curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb"
  64. sudo apt install "$HOME/repos/zoomus.deb" -y
  65. # install mt
  66. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  67. sudo chmod +x /usr/local/bin/mt
  68. }
  69. dotfiles() {
  70. echo "Adding zsh and tmux configs"
  71. # zsh plugins
  72. sudo apt install -y zsh tmux shellcheck fzf
  73. export RUNZSH=no
  74. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  75. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  76. # dotfiles
  77. if ! test -d "$DIR/dots"; then
  78. echo "$DIR/dots folder not found.";
  79. exit 1;
  80. fi
  81. cp "$DIR/dots/zshrc" "$HOME/.zshrc"
  82. cp "$DIR/dots/tmux.conf" "$HOME/.tmux.conf"
  83. git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm || exit 1
  84. tmux start \; \
  85. new -d \; \
  86. run "$HOME/.tmux/plugins/tpm/scripts/install_plugins.sh" \; \
  87. kill-session || exit 1
  88. mkdir -p "$HOME/.local/bin" || exit 1
  89. cp -r "$DIR/scripts/." "$HOME/.local/bin/" || exit 1
  90. }
  91. neovim() {
  92. # install neovim
  93. curl https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.deb -LJo "$HOME/repos/nvim-linux64.deb" || exit 1
  94. sudo apt install "$HOME/repos/nvim-linux64.deb" -y || exit 1
  95. sudo npm install -g tree-sitter-cli
  96. git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim || exit 1
  97. git clone https://git.junickim.me/junikimm717/nvim2023 ~/.config/nvim || exit 1
  98. nvim -c PackerSync -c 'sleep 10' -c qa --headless
  99. echo "sleeping to compile"
  100. nvim -c 'sleep 60' -c qa --headless
  101. }
  102. neovim_fonts() {
  103. mkdir -p "$HOME/.local/share/fonts/UM"
  104. cd "$HOME/.local/share/fonts/UM" || exit 1
  105. curl -LJO https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/UbuntuMono.zip || exit 1
  106. unzip UbuntuMono.zip || exit 1
  107. fc-cache -rv || exit 1
  108. sudo add-apt-repository ppa:aslatter/ppa -y
  109. sudo apt install alacritty -y || exit 1
  110. mkdir -p "$HOME/.config/alacritty" || exit 1
  111. cp "$DIR/dots/alacritty_ubuntu.yml" "$HOME/.config/alacritty/alacritty.yml" || exit 1
  112. }
  113. competitiveprogramming() {
  114. echo "CP Compilers..."
  115. sudo apt install clang clang-tools-extra
  116. cd "$HOME" || exit 1;
  117. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  118. }
  119. case "$1" in
  120. ssh|s)
  121. (dependencies && sysinfo && dotfiles && neovim) || exit 1
  122. ;;
  123. graphical|g)
  124. (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && popshell) || exit 1
  125. ;;
  126. full|f)
  127. (dependencies && sysinfo && browsers && torbrowser && meetings && dotfiles && neovim && neovim_fonts && popshell) || exit 1
  128. ;;
  129. cp|c)
  130. (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && competitiveprogramming && popshell) || exit 1
  131. ;;
  132. *)
  133. echo "First Argument should be one of ssh, graphical, full, or cp"
  134. ;;
  135. esac
  136. cat <<EOF
  137. Stuff to do:
  138. - Reboot to make all changes active
  139. - Copy over the mt config files
  140. EOF