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.

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