diff --git a/update.sh b/update.sh deleted file mode 100755 index cc1ff89..0000000 --- a/update.sh +++ /dev/null @@ -1,550 +0,0 @@ -#!/bin/bash -set -e - -if [ -f /etc/os-release ]; then - # freedesktop.org and systemd - . /etc/os-release - OS=$NAME - VER=$VERSION_ID -else - OS="none" - VER="0" -fi - -if [ "$OS" == "Ubuntu" ]; then - - if [ "$(dpkg -l | awk '/ubuntu-desktop/ {print }' | wc -l)" -ge 1 ]; then - DESKTOP="yes" - else - DESKTOP="no" - fi - - if [ "$(systemd-detect-virt)" == "wsl" ]; then - WSL="yes" - else - WSL="no" - fi -elif [ "$OS" == "Arch Linux" ]; then - DESKTOP="yes" - WSL="no" -fi - -# *** System applications *** -printf -- '\033[32m *** System applications ***\n\033[37m' - -# Ubuntu 20.04 workaround -if [ "$OS" == "Ubuntu" ]; then - sudo apt -y purge --auto-remove neovim -fi - -# Install system packages -printf -- '\033[33m Installing system packages\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt update - sudo apt upgrade -y - sudo apt install -y gawk imagemagick gpg ninja-build gettext cmake unzip curl build-essential libssl-dev libffi-dev file tmux libudev-dev pkg-config locales btop ncdu ranger -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman -Suyy --noconfirm - if pacman -Qs yay >/dev/null; then - yay --noconfirm --aur - else - sudo pacman -S --needed --noconfirm git base-devel - if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi - cd ~ - git clone https://aur.archlinux.org/yay-bin.git - cd yay-bin - makepkg --noconfirm -si - cd ~ - if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi - fi - sudo pacman --noconfirm --needed -S waybar wofi hyprland hyprlock polkit-gnome xorg-xhost gnome-keyring pipewire git base-devel cmake gawk wget gettext unzip curl tmux btop ncdu ranger qt5ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance - - yay --noconfirm -S --needed --aur adwaita-qt5-git - yay --noconfirm -S --needed --aur adwaita-qt6-git - yay --noconfirm -S --needed --aur pam_autologin - - sudo /bin/cp -rf ~/code_server/login /etc/pam.d/login - sudo /bin/cp -rf ~/code_server/getty@.service /usr/lib/systemd/system/getty@.service - sudo touch /etc/security/autologin.conf - -fi - -# Setup locals -printf -- '\033[33m Setup locals\n\033[37m' -sudo locale-gen "en_US.UTF-8" -if [ "$OS" == "Ubuntu" ]; then - sudo update-locale LANG=en_US.UTF-8 -elif [ "$OS" == "Arch Linux" ]; then - sudo localectl set-locale LANG=en_US.UTF-8 -fi - -# Install python -printf -- '\033[33m Installing python\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y python3 python3-pip python3-venv python3-dev pipx - if [ "$VER" == "22.04" ]; then - pip3 install pynvim - else - sudo apt install -y python3-pynvim - fi -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S python python-pip python-pipx python-pipenv python-pynvim -fi - -# Install fzf -printf -- '\033[33m Installing fzf\n\033[37m' -rm -rf ~/.fzf -git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf -~/.fzf/install --all -source ~/.fzf.bash - -# # Install VirtualHere server -# curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh - -# Install VirtualHere client -printf -- '\033[33m Installing VirtualHere client\n\033[37m' -cd ~ -wget https://www.virtualhere.com/sites/default/files/usbclient/scripts/virtualhereclient.service -wget https://www.virtualhere.com/sites/default/files/usbclient/vhclientx86_64 -chmod +x ./vhclientx86_64 -sudo mv ./vhclientx86_64 /usr/sbin -echo "$USER ALL=(ALL:ALL) NOPASSWD: /usr/sbin/vhclientx86_64" | sudo tee /etc/sudoers.d/$USER+vhclientx86_64 -sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service -# sudo systemctl daemon-reload -# sudo systemctl enable virtualhereclient.service -# sudo systemctl start virtualhereclient.service - -# Install teensy udev rules (only for non docker system) -if [ ! -f /.dockerenv ]; then - printf -- '\033[33m Installing teensy udev rules\n\033[37m' - sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules - sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules - sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules - if [ "$OS" == "Ubuntu" ]; then - sudo service udev restart - fi - sudo udevadm control --reload-rules - sudo udevadm trigger -fi - -# Install neovim -printf -- '\033[33m Installing neovim\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - cd ~ - if [ -d ~/neovim ]; then rm -rf ~/neovim; fi - git clone https://github.com/neovim/neovim - cd neovim && git checkout stable - make CMAKE_BUILD_TYPE=RelWithDebInfo - cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb - if [ -d ~/neovim ]; then rm -rf ~/neovim; fi -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S neovim -fi - -# Install fd -printf -- '\033[33m Installing fd\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y fd-find -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S fd -fi - -# Install lazygit -printf -- '\033[33m Installing lazygit\n\033[37m' -cd ~ -LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') -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 -printf -- '\033[33m Installing gdu\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - if [ $VER = "22.04" ]; then - sudo add-apt-repository -y ppa:daniel-milde/gdu - fi - sudo apt update - sudo apt install -y gdu -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S gdu -fi - -# Install ruby -printf -- '\033[33m Installing ruby\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y ruby ruby-dev - sudo gem install neovim -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S ruby -fi - -# Install bottom -printf -- '\033[33m Installing bottom\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - 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 -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S bottom -fi - -# Install go -printf -- '\033[33m Installing go\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y golang -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S go -fi - -# Install php -printf -- '\033[33m Installing php\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y php php-curl php-xml php-mbstring -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S php -fi - -# Install luarocks -printf -- '\033[33m Installing luarocks\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y luarocks -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S luarocks -fi - -# Install composer -printf -- '\033[33m Installing composer\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y composer -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S composer -fi - -# Install java -printf -- '\033[33m Installing java\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y default-jdk -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S jdk-openjdk -fi - -# Install julia -printf -- '\033[33m Installing julia\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - 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 -sf /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 -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S julia -fi - -# Install node -printf -- '\033[33m Installing node\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - cd ~ - curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - - sudo apt install -y nodejs - npm config set prefix "${HOME}/.npm" -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S nodejs npm -fi - -# Install ble.sh -printf -- '\033[33m Installing ble.sh\n\033[37m' -if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi -cd ~ -git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git -#make -C ble.sh install PREFIX=~/.local -make -C ble.sh install -if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi - -# Install platformio -printf -- '\033[33m Installing platformio\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - if [ "$VER" == "24.04" ]; then - pipx install platformio - pipx ensurepath - else - pip3 install platformio - fi -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S platformio-core -fi - -# Install neovim for node -printf -- '\033[33m Installing neovim for node\n\033[37m' -sudo npm install -g neovim - -# Install rust -printf -- '\033[33m Installing Rust\n\033[37m' -if [ "$OS" == "Ubuntu" ]; then - cd ~ - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y - source "$HOME/.cargo/env" - rustup self update -elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S rustup -fi -rustup update stable -rustup default stable - -# Install rust embedded stuff -printf -- '\033[33m Installing Rust embedded stuff\n\033[37m' -cd ~ -rustup target add thumbv6m-none-eabi -cargo install elf2uf2-rs --locked -cargo install probe-run - -# Install tree sitter cli -printf -- '\033[33m Installing tree sitter cli\n\033[37m' -cd ~ -cargo install tree-sitter-cli - -# Install ripgrep -printf -- '\033[33m Installing ripgrep\n\033[37m' -cargo install ripgrep - -# Install eza -printf -- '\033[33m Installing eza\n\033[37m' -cargo install eza - -# Install zoxide -printf -- '\033[33m Installing zoxide\n\033[37m' -cargo install zoxide --locked - -# Install starship -printf -- '\033[33m Installing starship\n\033[37m' -cargo install starship --locked - -# *** Desktop applications *** -printf -- '\033[32m *** Desktop applications ***\n\033[37m' - -if [ "$DESKTOP" == "yes" ]; then - # Install flatpak - printf -- '\033[33m Installing desktop dep.\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - sudo add-apt-repository -y ppa:flatpak/stable - sudo apt update - sudo apt install -y flatpak - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S flatpak - fi - flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - - printf -- '\033[33m Installing Flatseal\n\033[37m' - flatpak install -y flathub com.github.tchx84.Flatseal - - printf -- '\033[33m Installing Krita\n\033[37m' - flatpak install -y flathub org.kde.krita - - printf -- '\033[33m Installing KiCad\n\033[37m' - flatpak install -y flathub org.kicad.KiCad - - printf -- '\033[33m Installing FreeCad\n\033[37m' - flatpak install -y flathub org.freecadweb.FreeCAD - - printf -- '\033[33m Installing Moonlight\n\033[37m' - flatpak install -y flathub com.moonlight_stream.Moonlight - - printf -- '\033[33m Installing DrawIo\n\033[37m' - flatpak install -y flathub com.jgraph.drawio.desktop - - # Install VSCode - printf -- '\033[33m Installing VSCode\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - sudo snap install --classic code - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S code - fi - - # Install gnome-shell-extension-manager - if [ "$OS" == "Ubuntu" ]; then - printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m' - sudo apt install -y gnome-shell-extension-manager - fi - - # Install gnome tweaks - if [ "$OS" == "Ubuntu" ]; then - printf -- '\033[33m Installing gnome tweaks\n\033[37m' - sudo apt install -y gnome-tweaks - fi - - # Install remmina - printf -- '\033[33m Installing remmina\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y remmina - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S remmina - fi - - # Install feh - printf -- '\033[33m Installing feh\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y feh - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S feh - fi - - # Install NerdFonts - printf -- '\033[33m Installing NerdFonts\n\033[37m' - mkdir -p /home/$USER/.local/share/fonts - cd /home/$USER/.local/share/fonts - wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip - unzip -o CodeNewRoman.zip - rm CodeNewRoman.zip - wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip - unzip -o NerdFontsSymbolsOnly.zip - rm NerdFontsSymbolsOnly.zip - fc-cache -fv - - # Install Wezterm - if [ "$OS" == "Ubuntu" ]; then - printf -- '\033[33m Installing wezterm\n\033[37m' - curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg - echo 'deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' | sudo tee /etc/apt/sources.list.d/wezterm.list - sudo apt update - sudo apt install -y wezterm - fi - - # Install Brave Browser - printf -- '\033[33m Installing Brave Browser\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list - sudo apt update - sudo apt install -y brave-browser - elif [ "$OS" == "Arch Linux" ]; then - yay --noconfirm -S --needed --aur brave-bin - fi - - # Install Virtualbox - printf -- '\033[33m Installing Virtualbox\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - curl https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor >oracle_vbox_2016.gpg - curl https://www.virtualbox.org/download/oracle_vbox.asc | gpg --dearmor >oracle_vbox.gpg - sudo install -o root -g root -m 644 oracle_vbox_2016.gpg /etc/apt/trusted.gpg.d/ - sudo install -o root -g root -m 644 oracle_vbox.gpg /etc/apt/trusted.gpg.d/ - echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list - sudo apt update - sudo apt install -y linux-headers-"$(uname -r)" dkms - sudo apt install virtualbox-7.1 -y - wget https://download.virtualbox.org/virtualbox/7.1.4/Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack - sudo VBoxManage extpack install --replace Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack --accept-license=eb31505e56e9b4d0fbca139104da41ac6f6b98f8e78968bdf01b1f3da3c4f9ae - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S virtualbox virtualbox-guest-iso - yay --noconfirm -S --needed --aur virtualbox-ext-oracle - fi - sudo usermod -a -G vboxusers "$USER" - - printf -- '\033[33m Installing Audio control\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - if [ $VER == "22.04" ]; then - # Install helvum - sudo apt install -y pavucontrol - fi - if [ $VER == "24.04" ]; then - # Install helvum - sudo apt install -y pavucontrol helvum - fi - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S pavucontrol helvum - fi - - # Install timeshift - printf -- '\033[33m Installing Timeshift\n\033[37m' - if [ "$OS" == "Ubuntu" ]; then - sudo apt install -y timeshift - elif [ "$OS" == "Arch Linux" ]; then - sudo pacman --noconfirm --needed -S timeshift - fi - - # Install sunshine - printf -- '\033[33m Installing Sunshine\n\033[37m' - if [ "$OS" == "Arch Linux" ]; then - yay --noconfirm --needed -S sunshine - echo 'KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"' | sudo tee /etc/udev/rules.d/60-sunshine.rules - sudo udevadm control --reload-rules - sudo udevadm trigger - sudo modprobe uinput - sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine)) - fi - -fi - -# *** Dotfile symlinking *** -printf -- '\033[32m *** Dotfile symlinking ***\n\033[37m' - -# Symlink hyperland config -if [ "$OS" == "Arch Linux" ]; then - printf -- '\033[33m Symlinking hyperland config\n\033[37m' - mkdir -p ~/.config/hypr - ln -sf ~/code_server/config/hypr/hyprland.conf ~/.config/hypr/hyprland.conf -fi - -# Symlink kitty config -if [ "$OS" == "Arch Linux" ]; then - printf -- '\033[33m Symlinking kitty config\n\033[37m' - mkdir -p ~/.config/kitty - ln -sf ~/code_server/config/kitty/kitty.conf ~/.config/kitty/kitty.conf -fi - -# Symlink wezterm config -if [ "$OS" == "Ubuntu" ]; then - printf -- '\033[33m Symlinking wezterm config\n\033[37m' - ln -sf ~/code_server/wezterm.lua ~/.wezterm.lua -fi - -# Symlink nvim config -printf -- '\033[33m Symlinking nvim config\n\033[37m' -mkdir -p ~/.config/nvim -ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua - -# Symlink git config -printf -- '\033[33m Symlinking git config\n\033[37m' -ln -sf ~/code_server/gitconfig ~/.gitconfig - -# Symlink tmux config -printf -- '\033[33m Symlinking tmux config\n\033[37m' -ln -sf ~/code_server/tmux.conf ~/.tmux.conf - -# Symlink clang-format config -printf -- '\033[33m Symlinking clang-format config\n\033[37m' -ln -sf ~/code_server/clang-format ~/.clang-format - -# Symlink lazygit config -printf -- '\033[33m Symlinking lazygit config\n\033[37m' -mkdir -p ~/.config/lazygit -ln -sf ~/code_server/config/lazygit/config.yml ~/.config/lazygit/config.yml - -# Symlink starsihp config -printf -- '\033[33m Symlinking starship config\n\033[37m' -ln -sf ~/code_server/config/starship.toml ~/.config/starship.toml - -# Symlink luacheck config -printf -- '\033[33m Symlinking luacheck config\n\033[37m' -ln -sf ~/code_server/luacheckrc ~/.luacheckrc - -# Symlink rp2040 flash script -printf -- '\033[33m Symlinking rp2040 flash script\n\033[37m' -mkdir -p ~/.local/bin -ln -sf ~/code_server/pico-load.sh ~/.local/bin/pico-load - -# Symlink blerc -printf -- '\033[33m Symlinking blerc config\n\033[37m' -ln -sf ~/code_server/blerc ~/.blerc - -# Symlink update script -printf -- '\033[33m Symlinking update wrapper\n\033[37m' -mkdir -p ~/.local/bin -ln -sf ~/code_server/update_wrapper.sh ~/.local/bin/update - -# Symlink bashrc -printf -- '\033[33m Symlinking bashrc config\n\033[37m' -ln -sf ~/code_server/bashrc ~/.bashrc - -printf -- '\033[32m \n\n***** Update complete! Please restart your terminal. *****\n\n\033[37m' diff --git a/update_arch.sh b/update_arch.sh new file mode 100644 index 0000000..5fe079d --- /dev/null +++ b/update_arch.sh @@ -0,0 +1,315 @@ +#!/bin/bash +set -e + +# Install system packages +printf -- '\033[33m Installing system packages\n\033[37m' +sudo pacman -Suyy --noconfirm +if pacman -Qs yay >/dev/null; then + yay --noconfirm --aur +else + sudo pacman -S --needed --noconfirm git base-devel + if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi + cd ~ + git clone https://aur.archlinux.org/yay-bin.git + cd yay-bin + makepkg --noconfirm -si + cd ~ + if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi +fi +sudo pacman --noconfirm --needed -S waybar wofi hyprland hyprlock polkit-gnome xorg-xhost gnome-keyring pipewire git base-devel cmake gawk wget gettext unzip curl tmux btop ncdu ranger qt5ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance + +yay --noconfirm -S --needed --aur adwaita-qt5-git +yay --noconfirm -S --needed --aur adwaita-qt6-git +yay --noconfirm -S --needed --aur pam_autologin + +sudo /bin/cp -rf ~/code_server/login /etc/pam.d/login +sudo /bin/cp -rf ~/code_server/getty@.service /usr/lib/systemd/system/getty@.service +sudo touch /etc/security/autologin.conf + +# Setup locals +printf -- '\033[33m Setup locals\n\033[37m' +sudo localectl set-locale LANG=en_US.UTF-8 + +# Install python +printf -- '\033[33m Installing python\n\033[37m' +sudo pacman --noconfirm --needed -S python python-pip python-pipx python-pipenv python-pynvim + +# Install fzf +printf -- '\033[33m Installing fzf\n\033[37m' +rm -rf ~/.fzf +git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf +~/.fzf/install --all +source ~/.fzf.bash + +# # Install VirtualHere server +# curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh + +# Install VirtualHere client +printf -- '\033[33m Installing VirtualHere client\n\033[37m' +cd ~ +wget https://www.virtualhere.com/sites/default/files/usbclient/scripts/virtualhereclient.service +wget https://www.virtualhere.com/sites/default/files/usbclient/vhclientx86_64 +chmod +x ./vhclientx86_64 +sudo mv ./vhclientx86_64 /usr/sbin +echo "$USER ALL=(ALL:ALL) NOPASSWD: /usr/sbin/vhclientx86_64" | sudo tee /etc/sudoers.d/$USER+vhclientx86_64 +sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service +# sudo systemctl daemon-reload +# sudo systemctl enable virtualhereclient.service +# sudo systemctl start virtualhereclient.service + +# Install teensy udev rules (only for non docker system) +if [ ! -f /.dockerenv ]; then + printf -- '\033[33m Installing teensy udev rules\n\033[37m' + sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules + sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo udevadm control --reload-rules + sudo udevadm trigger +fi + +# Install neovim +printf -- '\033[33m Installing neovim\n\033[37m' +sudo pacman --noconfirm --needed -S neovim + +# Install fd +printf -- '\033[33m Installing fd\n\033[37m' +sudo pacman --noconfirm --needed -S fd + +# Install lazygit +printf -- '\033[33m Installing lazygit\n\033[37m' +cd ~ +LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') +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 +printf -- '\033[33m Installing gdu\n\033[37m' +sudo pacman --noconfirm --needed -S gdu + +# Install ruby +printf -- '\033[33m Installing ruby\n\033[37m' +sudo pacman --noconfirm --needed -S ruby + +# Install bottom +printf -- '\033[33m Installing bottom\n\033[37m' +sudo pacman --noconfirm --needed -S bottom + +# Install go +printf -- '\033[33m Installing go\n\033[37m' +sudo pacman --noconfirm --needed -S go + +# Install php +printf -- '\033[33m Installing php\n\033[37m' +sudo pacman --noconfirm --needed -S php + +# Install luarocks +printf -- '\033[33m Installing luarocks\n\033[37m' +sudo pacman --noconfirm --needed -S luarocks + +# Install composer +printf -- '\033[33m Installing composer\n\033[37m' +sudo pacman --noconfirm --needed -S composer + +# Install java +printf -- '\033[33m Installing java\n\033[37m' +sudo pacman --noconfirm --needed -S jdk-openjdk + +# Install julia +printf -- '\033[33m Installing julia\n\033[37m' +sudo pacman --noconfirm --needed -S julia + +# Install node +printf -- '\033[33m Installing node\n\033[37m' +sudo pacman --noconfirm --needed -S nodejs npm + +# Install ble.sh +printf -- '\033[33m Installing ble.sh\n\033[37m' +if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi +cd ~ +git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git +#make -C ble.sh install PREFIX=~/.local +make -C ble.sh install +if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi + +# Install platformio +printf -- '\033[33m Installing platformio\n\033[37m' +sudo pacman --noconfirm --needed -S platformio-core + +# Install neovim for node +printf -- '\033[33m Installing neovim for node\n\033[37m' +sudo npm install -g neovim + +# Install rust +printf -- '\033[33m Installing Rust\n\033[37m' +sudo pacman --noconfirm --needed -S rustup +rustup update stable +rustup default stable + +# Install rust embedded stuff +printf -- '\033[33m Installing Rust embedded stuff\n\033[37m' +cd ~ +rustup target add thumbv6m-none-eabi +cargo install elf2uf2-rs --locked +cargo install probe-run + +# Install tree sitter cli +printf -- '\033[33m Installing tree sitter cli\n\033[37m' +cd ~ +cargo install tree-sitter-cli + +# Install ripgrep +printf -- '\033[33m Installing ripgrep\n\033[37m' +cargo install ripgrep + +# Install eza +printf -- '\033[33m Installing eza\n\033[37m' +cargo install eza + +# Install zoxide +printf -- '\033[33m Installing zoxide\n\033[37m' +cargo install zoxide --locked + +# Install starship +printf -- '\033[33m Installing starship\n\033[37m' +cargo install starship --locked + +# *** Desktop applications *** +printf -- '\033[32m *** Desktop applications ***\n\033[37m' + +# Install flatpak +printf -- '\033[33m Installing desktop dep.\n\033[37m' +sudo pacman --noconfirm --needed -S flatpak +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + +printf -- '\033[33m Installing Flatseal\n\033[37m' +flatpak install -y flathub com.github.tchx84.Flatseal + +printf -- '\033[33m Installing Krita\n\033[37m' +flatpak install -y flathub org.kde.krita + +printf -- '\033[33m Installing KiCad\n\033[37m' +flatpak install -y flathub org.kicad.KiCad + +printf -- '\033[33m Installing FreeCad\n\033[37m' +flatpak install -y flathub org.freecadweb.FreeCAD + +printf -- '\033[33m Installing Moonlight\n\033[37m' +flatpak install -y flathub com.moonlight_stream.Moonlight + +printf -- '\033[33m Installing DrawIo\n\033[37m' +flatpak install -y flathub com.jgraph.drawio.desktop + +# Install VSCode +printf -- '\033[33m Installing VSCode\n\033[37m' +sudo pacman --noconfirm --needed -S code + +# Install remmina +printf -- '\033[33m Installing remmina\n\033[37m' +sudo pacman --noconfirm --needed -S remmina + +# Install feh +printf -- '\033[33m Installing feh\n\033[37m' +sudo pacman --noconfirm --needed -S feh + +# Install NerdFonts +printf -- '\033[33m Installing NerdFonts\n\033[37m' +mkdir -p /home/$USER/.local/share/fonts +cd /home/$USER/.local/share/fonts +wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip +unzip -o CodeNewRoman.zip +rm CodeNewRoman.zip +wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip +unzip -o NerdFontsSymbolsOnly.zip +rm NerdFontsSymbolsOnly.zip +fc-cache -fv + +# Install Brave Browser +printf -- '\033[33m Installing Brave Browser\n\033[37m' +yay --noconfirm -S --needed --aur brave-bin + +# Install Virtualbox +printf -- '\033[33m Installing Virtualbox\n\033[37m' +sudo pacman --noconfirm --needed -S virtualbox virtualbox-guest-iso +yay --noconfirm -S --needed --aur virtualbox-ext-oracle +sudo usermod -a -G vboxusers "$USER" + +printf -- '\033[33m Installing Audio control\n\033[37m' +sudo pacman --noconfirm --needed -S pavucontrol helvum + +# Install timeshift +printf -- '\033[33m Installing Timeshift\n\033[37m' +sudo pacman --noconfirm --needed -S timeshift + +# Install sunshine +printf -- '\033[33m Installing Sunshine\n\033[37m' +yay --noconfirm --needed -S sunshine +echo 'KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"' | sudo tee /etc/udev/rules.d/60-sunshine.rules +sudo udevadm control --reload-rules +sudo udevadm trigger +sudo modprobe uinput +sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine)) + +# *** Dotfile symlinking *** +printf -- '\033[32m *** Dotfile symlinking ***\n\033[37m' + +# Symlink hyperland config +printf -- '\033[33m Symlinking hyperland config\n\033[37m' +mkdir -p ~/.config/hypr +ln -sf ~/code_server/config/hypr/hyprland.conf ~/.config/hypr/hyprland.conf + +# Symlink kitty config +printf -- '\033[33m Symlinking kitty config\n\033[37m' +mkdir -p ~/.config/kitty +ln -sf ~/code_server/config/kitty/kitty.conf ~/.config/kitty/kitty.conf + +# Symlink nvim config +printf -- '\033[33m Symlinking nvim config\n\033[37m' +mkdir -p ~/.config/nvim +ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua + +# Symlink git config +printf -- '\033[33m Symlinking git config\n\033[37m' +ln -sf ~/code_server/gitconfig ~/.gitconfig + +# Symlink tmux config +printf -- '\033[33m Symlinking tmux config\n\033[37m' +ln -sf ~/code_server/tmux.conf ~/.tmux.conf + +# Symlink clang-format config +printf -- '\033[33m Symlinking clang-format config\n\033[37m' +ln -sf ~/code_server/clang-format ~/.clang-format + +# Symlink lazygit config +printf -- '\033[33m Symlinking lazygit config\n\033[37m' +mkdir -p ~/.config/lazygit +ln -sf ~/code_server/config/lazygit/config.yml ~/.config/lazygit/config.yml + +# Symlink starsihp config +printf -- '\033[33m Symlinking starship config\n\033[37m' +ln -sf ~/code_server/config/starship.toml ~/.config/starship.toml + +# Symlink luacheck config +printf -- '\033[33m Symlinking luacheck config\n\033[37m' +ln -sf ~/code_server/luacheckrc ~/.luacheckrc + +# Symlink rp2040 flash script +printf -- '\033[33m Symlinking rp2040 flash script\n\033[37m' +mkdir -p ~/.local/bin +ln -sf ~/code_server/pico-load.sh ~/.local/bin/pico-load + +# Symlink blerc +printf -- '\033[33m Symlinking blerc config\n\033[37m' +ln -sf ~/code_server/blerc ~/.blerc + +# Symlink update script +printf -- '\033[33m Symlinking update wrapper\n\033[37m' +mkdir -p ~/.local/bin +ln -sf ~/code_server/update_wrapper.sh ~/.local/bin/update + +# Symlink bashrc +printf -- '\033[33m Symlinking bashrc config\n\033[37m' +ln -sf ~/code_server/bashrc ~/.bashrc + +printf -- '\033[32m \n\n***** Update complete! Please restart your terminal. *****\n\n\033[37m' diff --git a/update_ubuntu.sh b/update_ubuntu.sh new file mode 100755 index 0000000..0aa962e --- /dev/null +++ b/update_ubuntu.sh @@ -0,0 +1,384 @@ +#!/bin/bash +set -e + +if [ -f /etc/os-release ]; then + # freedesktop.org and systemd + . /etc/os-release + OS=$NAME + VER=$VERSION_ID +else + OS="none" + VER="0" +fi + +if [ "$(dpkg -l | awk '/ubuntu-desktop/ {print }' | wc -l)" -ge 1 ]; then + DESKTOP="yes" +else + DESKTOP="no" +fi + +if [ "$(systemd-detect-virt)" == "wsl" ]; then + WSL="yes" +else + WSL="no" +fi + +# *** System applications *** +printf -- '\033[32m *** System applications ***\n\033[37m' + +# Ubuntu 20.04 workaround +sudo apt -y purge --auto-remove neovim + +# Install system packages +printf -- '\033[33m Installing system packages\n\033[37m' +sudo apt update +sudo apt upgrade -y +sudo apt install -y gawk imagemagick gpg ninja-build gettext cmake unzip curl build-essential libssl-dev libffi-dev file tmux libudev-dev pkg-config locales btop ncdu ranger + +# Setup locals +printf -- '\033[33m Setup locals\n\033[37m' +sudo locale-gen "en_US.UTF-8" +sudo update-locale LANG=en_US.UTF-8 + +# Install python +printf -- '\033[33m Installing python\n\033[37m' +sudo apt install -y python3 python3-pip python3-venv python3-dev pipx +if [ "$VER" == "22.04" ]; then + pip3 install pynvim +else + sudo apt install -y python3-pynvim +fi + +# Install fzf +printf -- '\033[33m Installing fzf\n\033[37m' +rm -rf ~/.fzf +git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf +~/.fzf/install --all +source ~/.fzf.bash + +# # Install VirtualHere server +# curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh + +# Install VirtualHere client +printf -- '\033[33m Installing VirtualHere client\n\033[37m' +cd ~ +wget https://www.virtualhere.com/sites/default/files/usbclient/scripts/virtualhereclient.service +wget https://www.virtualhere.com/sites/default/files/usbclient/vhclientx86_64 +chmod +x ./vhclientx86_64 +sudo mv ./vhclientx86_64 /usr/sbin +echo "$USER ALL=(ALL:ALL) NOPASSWD: /usr/sbin/vhclientx86_64" | sudo tee /etc/sudoers.d/$USER+vhclientx86_64 +sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service +# sudo systemctl daemon-reload +# sudo systemctl enable virtualhereclient.service +# sudo systemctl start virtualhereclient.service + +# Install teensy udev rules (only for non docker system) +if [ ! -f /.dockerenv ]; then + printf -- '\033[33m Installing teensy udev rules\n\033[37m' + sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules + sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo service udev restart + sudo udevadm control --reload-rules + sudo udevadm trigger +fi + +# Install neovim +printf -- '\033[33m Installing neovim\n\033[37m' +cd ~ +if [ -d ~/neovim ]; then rm -rf ~/neovim; fi +git clone https://github.com/neovim/neovim +cd neovim && git checkout stable +make CMAKE_BUILD_TYPE=RelWithDebInfo +cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb +if [ -d ~/neovim ]; then rm -rf ~/neovim; fi + +# Install fd +printf -- '\033[33m Installing fd\n\033[37m' +sudo apt install -y fd-find + +# Install lazygit +printf -- '\033[33m Installing lazygit\n\033[37m' +cd ~ +LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') +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 +printf -- '\033[33m Installing gdu\n\033[37m' +if [ $VER = "22.04" ]; then + sudo add-apt-repository -y ppa:daniel-milde/gdu +fi +sudo apt update +sudo apt install -y gdu + +# Install ruby +printf -- '\033[33m Installing ruby\n\033[37m' +sudo apt install -y ruby ruby-dev +sudo gem install neovim + +# Install bottom +printf -- '\033[33m Installing bottom\n\033[37m' +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 +printf -- '\033[33m Installing go\n\033[37m' +sudo apt install -y golang + +# Install php +printf -- '\033[33m Installing php\n\033[37m' +sudo apt install -y php php-curl php-xml php-mbstring + +# Install luarocks +printf -- '\033[33m Installing luarocks\n\033[37m' +sudo apt install -y luarocks + +# Install composer +printf -- '\033[33m Installing composer\n\033[37m' +sudo apt install -y composer + +# Install java +printf -- '\033[33m Installing java\n\033[37m' +sudo apt install -y default-jdk + +# Install julia +printf -- '\033[33m Installing julia\n\033[37m' +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 -sf /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 +printf -- '\033[33m Installing node\n\033[37m' +cd ~ +curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - +sudo apt install -y nodejs +npm config set prefix "${HOME}/.npm" + +# Install ble.sh +printf -- '\033[33m Installing ble.sh\n\033[37m' +if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi +cd ~ +git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git +#make -C ble.sh install PREFIX=~/.local +make -C ble.sh install +if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi + +# Install platformio +printf -- '\033[33m Installing platformio\n\033[37m' +if [ "$VER" == "24.04" ]; then + pipx install platformio + pipx ensurepath +else + pip3 install platformio +fi + +# Install neovim for node +printf -- '\033[33m Installing neovim for node\n\033[37m' +sudo npm install -g neovim + +# Install rust +printf -- '\033[33m Installing Rust\n\033[37m' +cd ~ +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y +source "$HOME/.cargo/env" +rustup self update +rustup update stable +rustup default stable + +# Install rust embedded stuff +printf -- '\033[33m Installing Rust embedded stuff\n\033[37m' +cd ~ +rustup target add thumbv6m-none-eabi +cargo install elf2uf2-rs --locked +cargo install probe-run + +# Install tree sitter cli +printf -- '\033[33m Installing tree sitter cli\n\033[37m' +cd ~ +cargo install tree-sitter-cli + +# Install ripgrep +printf -- '\033[33m Installing ripgrep\n\033[37m' +cargo install ripgrep + +# Install eza +printf -- '\033[33m Installing eza\n\033[37m' +cargo install eza + +# Install zoxide +printf -- '\033[33m Installing zoxide\n\033[37m' +cargo install zoxide --locked + +# Install starship +printf -- '\033[33m Installing starship\n\033[37m' +cargo install starship --locked + +# *** Desktop applications *** +printf -- '\033[32m *** Desktop applications ***\n\033[37m' + +if [ "$DESKTOP" == "yes" ]; then + # Install flatpak + printf -- '\033[33m Installing desktop dep.\n\033[37m' + sudo add-apt-repository -y ppa:flatpak/stable + sudo apt update + sudo apt install -y flatpak + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + + printf -- '\033[33m Installing Flatseal\n\033[37m' + flatpak install -y flathub com.github.tchx84.Flatseal + + printf -- '\033[33m Installing Krita\n\033[37m' + flatpak install -y flathub org.kde.krita + + printf -- '\033[33m Installing KiCad\n\033[37m' + flatpak install -y flathub org.kicad.KiCad + + printf -- '\033[33m Installing FreeCad\n\033[37m' + flatpak install -y flathub org.freecadweb.FreeCAD + + printf -- '\033[33m Installing Moonlight\n\033[37m' + flatpak install -y flathub com.moonlight_stream.Moonlight + + printf -- '\033[33m Installing DrawIo\n\033[37m' + flatpak install -y flathub com.jgraph.drawio.desktop + + # Install VSCode + printf -- '\033[33m Installing VSCode\n\033[37m' + sudo snap install --classic code + + # Install gnome-shell-extension-manager + printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m' + sudo apt install -y gnome-shell-extension-manager + + # Install gnome tweaks + printf -- '\033[33m Installing gnome tweaks\n\033[37m' + sudo apt install -y gnome-tweaks + + # Install remmina + printf -- '\033[33m Installing remmina\n\033[37m' + sudo apt install -y remmina + + # Install feh + printf -- '\033[33m Installing feh\n\033[37m' + sudo apt install -y feh + + # Install NerdFonts + printf -- '\033[33m Installing NerdFonts\n\033[37m' + mkdir -p /home/$USER/.local/share/fonts + cd /home/$USER/.local/share/fonts + wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip + unzip -o CodeNewRoman.zip + rm CodeNewRoman.zip + wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip + unzip -o NerdFontsSymbolsOnly.zip + rm NerdFontsSymbolsOnly.zip + fc-cache -fv + + # Install Wezterm + printf -- '\033[33m Installing wezterm\n\033[37m' + curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg + echo 'deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' | sudo tee /etc/apt/sources.list.d/wezterm.list + sudo apt update + sudo apt install -y wezterm + + # Install Brave Browser + printf -- '\033[33m Installing Brave Browser\n\033[37m' + sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list + sudo apt update + sudo apt install -y brave-browser + + # Install Virtualbox + printf -- '\033[33m Installing Virtualbox\n\033[37m' + curl https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor >oracle_vbox_2016.gpg + curl https://www.virtualbox.org/download/oracle_vbox.asc | gpg --dearmor >oracle_vbox.gpg + sudo install -o root -g root -m 644 oracle_vbox_2016.gpg /etc/apt/trusted.gpg.d/ + sudo install -o root -g root -m 644 oracle_vbox.gpg /etc/apt/trusted.gpg.d/ + echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list + sudo apt update + sudo apt install -y linux-headers-"$(uname -r)" dkms + sudo apt install virtualbox-7.1 -y + wget https://download.virtualbox.org/virtualbox/7.1.4/Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack + sudo VBoxManage extpack install --replace Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack --accept-license=eb31505e56e9b4d0fbca139104da41ac6f6b98f8e78968bdf01b1f3da3c4f9ae + sudo usermod -a -G vboxusers "$USER" + + printf -- '\033[33m Installing Audio control\n\033[37m' + if [ $VER == "22.04" ]; then + # Install helvum + sudo apt install -y pavucontrol + fi + if [ $VER == "24.04" ]; then + # Install helvum + sudo apt install -y pavucontrol helvum + fi + + # Install timeshift + printf -- '\033[33m Installing Timeshift\n\033[37m' + sudo apt install -y timeshift + +fi + +# *** Dotfile symlinking *** +printf -- '\033[32m *** Dotfile symlinking ***\n\033[37m' + +# Symlink wezterm config +printf -- '\033[33m Symlinking wezterm config\n\033[37m' +ln -sf ~/code_server/wezterm.lua ~/.wezterm.lua + +# Symlink nvim config +printf -- '\033[33m Symlinking nvim config\n\033[37m' +mkdir -p ~/.config/nvim +ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua + +# Symlink git config +printf -- '\033[33m Symlinking git config\n\033[37m' +ln -sf ~/code_server/gitconfig ~/.gitconfig + +# Symlink tmux config +printf -- '\033[33m Symlinking tmux config\n\033[37m' +ln -sf ~/code_server/tmux.conf ~/.tmux.conf + +# Symlink clang-format config +printf -- '\033[33m Symlinking clang-format config\n\033[37m' +ln -sf ~/code_server/clang-format ~/.clang-format + +# Symlink lazygit config +printf -- '\033[33m Symlinking lazygit config\n\033[37m' +mkdir -p ~/.config/lazygit +ln -sf ~/code_server/config/lazygit/config.yml ~/.config/lazygit/config.yml + +# Symlink starsihp config +printf -- '\033[33m Symlinking starship config\n\033[37m' +ln -sf ~/code_server/config/starship.toml ~/.config/starship.toml + +# Symlink luacheck config +printf -- '\033[33m Symlinking luacheck config\n\033[37m' +ln -sf ~/code_server/luacheckrc ~/.luacheckrc + +# Symlink rp2040 flash script +printf -- '\033[33m Symlinking rp2040 flash script\n\033[37m' +mkdir -p ~/.local/bin +ln -sf ~/code_server/pico-load.sh ~/.local/bin/pico-load + +# Symlink blerc +printf -- '\033[33m Symlinking blerc config\n\033[37m' +ln -sf ~/code_server/blerc ~/.blerc + +# Symlink update script +printf -- '\033[33m Symlinking update wrapper\n\033[37m' +mkdir -p ~/.local/bin +ln -sf ~/code_server/update_wrapper.sh ~/.local/bin/update + +# Symlink bashrc +printf -- '\033[33m Symlinking bashrc config\n\033[37m' +ln -sf ~/code_server/bashrc ~/.bashrc + +printf -- '\033[32m \n\n***** Update complete! Please restart your terminal. *****\n\n\033[37m' diff --git a/update_wrapper.sh b/update_wrapper.sh index 9e22325..d4f92b2 100755 --- a/update_wrapper.sh +++ b/update_wrapper.sh @@ -1,13 +1,24 @@ #!/bin/bash set -e +if [ -f /etc/os-release ]; then + . /etc/os-release + OS=$NAME +else + OS="none" +fi + if [ ! -d ~/code_server ]; then - cd ~ && - git clone https://git.cmtec.se/cm/code_server.git + cd ~ && + git clone https://git.cmtec.se/cm/code_server.git fi if [ -d ~/code_server ]; then - cd ~/code_server && - git pull && - ./update.sh + cd ~/code_server && + git pull && + if [ "$OS" == "Ubuntu" ]; then + ./update_ubuntu.sh + elif [ "$OS" == "Arch Linux" ]; then + ./update_arch.sh + fi fi