From 3b4d8616a906246db81bc2986925e9b5c8435453 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 24 Jul 2026 12:22:36 -0700 Subject: [PATCH] Drop the redundant tee helper and unused vars in the lock setup Co-Authored-By: Claude Opus 5 (1M context) --- bin/omarchy-setup-lock | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/bin/omarchy-setup-lock b/bin/omarchy-setup-lock index 36701aae..3837ec97 100755 --- a/bin/omarchy-setup-lock +++ b/bin/omarchy-setup-lock @@ -12,8 +12,6 @@ if [[ -z $target_user && -n ${PKEXEC_UID:-} ]]; then target_user=$(getent passwd "$PKEXEC_UID" | cut -d: -f1) fi target_user=${target_user:-$USER} -target_home=$(getent passwd "$target_user" | cut -d: -f6) -target_group=$(id -gn "$target_user" 2>/dev/null || echo "$target_user") as_root() { if (( EUID == 0 )); then @@ -23,19 +21,9 @@ as_root() { fi } -tee_root() { - local path="$1" - - if (( EUID == 0 )); then - tee "$path" - else - sudo tee "$path" - fi -} - echo "Configuring lock screen password authentication..." -tee_root /etc/pam.d/omarchy-lock-password >/dev/null <<'EOF' +as_root tee /etc/pam.d/omarchy-lock-password >/dev/null <<'EOF' #%PAM-1.0 auth required pam_faillock.so preauth silent deny=10 unlock_time=120 -auth [success=2 default=ignore] pam_systemd_home.so @@ -49,7 +37,7 @@ EOF if omarchy-cmd-present fprintd-list && fprintd-list "$target_user" 2>/dev/null | grep -qi finger; then echo "Configuring lock screen fingerprint authentication..." - tee_root /etc/pam.d/omarchy-lock-fingerprint >/dev/null <<'EOF' + as_root tee /etc/pam.d/omarchy-lock-fingerprint >/dev/null <<'EOF' #%PAM-1.0 auth required pam_fprintd.so account include system-local-login @@ -58,7 +46,6 @@ else as_root rm -f /etc/pam.d/omarchy-lock-fingerprint fi - # omarchy-shell can't reach a running shell during chroot install. The echo # is just confirmation, so swallow the failure rather than letting it become # the script's exit code.