Compare commits

..

2 Commits

Author SHA1 Message Date
f5f48c0fdf Stow replaces old configs 2026-01-09 01:17:23 +01:00
1cab699dac Custom spinner 2026-01-09 01:10:55 +01:00
2 changed files with 72 additions and 42 deletions

View File

@@ -2,14 +2,41 @@
set -e
sudo -v || exit 1
###################
## Spinner stuff ##
###################
# keep sudo alive until script exits
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
done 2>/dev/null &
execute_with_spinner() {
local title="$1"
shift
spinner='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
local i=0
draw_status() {
tput sc
tput cup $(($(tput lines) - 1)) 0
printf "%s %s" "${spinner:i++%${#spinner}:1}" "$title"
tput el
tput rc
}
while sleep 0.05; do
draw_status
done &
SPIN_PID=$!
"$@"
local status=$?
kill "$SPIN_PID"
wait "$SPIN_PID" 2>/dev/null || true
echo
return $status
}
#########################
## gum style variables ##
@@ -18,7 +45,7 @@ done 2>/dev/null &
GUM_SPIN_SPINNER="minidot"
GUM_SPIN_SHOW_OUTPUT="true"
sudo -v
sudo -v || exit 1
####################
## Installing gum ##
@@ -26,7 +53,7 @@ sudo -v
if ! command -v gum &>/dev/null; then
echo "Installing gum"
sudo pacman -S --needed --noconfirm gum
execute_with_spinner "Installing gum" sudo pacman -S --needed --noconfirm gum
fi
###################################
@@ -34,19 +61,19 @@ fi
###################################
if ! command -v yay &>/dev/null; then
sudo -v
sudo -v || exit 1
# gum spin --title "Installing yay dependencies" -- \
sudo pacman -S base-devel git --needed --noconfirm
execute_with_spinner "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
execute_with_spinner "Cloning yay-bin from AUR" git clone https://aur.archlinux.org/yay-bin.git $TEMP_DIR/yay
cd $TEMP_DIR/yay
sudo -v
sudo -v || exit 1
# gum spin --title "Installing yay" -- \
makepkg -si --noconfirm
execute_with_spinner "Installing yay" makepkg -si --noconfirm
fi
#############################
@@ -86,9 +113,9 @@ mapfile -t extratools < <(
## Installing stow ##
#####################
sudo -v
sudo -v || exit 1
# gum spin --title "Installing GNU Stow" -- \
yay -S --needed --noconfirm stow
execute_with_spinner "Installing GNU Stow" yay -S --needed --noconfirm stow
######################
## Applying configs ##
@@ -97,9 +124,9 @@ yay -S --needed --noconfirm stow
for choice in "${desktop[@]}"; do
case "$choice" in
"Niri")
sudo -v
sudo -v || exit 1
# gum spin --title "Installing niri alongside required packages" -- \
yay -S --needed --noconfirm \
execute_with_spinner "Installing niri and required packages" yay -S --needed --noconfirm \
niri \
ly \
nautilus \
@@ -111,7 +138,7 @@ for choice in "${desktop[@]}"; do
qt6ct-kde \
xdg-desktop-portal-gnome
stow niri qt6ct --override
stow niri qt6ct --adopt
curl -fsSL https://install.danklinux.com | sh
@@ -121,9 +148,9 @@ for choice in "${desktop[@]}"; do
;;
"KDE Plasma")
sudo -v
sudo -v || exit 1
# gum spin --title "Installing KDE Plasma" -- \
pacman -S --needed --noconfirm plasma kde-applications
execute_with_spinner "Installing KDE Plasma" pacman -S --needed --noconfirm plasma kde-applications
sudo systemctl enable sddm
;;
esac
@@ -132,9 +159,9 @@ done
for choice in "${tools[@]}"; do
case "$choice" in
"Terminal")
sudo -v
sudo -v || exit 1
# gum spin --title "Installing Terminal packages..." -- \
yay -S --needed --noconfirm \
"Installing Terminal packages" yay -S --needed --noconfirm \
fastfetch \
hyfetch \
neovim \
@@ -147,52 +174,53 @@ for choice in "${tools[@]}"; do
wl-clipboard \
zoxide \
reflector
stow fastfetch hyfetch nvim zsh --override
stow fastfetch hyfetch nvim zsh --adopt
# gum spin --title "Updating Tealdeer database" -- \
tldr --update
execute_with_spinner "Updating Tealdeer database" tldr --update
;;
"Terminal Emulator")
sudo -v
sudo -v || exit 1
# gum spin --title "Installing Terminal Emulator..." -- \
yay -S --needed --noconfirm \
execute_with_spinner "Installing Terminal Emulator" yay -S --needed --noconfirm \
ghostty
stow ghostty --override
stow ghostty --adopt
;;
"Gaming")
sudo -v
sudo -v || exit 1
# gum spin --title "Installing Gaming Packages..." -- \
yay -S --needed --noconfirm \
execute_with_spinner "Installing Gaming packages" yay -S --needed --noconfirm \
mangohud \
gamemode \
steam \
prismlauncher \
heroic-games-launcher-bin \
arrpc
stow mangohud --override
stow mangohud --adopt
sudo -v
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
sudo -v || exit 1
# gum spin --title "Installing VR Gaming Packages..." -- \
yay -S --needed --noconfirm \
execute_with_spinner "Installing VR Gaming packages" yay -S --needed --noconfirm \
alvr-launcher-bin \
wlx-overlay-s-bin
;;
"Hamr Sticker Picker")
sudo -v
sudo -v || exit 1
# gum spin --title "Installing hamr..." -- \
yay -S --needed --noconfirm \
execute_with_spinner "Installing hamr" yay -S --needed --noconfirm \
hamr
stow hamr-sticker-picker --override
stow hamr-sticker-picker --adopt
systemctl --user enable hamr.service
systemctl --user add-wants niri.service hamr.service
@@ -207,12 +235,12 @@ for choice in "${extratools[@]}"; do
case "$choice" in
"Godot")
extrapkgs+=("godots-bin")
stow godot --override
stow godot --adopt
;;
"Fuzzel")
extrapkgs+=("fuzzel")
stow fuzzel --override
stow fuzzel --adopt
;;
"Btop") extrapkgs+=("btop") ;;
@@ -230,6 +258,8 @@ extpkgstr=$(
echo "${extrapkgs[*]}"
)
sudo -v
sudo -v || exit 1
# gum spin --title "Installing extra packages" -- \
yay -S --needed --noconfirm "$extpkgstr"
execute_with_spinner "Installing extra packages" yay -S --needed --noconfirm "$extpkgstr"
git reset --hard HEAD

View File

@@ -17,7 +17,7 @@ if ! command -v yay &>/dev/null; then
fi
echo "Installing packages"
sudo -v
sudo -v || exit 1
yay -S --noconfirm --needed - <$DOTFILES_DIR/packages.txt
echo "Changing default shell"