From d3974332a6322799aa2fc4dbac5e11603131b2c4 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Sun, 7 Jan 2024 02:24:12 -0500 Subject: [PATCH] modular setup --- scripts/copy_and_link | 3 +- scripts/install_arch | 145 +++++++++++++++++++++++++----------------- setup | 24 ++++++- 3 files changed, 109 insertions(+), 63 deletions(-) diff --git a/scripts/copy_and_link b/scripts/copy_and_link index 74b2bf5..9ad09f0 100755 --- a/scripts/copy_and_link +++ b/scripts/copy_and_link @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # Copy configs and make a backup if it already exists echo -e "\nInstalling Configs..." for file in configs/* @@ -21,4 +23,3 @@ cp -rbv bin $HOME/.local echo -e "\nLinking shell..." cp -sbv $HOME/.config/shell/profile ~/.zprofile cp -sbv $HOME/.config/x11/xinitrc ~/.xinitrc - diff --git a/scripts/install_arch b/scripts/install_arch index ed13610..31ec4ff 100755 --- a/scripts/install_arch +++ b/scripts/install_arch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Full (probably) setup for arch @@ -7,6 +7,7 @@ set -e # Install yay cd if ! type "yay" &> /dev/null; then + echo "Yay not found, installing..." if test -d yay; then @@ -22,65 +23,89 @@ else echo -e "\nYay is already installed, skipping..." fi -# Install deps -echo -e "\nInstalling dependencies..." -yay -S --needed --noconfirm \ -alacritty \ -alsa-utils \ -arandr \ -awesome \ -bat \ -beautiful-discord-git \ -bluez \ -btop \ -byobu \ -caprine \ -chromium \ -discord \ -firefox-developer-edition \ -fzf \ -gimp \ -lf \ -light \ -maim \ -man-db \ -man-pages \ -mosh \ -mpd \ -neovim \ -nitrogen \ -nnn \ -nvim-packer-git \ -oh-my-zsh-git \ -otf-font-awesome \ -picom \ -playerctl \ -polkit-gnome \ -powerline-fonts \ -python-pywal \ -python-pywalfox \ -pywal-discord-git \ -rar \ -redshift \ -ripgrep \ -rsync \ -sl \ -spotify-launcher \ -steam \ -sxiv \ -telegram-desktop \ -thunderbird \ -ttf-font-awesome \ -unclutter \ -upower \ -wal-telegram-git \ -wget \ -xclip \ -xorg-server \ -xorg-xinit \ -xorg-xrandr \ -zsh \ +# Install base shell +if [ $1 -ge 1 ]; then + + echo -e "\nInstalling base shell..." + yay -S --needed --noconfirm \ + bat \ + btop \ + byobu \ + fd \ + fzf \ + gimp \ + man-db \ + man-pages \ + mosh \ + neovim \ + nnn \ + oh-my-zsh-git \ + rar \ + ripgrep \ + rsync \ + sl \ + wget \ + zsh \ + +fi + +# Install basic GUI +if [ $1 -ge 2 ]; then + + echo -e "\nInstalling basic GUI..." + yay -S --needed --noconfirm \ + alacritty \ + alsa-utils \ + arandr \ + awesome \ + bluez \ + chromium \ + firefox-developer-edition \ + light \ + maim \ + mpd \ + otf-font-awesome \ + picom \ + playerctl \ + polkit-gnome \ + powerline-fonts \ + python-pywal \ + redshift \ + sxiv \ + ttf-font-awesome \ + unclutter \ + upower \ + xclip \ + xorg-server \ + xorg-xinit \ + xorg-xrandr \ + +fi + +# Install extras +if [ $1 -ge 3 ]; then + + echo -e "\nInstalling extras..." + yay -S --needed --noconfirm \ + beautiful-discord-git \ + caprine \ + discord \ + python-pywalfox \ + pywal-discord-git \ + spotify-launcher \ + steam \ + telegram-desktop \ + thunderbird \ + wal-telegram-git \ + +fi # Set shell echo "" -sudo chsh -s /bin/zsh $USER +if [ $SHELL == "/bin/zsh" ]; then + echo "Shell already set to zsh" + +else + sudo chsh -s /bin/zsh $USER + echo -e "\nLog out and back in for changes to take effect." +fi diff --git a/setup b/setup index 3568ab1..4d373c2 100755 --- a/setup +++ b/setup @@ -2,6 +2,26 @@ set -e +echo "Choose your adventure: +============================ +1. Shell/CLI stuff only +2. Above plus basic GUI +3. Above plus extras like steam, messengers (bloat) +" +read -p "Enter number[1-3]: " input + +if ! [ "$input" -eq "$input" ] 2> /dev/null; then + + echo "Error: Not a number" + exit 1 + +elif [ $input -lt 1 ] || [ $input -gt 3 ]; then + + echo "Error: Input out of range" + exit 1 + +fi + # Trigger sudo prompt before less can block password input sudo echo '' @@ -47,7 +67,7 @@ if [[ $OS == *Arch* ]]; then git clone https://github.com/adoyle0/Doors.git .doors fi - $HOME/.doors/scripts/install_arch + $HOME/projects/Doors/scripts/install_arch $input # These are broken for now # elif [[ $OS == *buntu* ]]; then @@ -73,7 +93,7 @@ git submodule init && git submodule update # Copy and link files cd $HOME/.doors && -$HOME/.doors/scripts/copy_and_link +$HOME/.doors/scripts/copy_and_link $input # Copy default wallpaper if ! test -d $HOME/Pictures; then