#!/usr/bin/env bash set -e DOTSDIR=$(pwd) ######################### ## gum style variables ## ######################### # GUM_SPIN_SPINNER="minidot" # GUM_SPIN_SHOW_OUTPUT="true" sudo -v || exit 1 #################### ## Installing gum ## #################### if ! command -v gum &>/dev/null; then echo "Installing gum" sudo pacman -S --needed --noconfirm gum fi ################################### ## Installing yay & dependencies ## ################################### if ! command -v yay &>/dev/null; then sudo -v || exit 1 # gum spin --title "Installing yay dependencies" -- \ sudo pacman -S base-devel git --needed --noconfirm TEMP_DIR=$(mktemp -d) # gum spin --title "Cloning yay-bin from AUR" -- \ git clone https://aur.archlinux.org/yay-bin.git "$TEMP_DIR"/yay cd "$TEMP_DIR"/yay sudo -v || exit 1 # gum spin --title "Installing yay" -- \ makepkg -si --noconfirm fi cd "$DOTSDIR" ############################# ## Configuration Selection ## ############################# mapfile -t desktop < <( gum choose --header="Choose desktop configuration:" \ "Niri" \ "KDE Plasma" \ "None" ) mapfile -t tools < <( gum choose --header="Choose tools to install:" --no-limit \ "Terminal" \ "Terminal Emulator" \ "Gaming" \ "VR Gaming" \ "Hamr Sticker Picker" \ "CUPS Printing Support" ) mapfile -t extratools < <( gum choose --header="Choose extra tools to install:" --no-limit \ "Godot" \ "Btop" \ "Fuzzel" \ "Ncdu" \ "Linja Pona [Font]" \ "Vesktop" \ "Nextcloud" \ "Zen Browser" \ "Tailscale" ) ##################### ## Installing stow ## ##################### sudo -v || exit 1 # gum spin --title "Installing GNU Stow" -- \ yay -S --needed --noconfirm stow ###################### ## Applying configs ## ###################### for choice in "${desktop[@]}"; do case "$choice" in "Niri") sudo -v || exit 1 # gum spin --title "Installing niri alongside required packages" -- \ yay -S --needed --noconfirm \ niri \ nautilus \ gnome-keyring \ brightnessctl \ cava \ candy-icons-git \ power-profiles-daemon \ qt6ct-kde \ xdg-desktop-portal-gnome \ xdg-desktop-portal-gtk \ xdg-desktop-portal-wlr \ quickshell \ cava \ cliphist \ wl-clipboard \ dgop \ matugen-bin \ qt6-multimedia \ dms-shell-bin \ xwayland-satellite \ ly # greetd-dms-greeter-git stow niri qt6ct --adopt xdg-mime default org.gnome.nautilus.desktop inode/directory systemctl --user enable dms systemctl --user add-wants niri.service dms # dms greeter enable # dms greeter sync sudo systemctl enable ly@tty1 ;; "KDE Plasma") sudo -v || exit 1 # gum spin --title "Installing KDE Plasma" -- \ pacman -S --needed --noconfirm plasma kde-applications sudo systemctl enable sddm ;; esac done for choice in "${tools[@]}"; do case "$choice" in "Terminal") sudo -v || exit 1 # gum spin --title "Installing Terminal packages..." -- \ yay -S --needed --noconfirm \ fastfetch \ hyfetch \ neovim \ zsh \ eza \ fzf \ tealdeer \ ttf-sourcecodepro-nerd \ vim \ wl-clipboard \ zoxide \ reflector \ inetutils # sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/ohmyzsh/ohmyzsh "$HOME"/.oh-my-zsh stow fastfetch hyfetch nvim zsh --adopt # gum spin --title "Updating Tealdeer database" -- \ tldr --update chsh -s /bin/zsh "$USER" ;; "Terminal Emulator") sudo -v || exit 1 # gum spin --title "Installing Terminal Emulator..." -- \ yay -S --needed --noconfirm \ ghostty stow ghostty --adopt ;; "Gaming") sudo -v || exit 1 # gum spin --title "Installing Gaming Packages..." -- \ yay -S --needed --noconfirm \ mangohud \ gamemode \ steam \ prismlauncher \ heroic-games-launcher-bin \ arrpc stow mangohud --adopt sudo -v || exit 1 # gum spin --spinner minidot --title "Applying arrpy systemd fix..." -- \ sudo cp /usr/lib/systemd/user/arrpc.service /etc/systemd/system/arrpc.service && sudo systemctl enable arrpc --now ;; "VR Gaming") sudo -v || exit 1 # gum spin --title "Installing VR Gaming Packages..." -- \ yay -S --needed --noconfirm \ alvr-launcher-bin \ wlx-overlay-s-bin ;; "Hamr Sticker Picker") sudo -v || exit 1 # gum spin --title "Installing hamr..." -- \ yay -S --needed --noconfirm \ hamr stow hamr-sticker-picker --adopt systemctl --user enable hamr.service systemctl --user add-wants niri.service hamr.service systemctl --user start hamr.service ;; "CUPS Printing Support") sudo -v || exit 1 yay -S --needed --noconfirm \ cups sudo systemctl enable cups ;; esac done extrapkgs=() for choice in "${extratools[@]}"; do case "$choice" in "Godot") extrapkgs+=("godots-bin") stow godot --adopt ;; "Fuzzel") extrapkgs+=("fuzzel") stow fuzzel --adopt ;; "Btop") extrapkgs+=("btop") ;; "Ncdu") extrapkgs+=("ncdu") ;; "Linja Pona [Font]") extrapkgs+=("otf-linja-pona") ;; "Vesktop") extrapkgs+=("vesktop") ;; "Nextcloud") extrapkgs+=("nextcloud-client") ;; "Zen Browser") extrapkgs+=("zen-browser-bin") ;; "Tailscale") extrapkgs+=("tailscale") ;; esac done extpkgstr=$( IFS=" " echo "${extrapkgs[*]}" ) sudo -v || exit 1 yay -S --needed --noconfirm $extpkgstr git add . git reset --hard HEAD git submodule update --recursive --init git remote remove origin git remote add origin ssh://git@gitea.sparkle.gay:9173/vivian/.dotfiles.git git config --global init.defaultBranch main git config --global user.name "Vivian Elisabeth H" git config --global user.email "36878099+SparkleDEV@users.noreply.github.com"