Drop the redundant tee helper and unused vars in the lock setup
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f804d5c9c0
commit
3b4d8616a9
+2
-15
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user