From 5b747f1c9faa05737f20a205ea8d8eb46fcf6110 Mon Sep 17 00:00:00 2001 From: wholteza Date: Mon, 22 Sep 2025 10:16:55 +0000 Subject: [PATCH] Reattach tmux + headless install --- .bashrc | 4 ++- .config/requirements/install.sh | 61 ++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/.bashrc b/.bashrc index 0e73884..dfcbf97 100644 --- a/.bashrc +++ b/.bashrc @@ -185,5 +185,7 @@ export ompPath="$HOME/.config/oh-my-posh/theme.omp.json" ### Start oh my posh eval "$(oh-my-posh init bash --config $ompPath)" ### Start tmux if not already in a session -[[ -z "$TMUX" ]] && exec tmux +if [[ -z "$TMUX" ]]; then + tmux attach || tmux new +fi . "$HOME/.cargo/env" diff --git a/.config/requirements/install.sh b/.config/requirements/install.sh index 41b6ea8..7bc053f 100755 --- a/.config/requirements/install.sh +++ b/.config/requirements/install.sh @@ -1,15 +1,48 @@ +graphical=false +for arg in "$@"; do + if [[ $arg == "--graphical" ]]; then + graphical=true + break + fi +done sudo apt update +sudo apt install \ + feh \ + wget \ + curl \ + neofetch \ + bashtop \ + htop \ + build-essential \ + cmake \ + pkg-config \ + python3 \ + wireguard \ + -y + +# Dependencies for cargo +sudo snap install rustup --classic +rustup default stable +rustup update +# Oh my posh +curl -s https://ohmyposh.dev/install.sh | sudo bash -s +# Node version manager +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash +# Install nvim +curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz +sudo rm -rf /opt/nvim +sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz + +if $graphical; then sudo apt install \ i3 \ i3blocks \ i3lock \ suckless-tools \ arandr \ - feh \ scrot \ - wget \ gnupg2 \ gnupg-agent \ dirmngr \ @@ -21,23 +54,14 @@ sudo apt install \ yubikey-personalization \ solaar \ cifs-utils \ - curl \ rofi \ brightnessctl \ - neofetch \ - bashtop \ - htop \ - build-essential \ - cmake \ - pkg-config \ libfreetype6-dev \ libfontconfig1-dev \ libxcb-xfixes0-dev \ libxkbcommon-dev \ - python3 \ dunst \ nvme-cli \ - wireguard \ -y # Remove ibus since it causes issues with my custom keyboard layout @@ -59,19 +83,12 @@ sudo snap install heroic sudo snap install freecad sudo snap install thunderbird -# Dependencies for cargo -sudo snap install rustup --classic -rustup default stable -rustup update # Cargo packages ## Alacritty needs to be installed with cargo to get the version that supports toml configurations cargo install alacritty cargo install battop -curl -s https://ohmyposh.dev/install.sh | sudo bash -s -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - # Access to brightness devices for brightnessctl sudo usermod -aG video wholteza @@ -81,11 +98,9 @@ gpg --decrypt /home/wholteza/.config/wireguard/got58-got80.conf.gpg > /home/whol # Xorg configs sudo cp /home/wholteza/.config/X11/xorg.conf.d/* /etc/X11/xorg.conf.d/ -# Install nvim -curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz -sudo rm -rf /opt/nvim -sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz + +fi + source ~/.bashrc echo Done! -