Compare commits
3 Commits
45f737da37
...
0861bf8855
| Author | SHA1 | Date | |
|---|---|---|---|
| 0861bf8855 | |||
| 8a59d90006 | |||
| 16aaa9f5bb |
66
install.sh
66
install.sh
@@ -2,42 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
###################
|
|
||||||
## Spinner stuff ##
|
|
||||||
###################
|
|
||||||
|
|
||||||
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 ##
|
## gum style variables ##
|
||||||
#########################
|
#########################
|
||||||
@@ -53,7 +17,7 @@ sudo -v || exit 1
|
|||||||
|
|
||||||
if ! command -v gum &>/dev/null; then
|
if ! command -v gum &>/dev/null; then
|
||||||
echo "Installing gum"
|
echo "Installing gum"
|
||||||
execute_with_spinner "Installing gum" sudo pacman -S --needed --noconfirm gum
|
sudo pacman -S --needed --noconfirm gum
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
@@ -63,17 +27,19 @@ fi
|
|||||||
if ! command -v yay &>/dev/null; then
|
if ! command -v yay &>/dev/null; then
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing yay dependencies" -- \
|
# gum spin --title "Installing yay dependencies" -- \
|
||||||
execute_with_spinner "Installing yay dependencies" sudo pacman -S base-devel git --needed --noconfirm
|
sudo pacman -S base-devel git --needed --noconfirm
|
||||||
|
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
|
|
||||||
# gum spin --title "Cloning yay-bin from AUR" -- \
|
# gum spin --title "Cloning yay-bin from AUR" -- \
|
||||||
execute_with_spinner "Cloning yay-bin from AUR" git clone https://aur.archlinux.org/yay-bin.git $TEMP_DIR/yay
|
git clone https://aur.archlinux.org/yay-bin.git $TEMP_DIR/yay
|
||||||
cd $TEMP_DIR/yay
|
cd $TEMP_DIR/yay
|
||||||
|
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing yay" -- \
|
# gum spin --title "Installing yay" -- \
|
||||||
execute_with_spinner "Installing yay" makepkg -si --noconfirm
|
makepkg -si --noconfirm
|
||||||
|
|
||||||
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
@@ -115,7 +81,7 @@ mapfile -t extratools < <(
|
|||||||
|
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing GNU Stow" -- \
|
# gum spin --title "Installing GNU Stow" -- \
|
||||||
execute_with_spinner "Installing GNU Stow" yay -S --needed --noconfirm stow
|
yay -S --needed --noconfirm stow
|
||||||
|
|
||||||
######################
|
######################
|
||||||
## Applying configs ##
|
## Applying configs ##
|
||||||
@@ -126,7 +92,7 @@ for choice in "${desktop[@]}"; do
|
|||||||
"Niri")
|
"Niri")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing niri alongside required packages" -- \
|
# gum spin --title "Installing niri alongside required packages" -- \
|
||||||
execute_with_spinner "Installing niri and required packages" yay -S --needed --noconfirm \
|
yay -S --needed --noconfirm \
|
||||||
niri \
|
niri \
|
||||||
ly \
|
ly \
|
||||||
nautilus \
|
nautilus \
|
||||||
@@ -150,7 +116,7 @@ for choice in "${desktop[@]}"; do
|
|||||||
"KDE Plasma")
|
"KDE Plasma")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing KDE Plasma" -- \
|
# gum spin --title "Installing KDE Plasma" -- \
|
||||||
execute_with_spinner "Installing KDE Plasma" pacman -S --needed --noconfirm plasma kde-applications
|
pacman -S --needed --noconfirm plasma kde-applications
|
||||||
sudo systemctl enable sddm
|
sudo systemctl enable sddm
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -161,7 +127,7 @@ for choice in "${tools[@]}"; do
|
|||||||
"Terminal")
|
"Terminal")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing Terminal packages..." -- \
|
# gum spin --title "Installing Terminal packages..." -- \
|
||||||
"Installing Terminal packages" yay -S --needed --noconfirm \
|
yay -S --needed --noconfirm \
|
||||||
fastfetch \
|
fastfetch \
|
||||||
hyfetch \
|
hyfetch \
|
||||||
neovim \
|
neovim \
|
||||||
@@ -177,13 +143,13 @@ for choice in "${tools[@]}"; do
|
|||||||
stow fastfetch hyfetch nvim zsh --adopt
|
stow fastfetch hyfetch nvim zsh --adopt
|
||||||
|
|
||||||
# gum spin --title "Updating Tealdeer database" -- \
|
# gum spin --title "Updating Tealdeer database" -- \
|
||||||
execute_with_spinner "Updating Tealdeer database" tldr --update
|
tldr --update
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Terminal Emulator")
|
"Terminal Emulator")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing Terminal Emulator..." -- \
|
# gum spin --title "Installing Terminal Emulator..." -- \
|
||||||
execute_with_spinner "Installing Terminal Emulator" yay -S --needed --noconfirm \
|
yay -S --needed --noconfirm \
|
||||||
ghostty
|
ghostty
|
||||||
stow ghostty --adopt
|
stow ghostty --adopt
|
||||||
;;
|
;;
|
||||||
@@ -191,7 +157,7 @@ for choice in "${tools[@]}"; do
|
|||||||
"Gaming")
|
"Gaming")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing Gaming Packages..." -- \
|
# gum spin --title "Installing Gaming Packages..." -- \
|
||||||
execute_with_spinner "Installing Gaming packages" yay -S --needed --noconfirm \
|
yay -S --needed --noconfirm \
|
||||||
mangohud \
|
mangohud \
|
||||||
gamemode \
|
gamemode \
|
||||||
steam \
|
steam \
|
||||||
@@ -209,7 +175,7 @@ for choice in "${tools[@]}"; do
|
|||||||
"VR Gaming")
|
"VR Gaming")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing VR Gaming Packages..." -- \
|
# gum spin --title "Installing VR Gaming Packages..." -- \
|
||||||
execute_with_spinner "Installing VR Gaming packages" yay -S --needed --noconfirm \
|
yay -S --needed --noconfirm \
|
||||||
alvr-launcher-bin \
|
alvr-launcher-bin \
|
||||||
wlx-overlay-s-bin
|
wlx-overlay-s-bin
|
||||||
;;
|
;;
|
||||||
@@ -217,7 +183,7 @@ for choice in "${tools[@]}"; do
|
|||||||
"Hamr Sticker Picker")
|
"Hamr Sticker Picker")
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing hamr..." -- \
|
# gum spin --title "Installing hamr..." -- \
|
||||||
execute_with_spinner "Installing hamr" yay -S --needed --noconfirm \
|
yay -S --needed --noconfirm \
|
||||||
hamr
|
hamr
|
||||||
|
|
||||||
stow hamr-sticker-picker --adopt
|
stow hamr-sticker-picker --adopt
|
||||||
@@ -260,6 +226,6 @@ extpkgstr=$(
|
|||||||
|
|
||||||
sudo -v || exit 1
|
sudo -v || exit 1
|
||||||
# gum spin --title "Installing extra packages" -- \
|
# gum spin --title "Installing extra packages" -- \
|
||||||
execute_with_spinner "Installing extra packages" yay -S --needed --noconfirm "$extpkgstr"
|
yay -S --needed --noconfirm "$extpkgstr"
|
||||||
|
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
|
|||||||
Reference in New Issue
Block a user