diff --git a/setup.sh b/update.sh similarity index 53% rename from setup.sh rename to update.sh index 4138232..8043fbe 100755 --- a/setup.sh +++ b/update.sh @@ -1,8 +1,7 @@ #!/bin/bash # Install system packages -sudo apt update && \ -sudo apt -y upgrade && \ +sudo apt update && sudo apt -y upgrade && \ sudo apt -y install ninja-build gettext cmake unzip curl python3 python3-pip python3-venv \ build-essential libssl-dev libffi-dev python3-dev file tmux && \ @@ -29,6 +28,7 @@ LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/re curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" && \ tar xf lazygit.tar.gz lazygit && \ sudo install lazygit /usr/local/bin && \ +rm ~/lazygit && rm ~/lazygit.tar.gz && \ # Install gdu sudo add-apt-repository -y ppa:daniel-milde/gdu && \ @@ -39,15 +39,34 @@ sudo apt install -y gdu && \ sudo apt install -y ruby ruby-dev && \ sudo gem install neovim && \ -# Install perl -sudo apt install -y perl make && \ -curl -L https://cpanmin.us | sudo perl - App::cpanminus && \ -sudo cpanm -n Neovim::Ext && \ - # Install bottom cd ~ && \ curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.1/bottom_0.9.1_amd64.deb && \ sudo dpkg -i bottom_0.9.1_amd64.deb && \ +rm ~/bottom_0.9.1_amd64.deb && \ + +# Install go +sudo apt install -y golang && \ + +# Install php +sudo apt install -y php php-curl php-xml php-mbstring && \ + +# Install luarocks +sudo apt install -y luarocks && \ + +# Install composer +sudo apt install -y composer && \ + +# Install java +sudo apt install -y default-jdk && \ + +# Install julia +wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.0-linux-x86_64.tar.gz && \ +tar -xvzf julia-1.9.0-linux-x86_64.tar.gz && \ +sudo cp -r julia-1.9.0 /opt/ && \ +sudo ln -s /opt/julia-1.9.0/bin/julia /usr/local/bin/julia && \ +rm julia-1.9.0-linux-x86_64.tar.gz && \ +rm -rf julia-1.9.0 && \ # Install node cd ~ && \ @@ -68,15 +87,33 @@ pip3 install pynvim && \ # Install neovim for node sudo npm install -g neovim && \ -# Add git config -if [ ! -f ~/.gitconfig ]; then cp ~/code_server/gitconfig ~/.gitconfig; fi && \ +# Symlink git config +ln -sf ~/code_server/gitconfig ~/.gitconfig && \ -# Add tmux config -if [ ! -f ~/.tmux.conf ]; then cp ~/code_server/tmux.conf ~/.tmux.conf; fi && \ +# Symlink tmux config +ln -sf ~/code_server/tmux.conf ~/.tmux.conf && \ -# restore default .bashrc -sudo cp /etc/skel/.bashrc ~/.bashrc +# Symlink clang-format config +ln -sf ~/code_server/clang-format ~/.clang-format && \ + +# Symlink nvim user folder +ln -sf ~/code_server/config/nvim/lua/user ~/.config/nvim/lua/user && \ + +# Restore default .bashrc +sudo /bin/cp /etc/skel/.bashrc ~/.bashrc && \ + +# Add path to bashrc +echo "# PATH" >> ~/.bashrc && \ +echo 'PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"' >> ~/.bashrc && \ + +# Add tmux/nvim autostart to bashrc +echo "# TMUX" >> ~/.bashrc && \ +echo "if [[ ! \$TERM =~ screen ]]; then" >> ~/.bashrc && \ +echo "if which tmux >/dev/null 2>&1; then" >> ~/.bashrc && \ +echo ' test -z "$TMUX" && (tmux attach || tmux new-session nvim)' >> ~/.bashrc && \ +echo "fi" >> ~/.bashrc && \ +echo "fi" >> ~/.bashrc && \ + +echo "" && \ +echo "Update complete! Please restart your terminal." -# Add path to .bashrc -echo "export PATH=\$PATH:~/.local/bin:~/.cargo/bin" >> ~/.bashrc -echo "eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)" >> ~/.bashrc