mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
Simplify and make it idempotent
This commit is contained in:
@ -1,9 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
chaotic_ok=0
|
|
||||||
|
|
||||||
# Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages
|
# Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages
|
||||||
if [[ "$(uname -m)" == "x86_64" ]]; then
|
if [[ "$(uname -m)" == "x86_64" ]] && ! command -v yay &>/dev/null; then
|
||||||
# Try installing Chaotic-AUR keyring and mirrorlist
|
# Try installing Chaotic-AUR keyring and mirrorlist
|
||||||
if sudo pacman-key --recv-key 3056513887B78AEB &&
|
if sudo pacman-key --recv-key 3056513887B78AEB &&
|
||||||
sudo pacman-key --lsign-key 3056513887B78AEB &&
|
sudo pacman-key --lsign-key 3056513887B78AEB &&
|
||||||
@ -13,23 +11,19 @@ if [[ "$(uname -m)" == "x86_64" ]]; then
|
|||||||
# Add Chaotic-AUR repo to pacman config
|
# Add Chaotic-AUR repo to pacman config
|
||||||
echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null
|
echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null
|
||||||
|
|
||||||
# Refresh pacman package databases
|
# Install yay directly from Chaotic-AUR
|
||||||
sudo pacman -Sy
|
sudo pacman -Sy --needed --noconfirm yay
|
||||||
|
|
||||||
chaotic_ok=1
|
|
||||||
else
|
else
|
||||||
echo "Failed to install Chaotic-AUR, so won't include it in pacman config!"
|
echo "Failed to install Chaotic-AUR, so won't include it in pacman config!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $chaotic_ok -eq 1 ]]; then
|
|
||||||
sudo pacman -S --needed --noconfirm yay
|
|
||||||
else
|
|
||||||
# Manually install yay from AUR if not already available
|
# Manually install yay from AUR if not already available
|
||||||
if ! command -v yay &>/dev/null; then
|
if ! command -v yay &>/dev/null; then
|
||||||
# Install build tools
|
# Install build tools
|
||||||
sudo pacman -S --needed --noconfirm base-devel
|
sudo pacman -Sy --needed --noconfirm base-devel
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
rm -rf yay-bin
|
||||||
git clone https://aur.archlinux.org/yay-bin.git
|
git clone https://aur.archlinux.org/yay-bin.git
|
||||||
cd yay-bin
|
cd yay-bin
|
||||||
makepkg -si --noconfirm
|
makepkg -si --noconfirm
|
||||||
@ -37,7 +31,6 @@ else
|
|||||||
rm -rf yay-bin
|
rm -rf yay-bin
|
||||||
cd ~
|
cd ~
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Add fun and color to the pacman installer
|
# Add fun and color to the pacman installer
|
||||||
sudo sed -i '/^\[options\]/a Color\nILoveCandy' /etc/pacman.conf
|
sudo sed -i '/^\[options\]/a Color\nILoveCandy' /etc/pacman.conf
|
||||||
|
Reference in New Issue
Block a user