diff --git a/install_popos.sh b/install_popos.sh new file mode 100755 index 0000000..c16599e --- /dev/null +++ b/install_popos.sh @@ -0,0 +1,163 @@ +#!/bin/sh + +DIR="$(realpath "$(dirname "$0")")" + +# script must start at home directory +cd "$HOME" || exit 1; + +dependencies() { + sudo apt update -y + sudo apt install -y make curl sudo git zip unzip || exit 1 + if ! (type sudo 2>&1) > /dev/null; then + echo "sudo is not installed."; + exit 1 + fi + + echo "Updating APT and adding PPA's" + curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - + sudo apt update -y || exit 1 + + sudo apt install -y nodejs golang cargo tmux g++ gcc || exit 1 +} + +sysinfo() { + echo "Dylan Araps scripts" + cd "$HOME" || exit 1; + mkdir -p repos + git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch" + git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch" + git clone https://github.com/dylanaraps/fff "$HOME/repos/fff" + + cd "$HOME/repos/pfetch" || exit 1; + sudo make install || exit 2; + cd "$HOME" || exit 1; + + cd "$HOME/repos/neofetch" || exit 1; + sudo make install || exit 2; + cd "$HOME" || exit 1; + + cd "$HOME/repos/fff" || exit 1; + sudo make install || exit 2; + cd "$HOME" || exit 1; +} + +browsers() { + sudo apt remove -y firefox + # install brave + sudo apt install apt-transport-https -y || exit 1 + 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 + 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 + sudo apt update -y + sudo apt install brave-browser -y || exit 1 +} + +torbrowser() { + sudo apt install -y torbrowser-launcher +} + +popshell() { + mkdir -p "$HOME/repos" + sudo apt install git node-typescript make -y + git clone https://github.com/pop-os/shell.git "$HOME/repos/shell" + cd "$HOME/repos/shell" || exit 1 + make depcheck + make compile + make install + make configure +} + +meetings() { + mkdir -p "$HOME/repos" + + # install skype + curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb" + sudo apt install "$HOME/repos/skypeforlinux.deb" -y + + # install zoom + curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb" + sudo apt install "$HOME/repos/zoomus.deb" -y + + # install mt + sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt + sudo chmod +x /usr/local/bin/mt +} + +dotfiles() { + echo "Adding zsh and tmux configs" + # zsh plugins + sudo apt install -y zsh tmux shellcheck fzf + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" + # dotfiles + if ! test -d "$DIR/dots"; then + echo "$DIR/dots folder not found."; + exit 1; + fi + cp "$DIR/dots/zshrc" "$HOME/.zshrc" + cp "$DIR/dots/tmux.conf" "$HOME/.tmux.conf" + git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm || exit 1 + tmux start \; \ + new -d \; \ + run "$HOME/.tmux/plugins/tpm/scripts/install_plugins.sh" \; \ + kill-session || exit 1 + mkdir -p "$HOME/.local/bin" || exit 1 + cp -r "$DIR/scripts/." "$HOME/.local/bin/" || exit 1 +} + +neovim() { + # install neovim + curl https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.deb -LJo "$HOME/repos/nvim-linux64.deb" || exit 1 + sudo apt install "$HOME/repos/nvim-linux64.deb" -y || exit 1 + sudo npm install -g tree-sitter-cli + git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim || exit 1 + git clone https://git.junickim.me/junikimm717/nvim2023 ~/.config/nvim || exit 1 + nvim -c PackerSync -c 'sleep 10' -c qa --headless + echo "sleeping to compile" + nvim -c 'sleep 60' -c qa --headless +} + +neovim_fonts() { + sudo apt install -y fonts-jetbrains-mono + mkdir -p "$HOME/.local/share/fonts/JB" + cd "$HOME/.local/share/fonts/JB" || exit 1 + curl -LJO https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/JetBrainsMono.zip || exit 1 + unzip JetBrainsMono.zip || exit 1 + fc-cache -rv || exit 1 + + sudo add-apt-repository ppa:aslatter/ppa -y + sudo apt install alacritty -y || exit 1 + mkdir -p "$HOME/.config/alacritty" || exit 1 + cp "$DIR/dots/alacritty.yml" "$HOME/.config/alacritty/alacritty.yml" || exit 1 +} + +competitiveprogramming() { + echo "CP Compilers..." + sudo apt install clang clang-tools-extra + cd "$HOME" || exit 1; + git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp" +} + +case "$1" in + ssh|s) + (dependencies && sysinfo && dotfiles && neovim) || exit 1 + ;; + graphical|g) + (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && popshell) || exit 1 + ;; + full|f) + (dependencies && sysinfo && browsers && torbrowser && meetings && dotfiles && neovim && neovim_fonts && popshell) || exit 1 + ;; + cp|c) + (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && competitiveprogramming && popshell) || exit 1 + ;; + *) + echo "First Argument should be one of ssh, graphical, full, or cp" + ;; +esac + +cat <