summaryrefslogtreecommitdiff
path: root/archsetup
diff options
context:
space:
mode:
Diffstat (limited to 'archsetup')
-rwxr-xr-xarchsetup67
1 files changed, 57 insertions, 10 deletions
diff --git a/archsetup b/archsetup
index afaf00c..97d6e92 100755
--- a/archsetup
+++ b/archsetup
@@ -128,8 +128,8 @@ load_config() {
### Configuration Defaults
# These can be overridden via --config-file
-username="${username:-cjennings}"
-password="${password:-welcome}" # CHANGE ON FIRST LOGIN
+username="${username:-}" # prompted if not set
+password="${password:-}" # prompted if not set
locale="${locale:-}" # set via prompt if not configured
desktop_env="${desktop_env:-hyprland}" # options: dwm, hyprland, none
@@ -146,7 +146,7 @@ dotemacs_repo="${dotemacs_repo:-https://git.cjennings.net/dotemacs.git}"
archsetup_repo="${archsetup_repo:-https://git.cjennings.net/archsetup.git}"
logfile="/var/log/archsetup-$(date +'%Y-%m-%d-%H-%M-%S').log"
-source_dir="/home/$username/.local/src" # aur/git source goes here
+source_dir="" # set in preflight_checks after username is known
packages_before="/var/log/archsetup-preexisting-package-list.txt"
packages_after="/var/log/archsetup-post-install-package-list.txt"
archsetup_packages="/var/log/archsetup-installed-packages.txt"
@@ -315,6 +315,51 @@ preflight_checks() {
echo " [OK] Locale: $locale (selected)"
fi
+ # Prompt for username if not set
+ if [[ -z "$username" ]]; then
+ echo ""
+ read -r -p "Enter username for primary account: " username
+ if [[ -z "$username" ]]; then
+ echo "ERROR: Username cannot be empty"
+ exit 1
+ fi
+ # Validate username (lowercase, starts with letter, alphanumeric + underscore)
+ if [[ ! "$username" =~ ^[a-z][a-z0-9_]*$ ]]; then
+ echo "ERROR: Invalid username"
+ echo " Must start with lowercase letter, contain only lowercase letters, numbers, underscores"
+ exit 1
+ fi
+ echo " [OK] Username: $username"
+ else
+ echo " [OK] Username: $username (from config)"
+ fi
+
+ # Prompt for password if not set
+ if [[ -z "$password" ]]; then
+ echo ""
+ while true; do
+ read -r -s -p "Enter password for $username: " password
+ echo ""
+ read -r -s -p "Confirm password: " password_confirm
+ echo ""
+ if [[ "$password" != "$password_confirm" ]]; then
+ echo " Passwords do not match. Try again."
+ continue
+ fi
+ if [[ -z "$password" ]]; then
+ echo " Password cannot be empty. Try again."
+ continue
+ fi
+ break
+ done
+ echo " [OK] Password: set"
+ else
+ echo " [OK] Password: (from config)"
+ fi
+
+ # Set paths that depend on username
+ source_dir="/home/$username/.local/src"
+
echo "Pre-flight checks passed."
echo ""
}
@@ -790,6 +835,10 @@ user_customizations() {
>> "$logfile" 2>&1 ) || error_warn "$action" "$?"
fi
+ # Refresh font cache for any fonts in dotfiles
+ action="refreshing font cache" && display "task" "$action"
+ fc-cache -f >> "$logfile" 2>&1 || error_warn "$action" "$?"
+
# install desktop-file-utils before updating database (provides update-desktop-database)
pacman_install desktop-file-utils
@@ -1259,17 +1308,18 @@ hyprland() {
pacman_install hyprpaper
action="Hyprland Utilities" && display "subtitle" "$action"
+ pacman_install cpio # hyprpm (plugin manager) dependency
pacman_install waybar # status bar
- pacman_install wofi # app launcher
+ pacman_install fuzzel # app launcher (native Wayland, pinentry support)
pacman_install swww # wallpaper
pacman_install grim # screenshot
pacman_install slurp # region select
+ pacman_install satty # screenshot annotation
+ pacman_install hyprpicker # color picker
pacman_install gammastep # night light (replaces redshift)
pacman_install brightnessctl # brightness control
pacman_install pamixer # audio control
-
- # st terminal still works on Wayland via XWayland
- git_install "$st_repo"
+ pacman_install foot # native Wayland terminal
}
### Display Server (conditional)
@@ -1845,9 +1895,6 @@ outro() {
action="Cleanup" && display "title" "$action"
- action="forcing user password change on first login" && display "task" "$action"
- chage -d 0 "$username" >> "$logfile" 2>&1 || error_warn "$action" "$?"
-
display "subtitle" "Statistics"
action="identifying newly installed packages" && display "task" "$action"
pacman -Q > "$packages_after" || error_warn "$action" "$?"