#!/bin/bash # # Omarchy Final Configurations Installer # # This script runs from archinstall's custom_commands after base packages # and user creation. It switches to the created user and runs install.sh # to complete package installation and system configuration. # # archinstall runs custom_commands as root via: # arch-chroot -S /mnt bash /var/tmp/user-command.0.sh # set -eEo pipefail # Find the first non-root user (UID >= 1000, < 60000) OMARCHY_USER=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 60000 {print $1; exit}') if [[ -z "$OMARCHY_USER" ]]; then echo "ERROR: No non-root user found!" echo "Users created:" getent passwd | awk -F: '$3 >= 1000 {print $1, $3}' exit 1 fi echo "Setting up Omarchy for user: $OMARCHY_USER" # Setup passwordless sudo (will be removed by post-install) echo "Setting up passwordless sudo..." mkdir -p /etc/sudoers.d cat >/etc/sudoers.d/99-omarchy-installer <