diff --git a/bin/omarchy-setup-chaotic-aur b/bin/omarchy-setup-chaotic-aur new file mode 100755 index 000000000000..c41d4894cb03 --- /dev/null +++ b/bin/omarchy-setup-chaotic-aur @@ -0,0 +1,44 @@ +#!/bin/bash + +setup_chaotic_aur() { + if [[ "$(uname -m)" != "x86_64" ]]; then + echo "Chaotic-AUR is only supported on x86_64 architecture." + return 0 + fi + + if grep -q "^\[chaotic-aur\]" /etc/pacman.conf; then + echo "Chaotic-AUR is already configured." + return 0 + fi + + + if ! pacman-key --list-keys 3056513887B78AEB >/dev/null 2>&1 && + sudo pacman-key --recv-key 3056513887B78AEB && + sudo pacman-key --lsign-key 3056513887B78AEB && + sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' && + sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'; then + + echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null + + sudo pacman -Sy --needed --noconfirm yay + else + echo "Failed to install Chaotic-AUR; skipping update to pacman.conf" + fi +} + +echo -e "Chaotic-AUR is an unofficial, \e[1moptional\e[0m repository that provides pre-built AUR packages." +echo "Using it is not required. Please ensure you understand the potential risks." +echo "https://aur.chaotic.cx" + +echo -ne "\e[33m\nWould you like to setup the Chaotic-AUR repository? [Y/n]\e[0m" + +while true; do + read -rsn1 choice + if [[ "$choice" =~ ^[YyNn]$ || -z "$choice" ]]; then + case "$choice" in + [Yy] | "" ) echo; setup_chaotic_aur; break ;; + [Nn] ) echo; echo "Chaotic-AUR will not be setup."; break ;; + esac + fi +done +echo \ No newline at end of file diff --git a/install.sh b/install.sh index f2a9f03f78ae..f3619784b22a 100755 --- a/install.sh +++ b/install.sh @@ -26,6 +26,8 @@ show_subtext() { } # Install prerequisites +clear +echo -e "\e[1mInstalling prerequisites [0/5]\e[0m\n" source $OMARCHY_INSTALL/preflight/aur.sh source $OMARCHY_INSTALL/preflight/presentation.sh source $OMARCHY_INSTALL/preflight/migrations.sh diff --git a/install/preflight/aur.sh b/install/preflight/aur.sh index 525b17c1debe..94f5b048482d 100644 --- a/install/preflight/aur.sh +++ b/install/preflight/aur.sh @@ -1,25 +1,6 @@ #!/bin/bash -# Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages -if [[ "$(uname -m)" == "x86_64" ]] && ! command -v yay &>/dev/null; then - # Try installing Chaotic-AUR keyring and mirrorlist - if ! pacman-key --list-keys 3056513887B78AEB >/dev/null 2>&1 && - sudo pacman-key --recv-key 3056513887B78AEB && - sudo pacman-key --lsign-key 3056513887B78AEB && - sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' && - sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'; then - - # Add Chaotic-AUR repo to pacman config - if ! grep -q "chaotic-aur" /etc/pacman.conf; then - echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null - fi - - # Install yay directly from Chaotic-AUR - sudo pacman -Sy --needed --noconfirm yay - else - echo "Failed to install Chaotic-AUR, so won't include it in pacman config!" - fi -fi +source ~/.local/share/omarchy/bin/omarchy-setup-chaotic-aur # Manually install yay from AUR if not already available if ! command -v yay &>/dev/null; then