#!/usr/bin/env bash REFINDCONF="/boot/efi/EFI/refind/refind.conf" install_secureboot(){ sudo pacman -S sbsigntools efitools refind echo "[sbsigntools, efitools, refind] installed, press any key to continue ..." sudo refind-install --shim /usr/share/shim-signed/shimx64.efi --localkeys echo "[refind-install] executed, press any key to continue ..." echo signing [/boot/efi/EFI/endeavouros/grubx64.efi] sudo sbsign --key /etc/refind.d/keys/refind_local.key --cert /etc/refind.d/keys/refind_local.crt --output /boot/efi/EFI/endeavouros/grubx64.efi /boot/efi/EFI/endeavouros/grubx64.efi echo signing [/boot/efi/EFI/boot/bootx64.efi] sudo sbsign --key /etc/refind.d/keys/refind_local.key --cert /etc/refind.d/keys/refind_local.crt --output /boot/efi/EFI/boot/bootx64.efi /boot/efi/EFI/boot/bootx64.efi echo signing [/boot/vmlinuz-linux] sudo sbsign --key /etc/refind.d/keys/refind_local.key --cert /etc/refind.d/keys/refind_local.crt --output /boot/vmlinuz-linux /boot/vmlinuz-linux } install_theme(){ sudo mkdir -p /boot/efi/EFI/refind/themes git clone https://github.com/catppuccin/refind.git catppuccin cp catppuccin/assets/mocha/icons/os_arch.png catppuccin/assets/mocha/icons/os_endeavouros.png sudo cp -rf catppuccin /boot/efi/EFI/refind/themes/ sudo rm $REFINDCONF sudo cp .refind/refind.conf $REFINDCONF rm -rf catppuccin } install_snap(){ echo "Installing dependencies..." echo "Cloning Snapd AUR package..." git clone https://aur.archlinux.org/snapd.git cd snapd echo "Building and installing Snapd..." makepkg -si --noconfirm echo "Enabling snapd.socket service..." sudo systemctl enable --now snapd.socket echo "Enabling AppArmor for Snap confinement..." sudo systemctl enable --now snapd.apparmor.service echo "Creating symbolic link for classic Snap support..." sudo ln -s /var/lib/snapd/snap /snap echo "Waiting for Snapd to complete device seeding..." max_retries=10 retry_count=0 while ! sudo snap wait system seed.loaded && [ $retry_count -lt $max_retries ]; do echo "Snapd is not seeded yet, retrying... ($retry_count/$max_retries)" sleep 2 ((retry_count++)) done # Check if seeding failed after max retries if [ $retry_count -ge $max_retries ]; then echo "Snapd seeding failed after $max_retries retries. Exiting." exit 1 fi # Now you can install your Snap package echo "Snapd is seeded and ready, installing the Snap package..." sudo snap install hello-world echo "Snap installation complete!" } # Check with sudo if sudo [ -f "$REFINDCONF" ]; then echo "The file '$REFINDCONF' exists, skipping refind installation" else echo "refind not installed, installing now" install_secureboot install_theme fi install_snap