46 lines
1.2 KiB
Bash
Executable File
46 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "=== Arch Linux Hyprland Setup Bootstrap ==="
|
|
echo ""
|
|
|
|
# Check if running as root
|
|
if [ "$EUID" -eq 0 ]; then
|
|
echo "Error: Do not run as root. Run as a normal user."
|
|
exit 1
|
|
fi
|
|
|
|
# Step 1: Setup sudo access for package installation
|
|
echo "[1/4] Setting up sudo access..."
|
|
if ! sudo -n true 2>/dev/null; then
|
|
echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/local > /dev/null
|
|
echo "NOPASSWD sudo configured."
|
|
else
|
|
echo "Sudo access available."
|
|
fi
|
|
|
|
# Step 2: Install base requirements (git, ansible)
|
|
echo "[2/4] Installing base requirements (git, ansible)..."
|
|
sudo pacman -Sy --noconfirm git ansible
|
|
|
|
# Step 3: Clone or update the repo
|
|
echo "[3/4] Setting up archsetup..."
|
|
if [ -d "$HOME/archsetup/.git" ]; then
|
|
echo "Updating archsetup..."
|
|
cd "$HOME/archsetup"
|
|
git pull
|
|
else
|
|
echo "Cloning archsetup..."
|
|
git clone https://github.com/YOUR_USERNAME/archsetup.git "$HOME/archsetup"
|
|
fi
|
|
|
|
# Step 4: Run the playbook
|
|
echo "[4/4] Running Ansible playbook..."
|
|
cd "$HOME/archsetup"
|
|
ansible-playbook site.yml
|
|
|
|
echo ""
|
|
echo "=== Setup complete! ==="
|
|
echo "Logout and login again for shell changes to take effect."
|
|
echo "Restart Hyprland (Super + Shift + Q) to apply new configuration."
|