From 68afe73c071225025c7e3fb541d8bd018396f5d7 Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Mon, 5 Oct 2026 09:01:32 -0400 Subject: [PATCH 1/8] Guide fingerprint enrollment step by step A failed enrollment on a Mac's Touch ID showed how setup's output misled: it told everyone to keep moving the finger around the sensor, which suits a swipe sensor, and printed fprintd's raw "Enroll result: enroll-stage-passed" lines. A press sensor needs a separate touch for each sample, fprintd sends one stage after its duplicate check before enrollment starts, and one stage can take several touches, so after a single touch enrollment looked under way and timed out a minute later. Setup now asks fprintd for the reader's scan type and, for a press sensor, says to touch, lift and touch again until it says Enrolled. It turns each result into an instruction: the duplicate check's stage prints nothing, each later stage is a numbered step followed by what to do next, retries and failures say what to do, and verify reads the same way, " (done)" and " (not done)" suffixes included. fprintd's routine lines are hidden, but anything else it prints, such as why it could not claim the device, is shown, and fprintd's exit status still decides each step. sudo is authenticated first, and named, because with fingerprint sudo set up its own touch read as the first sample; if it fails, setup says why and stops. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 114 ++++++++++++++++++- test/shell.d/fingerprint-package-test.sh | 133 +++++++++++++++++++++++ 2 files changed, 242 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index 0367cefae079..ec56d00bbf37 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -56,6 +56,88 @@ EOF fi } +# fprintd's scan type for the default reader: "press" for a sensor that takes +# separate touches (a Mac's Touch ID, most current readers), "swipe" for one +# that reads a moving finger. Empty when fprintd can't be asked. +fingerprint_scan_type() { + local device + device=$(busctl --system call net.reactivated.Fprint /net/reactivated/Fprint/Manager \ + net.reactivated.Fprint.Manager GetDefaultDevice 2>/dev/null) || return 0 + device=${device#o \"} + device=${device%\"} + busctl --system get-property net.reactivated.Fprint "$device" net.reactivated.Fprint.Device scan-type 2>/dev/null | + sed -n 's/^s "\(.*\)"$/\1/p' +} + +# fprintd's own lines that carry nothing for the owner; anything else it +# prints that isn't a result, such as why a claim or start failed, is shown. +fprintd_chatter() { + [[ $1 == "Using device "* || $1 == "Enrolling "*" finger." || $1 == "Listing enrolled fingers:" || + $1 == " - #"* || $1 == "Verify started!" || $1 == "Verifying: "* ]] +} + +# fprintd-enroll's results as instructions, AGAIN asking for more. On a reader +# that identifies, fprintd's duplicate check sends one stage before enrollment +# starts, with no touch on an empty Touch ID gallery and one otherwise, so it +# prints nothing; later stages are steps, as one can take several touches. +enroll_progress() { + local again=$1 line steps=-1 + while IFS= read -r line; do + if [[ $line != "Enroll result: "* ]]; then + fprintd_chatter "$line" || echo " $line" + continue + fi + case ${line#Enroll result: } in + enroll-stage-passed) + if (( ++steps > 0 )); then + echo " ✓ Step $steps done. $again" + fi + ;; + enroll-retry-scan) echo " That one didn't read. $again" ;; + enroll-swipe-too-short) echo " Too short. $again" ;; + enroll-finger-not-centered) echo " Not centered: use the middle of the sensor. $again" ;; + enroll-remove-and-retry) echo " Lift your finger off the sensor, then: $again" ;; + enroll-too-fast) echo " Too fast. $again" ;; + enroll-completed) echo " ✓ Enrolled." ;; + enroll-duplicate) echo " ✗ That finger is already enrolled." ;; + enroll-data-full) echo " ✗ The reader has no room for another fingerprint." ;; + enroll-disconnected) echo " ✗ The reader was disconnected." ;; + enroll-failed | enroll-unknown-error) + echo " ✗ Enrollment stopped. If you stopped before it said Enrolled, run this again and keep going." ;; + *) echo " ${line#Enroll result: }" ;; + esac + done +} + +# fprintd-verify's results the same way. +# fprintd-verify suffixes each result with " (done)" or " (not done)"; a +# result that isn't done is a retry, whatever its name. +verify_progress() { + local again=$1 line + while IFS= read -r line; do + if [[ $line != "Verify result: "* ]]; then + fprintd_chatter "$line" || echo " $line" + continue + fi + line=${line#Verify result: } + if [[ $line == *" (not done)" ]]; then + case ${line% (*} in + verify-swipe-too-short) echo " Too short. $again" ;; + verify-finger-not-centered) echo " Not centered: use the middle of the sensor. $again" ;; + verify-remove-and-retry) echo " Lift your finger off the sensor, then: $again" ;; + verify-too-fast) echo " Too fast. $again" ;; + *) echo " That one didn't read. $again" ;; + esac + continue + fi + case ${line% (*)} in + verify-match) echo " ✓ Matched." ;; + verify-no-match) echo " ✗ No match." ;; + *) echo " ✗ The check stopped." ;; + esac + done +} + echo -e "\e[32mSetting up fingerprint scanner for authentication.\n\e[0m" # Bail before installing anything if there's no reader to talk to. @@ -74,15 +156,37 @@ if omarchy-pkg-missing libfprint-git fprintd usbutils; then fi # Enroll first fingerprint -echo -e "\e[32m\nLet's setup your right index finger as the first fingerprint.\e[0m" -echo -e "Keep moving the finger around on sensor until the process completes.\n" +# Authenticate sudo first, and say so: with fingerprint sudo already set up it +# asks for a touch of its own, which must not pass for the first sample. +if ! sudo -n true 2>/dev/null; then + echo -e "\nFirst, confirm it's you. Setup needs administrator rights to enroll." + if ! sudo -v; then + echo -e "\e[31mSetup needs administrator rights to enroll a fingerprint.\e[0m" + exit 1 + fi +fi + +echo -e "\e[32m\nLet's set up your right index finger as the first fingerprint.\e[0m" +# A press sensor needs a touch for each sample; a swipe sensor a moving finger. +if [[ $(fingerprint_scan_type) == "press" ]]; then + start="Touch the sensor." again="Keep lifting your finger and touching the sensor." + echo -e "Touch the sensor, lift your finger and touch it again, and keep going until it says Enrolled. A step can take a few touches.\n" +else + start="Swipe your finger across the sensor." again="Swipe it again." + echo -e "Keep moving the finger around on sensor until it says Enrolled.\n" +fi -if sudo fprintd-enroll "$USER"; then +# The filters only print; the exit status is fprintd's. +sudo fprintd-enroll "$USER" | enroll_progress "$again" +enroll_status=${PIPESTATUS[0]} +if (( enroll_status == 0 )); then echo -e "\e[32m\nFingerprint enrolled successfully!\e[0m" # Verify - echo -e "\nNow let's verify that it's working correctly.\n" - if fprintd-verify; then + echo -e "\nNow let's verify that it's working correctly. $start\n" + fprintd-verify | verify_progress "$again" + verify_status=${PIPESTATUS[0]} + if (( verify_status == 0 )); then # PAM comes last, once a print is enrolled and verified. Detection only # proves a reader is there, not that libfprint can drive it — an Elan MOC # sensor outside the elanmoc table gets this far and then fails to enroll. diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index cf67e347f4a2..4d6f642fa20c 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -22,6 +22,8 @@ STUB cat > "$scratch/bin/sudo" <<'STUB' #!/bin/bash case "$1" in + -n) exit "${SUDO_CACHED:-1}" ;; + -v) echo "sudo authenticated" >> "$CALL_LOG"; exit "${SUDO_V_STATUS:-0}" ;; pacman | fprintd-enroll) exec "$@" ;; sed) printf 'pam %s\n' "$*" >> "$CALL_LOG" ;; tee) printf 'pam %s\n' "$*" >> "$CALL_LOG"; cat >/dev/null ;; @@ -50,7 +52,9 @@ STUB cat > "$scratch/bin/fprintd-enroll" <<'STUB' #!/bin/bash # Stop before verification/PAM; no host authentication files may be changed. +# ENROLL_OUTPUT is what fprintd-enroll prints first. echo enroll >> "$CALL_LOG" +[[ -z ${ENROLL_OUTPUT:-} ]] || printf '%s\n' "$ENROLL_OUTPUT" exit "${ENROLL_STATUS:-1}" STUB cat > "$scratch/bin/fprintd-verify" <<'STUB' @@ -58,6 +62,17 @@ cat > "$scratch/bin/fprintd-verify" <<'STUB' echo verify >> "$CALL_LOG" exit "${VERIFY_STATUS:-1}" STUB +# fprintd on D-Bus: SCAN_TYPE is the default reader's scan type; unset, fprintd +# doesn't answer. Never the host's own fprintd. +cat > "$scratch/bin/busctl" <<'STUB' +#!/bin/bash +[[ -n ${SCAN_TYPE:-} ]] || exit 1 +case "$*" in + *GetDefaultDevice*) echo 'o "/net/reactivated/Fprint/Device/0"' ;; + *"/net/reactivated/Fprint/Device/0 net.reactivated.Fprint.Device scan-type"*) echo "s \"$SCAN_TYPE\"" ;; + *) exit 1 ;; +esac +STUB chmod +x "$scratch/bin/"* cat > "$scratch/bin/omarchy-apply-lock" <<'STUB' @@ -133,3 +148,121 @@ if grep -q 'Perfect!\|You can use your fingerprint' "$scratch/output"; then fail "inconclusive setup does not promise fingerprint unlock" fi pass "an inconclusive lock installer cannot report successful lock setup" + +# A press sensor, such as a Mac's Touch ID, takes a touch per sample, so setup +# says to lift and touch again; a swipe sensor, or none fprintd can name, keeps +# the moving-finger instruction. +press_text="Touch the sensor, lift your finger and touch it again, and keep going until it says Enrolled. A step can take a few touches." +swipe_text="Keep moving the finger around on sensor until it says Enrolled." +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press run_setup +grep -qF "$press_text" "$scratch/output" && ! grep -qF "$swipe_text" "$scratch/output" || + fail "a press sensor is told to lift and touch again" "$(cat "$scratch/output")" +for scan_type in swipe ""; do + INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=$scan_type run_setup + grep -qF "$swipe_text" "$scratch/output" && ! grep -qF "$press_text" "$scratch/output" || + fail "a ${scan_type:-unnamed} sensor keeps the moving-finger instruction" "$(cat "$scratch/output")" +done +pass "a press sensor is told to touch again, and any other keeps the moving-finger instruction" + +# fprintd-enroll's raw results become instructions. The duplicate check's stage +# comes before any sample, so it prints nothing; later stages count as steps, +# never touches, since one stage can take several. +enroll_lines=$'Using device /net/reactivated/Fprint/Device/0\nEnrolling right-index-finger finger.' +for result in stage-passed stage-passed retry-scan stage-passed unknown-error; do + enroll_lines+=$'\nEnroll result: enroll-'$result +done +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press ENROLL_OUTPUT=$enroll_lines run_setup +expected=$' \u2713 Step 1 done. Keep lifting your finger and touching the sensor. + That one didn\'t read. Keep lifting your finger and touching the sensor. + \u2713 Step 2 done. Keep lifting your finger and touching the sensor. + \u2717 Enrollment stopped. If you stopped before it said Enrolled, run this again and keep going.' +[[ $(grep -E '^ ' "$scratch/output") == "$expected" ]] || + fail "enrollment results read as instructions, counting steps after the duplicate check" "$(cat "$scratch/output")" +! grep -q 'Enroll result:' "$scratch/output" || fail "no raw fprintd result reaches the owner" "$(cat "$scratch/output")" +grep -q 'Enrollment failed' "$scratch/output" || fail "a failed enrollment still fails setup" "$(cat "$scratch/output")" +pass "enrollment results read as instructions, and a failed enrollment still fails setup" + +# The verify step's results, in fprintd-verify's own format (each with " (done)" +# or " (not done)"), through the functions setup uses. +source <(sed -n '/^fprintd_chatter()/,/^}/p;/^enroll_progress()/,/^}/p;/^verify_progress()/,/^}/p' \ + "$ROOT/bin/omarchy-setup-security-fingerprint") +[[ $(printf '%s\n' 'Using device /net/reactivated/Fprint/Device/0' 'Listing enrolled fingers:' ' - #0: right-index-finger' \ + 'Verify started!' 'Verifying: right-index-finger' 'Verify result: verify-retry-scan (not done)' \ + 'Verify result: verify-finger-not-centered (not done)' 'Verify result: verify-match (done)' | + verify_progress "Touch again.") == $' That one didn\'t read. Touch again.\n Not centered: use the middle of the sensor. Touch again.\n \u2713 Matched.' ]] || + fail "verify results, retries included, read as instructions" +[[ $(printf '%s\n' 'Verify result: verify-no-match (done)' | verify_progress "Touch again.") == $' \u2717 No match.' ]] || + fail "a failed verify says so" +pass "verify results read as instructions" + +# sudo's own prompt comes first and is named as such; with sudo already +# authenticated there is no prompt to explain. +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press run_setup +grep -qF "First, confirm it's you." "$scratch/output" && grep -qx 'sudo authenticated' "$CALL_LOG" || + fail "setup names sudo's prompt and authenticates before enrolling" "$(cat "$scratch/output")" +(( $(grep -n "First, confirm it's you." "$scratch/output" | cut -d: -f1) < $(grep -n "Let's set up" "$scratch/output" | cut -d: -f1) )) || + fail "sudo's prompt comes before the enrollment instructions" "$(cat "$scratch/output")" +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press SUDO_CACHED=0 run_setup +! grep -qF "First, confirm it's you." "$scratch/output" && ! grep -qx 'sudo authenticated' "$CALL_LOG" || + fail "an authenticated sudo is not asked again" "$(cat "$scratch/output")" +pass "sudo is authenticated, and named, before the enrollment instructions" + +# What fprintd prints when it can't go on (a claimed device, no fingers) is +# shown; its routine lines are not. +[[ $(printf '%s\n' 'Using device /net/reactivated/Fprint/Device/0' \ + 'failed to claim device: GDBus.Error:net.reactivated.Fprint.Error.AlreadyInUse: Device was already claimed' | + enroll_progress "Touch again.") == ' failed to claim device: GDBus.Error:net.reactivated.Fprint.Error.AlreadyInUse: Device was already claimed' ]] || + fail "why enrollment could not start is shown" +[[ $(printf '%s\n' 'Using device /net/reactivated/Fprint/Device/0' 'No fingers enrolled for this device.' | + verify_progress "Touch again.") == ' No fingers enrolled for this device.' ]] || fail "why verify could not start is shown" +pass "fprintd's reasons for stopping reach the owner, its routine lines do not" + +# A sudo that won't authenticate stops setup with a reason, before enrolling. +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press SUDO_V_STATUS=1 run_setup +grep -qF "Setup needs administrator rights to enroll a fingerprint." "$scratch/output" && ! grep -qx enroll "$CALL_LOG" || + fail "a failed sudo stops setup with a reason" "$(cat "$scratch/output")" +pass "a failed sudo stops setup with a reason, before enrolling" + +# Every retry fprintd 1.94.5 can send keeps enrollment going; only a failure +# says it stopped, and a result fprintd adds later is shown, not called a stop. +[[ $(printf '%s\n' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-too-fast' \ + 'Enroll result: enroll-swipe-too-short' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-some-new-result' \ + 'Enroll result: enroll-completed' | enroll_progress "Swipe it again.") == $' Too fast. Swipe it again.\n Too short. Swipe it again.\n \u2713 Step 1 done. Swipe it again.\n enroll-some-new-result\n \u2713 Enrolled.' ]] || + fail "enrollment retries keep going, and an unknown result is shown" +[[ $(printf '%s\n' 'Verify result: verify-too-fast (not done)' 'Verify result: verify-some-new-retry (not done)' \ + 'Verify result: verify-disconnected (done)' | verify_progress "Swipe it again.") == $' Too fast. Swipe it again.\n That one didn\'t read. Swipe it again.\n \u2717 The check stopped.' ]] || + fail "any verify result that isn't done is a retry" +pass "every retry keeps the step going, and only a finished failure says it stopped" + +# Each of fprintd 1.94.5's enroll and verify results, one by one. +check_enroll() { + [[ $(printf 'Enroll result: %s\n' "$1" | enroll_progress "Again.") == "$2" ]] || + fail "enroll result $1 reads as: $2" "$(printf 'Enroll result: %s\n' "$1" | enroll_progress "Again.")" +} +check_enroll enroll-completed $' ✓ Enrolled.' +check_enroll enroll-retry-scan " That one didn't read. Again." +check_enroll enroll-swipe-too-short ' Too short. Again.' +check_enroll enroll-finger-not-centered ' Not centered: use the middle of the sensor. Again.' +check_enroll enroll-remove-and-retry ' Lift your finger off the sensor, then: Again.' +check_enroll enroll-too-fast ' Too fast. Again.' +check_enroll enroll-duplicate $' ✗ That finger is already enrolled.' +check_enroll enroll-data-full $' ✗ The reader has no room for another fingerprint.' +check_enroll enroll-disconnected $' ✗ The reader was disconnected.' +for result in enroll-failed enroll-unknown-error; do + check_enroll "$result" $' ✗ Enrollment stopped. If you stopped before it said Enrolled, run this again and keep going.' +done +check_verify() { + [[ $(printf 'Verify result: %s\n' "$1" | verify_progress "Again.") == "$2" ]] || + fail "verify result $1 reads as: $2" "$(printf 'Verify result: %s\n' "$1" | verify_progress "Again.")" +} +check_verify 'verify-match (done)' $' ✓ Matched.' +check_verify 'verify-no-match (done)' $' ✗ No match.' +check_verify 'verify-retry-scan (not done)' " That one didn't read. Again." +check_verify 'verify-swipe-too-short (not done)' ' Too short. Again.' +check_verify 'verify-finger-not-centered (not done)' ' Not centered: use the middle of the sensor. Again.' +check_verify 'verify-remove-and-retry (not done)' ' Lift your finger off the sensor, then: Again.' +check_verify 'verify-too-fast (not done)' ' Too fast. Again.' +for result in verify-disconnected verify-unknown-error; do + check_verify "$result (done)" $' ✗ The check stopped.' +done +pass "each enroll and verify result fprintd 1.94.5 sends reads as intended" From 46a192b8209ba1ff6f24bdb1f7522d67421cf132 Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Mon, 5 Oct 2026 18:27:53 -0400 Subject: [PATCH 2/8] Leave out the first enrollment stage only on Touch ID The first enroll-stage-passed was always hidden, on the assumption that it is fprintd's duplicate check. fprintd runs that check only on readers that identify, so on any other reader the first real stage was hidden and every later step was numbered one low. fprintd's D-Bus interface doesn't say whether a reader identifies, but it gives the reader's name. Touch ID ("Apple secure enclave fingerprint sensor") identifies, and its check needs no touch while nothing is enrolled, so its first stage stays hidden. Every other reader's first stage counts: on one that doesn't identify it is the first enrollment stage, and a duplicate check that took a touch is shown as step 1. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 36 +++++++++++++++--------- test/shell.d/fingerprint-package-test.sh | 31 ++++++++++++++------ 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index ec56d00bbf37..77e143373b4e 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -56,16 +56,16 @@ EOF fi } -# fprintd's scan type for the default reader: "press" for a sensor that takes -# separate touches (a Mac's Touch ID, most current readers), "swipe" for one -# that reads a moving finger. Empty when fprintd can't be asked. -fingerprint_scan_type() { +# A property of fprintd's default reader, such as its name or scan-type ("press" +# for a sensor that takes separate touches, "swipe" for one that reads a moving +# finger). Empty when fprintd can't be asked. +fingerprint_reader() { local device device=$(busctl --system call net.reactivated.Fprint /net/reactivated/Fprint/Manager \ net.reactivated.Fprint.Manager GetDefaultDevice 2>/dev/null) || return 0 device=${device#o \"} device=${device%\"} - busctl --system get-property net.reactivated.Fprint "$device" net.reactivated.Fprint.Device scan-type 2>/dev/null | + busctl --system get-property net.reactivated.Fprint "$device" net.reactivated.Fprint.Device "$1" 2>/dev/null | sed -n 's/^s "\(.*\)"$/\1/p' } @@ -76,12 +76,11 @@ fprintd_chatter() { $1 == " - #"* || $1 == "Verify started!" || $1 == "Verifying: "* ]] } -# fprintd-enroll's results as instructions, AGAIN asking for more. On a reader -# that identifies, fprintd's duplicate check sends one stage before enrollment -# starts, with no touch on an empty Touch ID gallery and one otherwise, so it -# prints nothing; later stages are steps, as one can take several touches. +# fprintd-enroll's results as instructions, AGAIN asking for more. Stages are +# steps, as one can take several touches. With DUPLICATE_CHECK=1 the first stage +# is fprintd's duplicate check, not an enrollment step, and isn't shown. enroll_progress() { - local again=$1 line steps=-1 + local again=$1 duplicate_check=${2:-0} line stages=0 steps=0 while IFS= read -r line; do if [[ $line != "Enroll result: "* ]]; then fprintd_chatter "$line" || echo " $line" @@ -89,8 +88,8 @@ enroll_progress() { fi case ${line#Enroll result: } in enroll-stage-passed) - if (( ++steps > 0 )); then - echo " ✓ Step $steps done. $again" + if (( ++stages > duplicate_check )); then + echo " ✓ Step $(( ++steps )) done. $again" fi ;; enroll-retry-scan) echo " That one didn't read. $again" ;; @@ -168,7 +167,7 @@ fi echo -e "\e[32m\nLet's set up your right index finger as the first fingerprint.\e[0m" # A press sensor needs a touch for each sample; a swipe sensor a moving finger. -if [[ $(fingerprint_scan_type) == "press" ]]; then +if [[ $(fingerprint_reader scan-type) == "press" ]]; then start="Touch the sensor." again="Keep lifting your finger and touching the sensor." echo -e "Touch the sensor, lift your finger and touch it again, and keep going until it says Enrolled. A step can take a few touches.\n" else @@ -176,8 +175,17 @@ else echo -e "Keep moving the finger around on sensor until it says Enrolled.\n" fi +# fprintd runs a duplicate check before enrolling on a reader that identifies, +# which D-Bus doesn't say. Touch ID does, and its check needs no touch while +# nothing is enrolled; any other reader's first stage counts, touched or not. +# The name is the full_name of libfprint-git's Touch ID driver; if it changes, +# Touch ID shows one step early. +duplicate_check=0 +if [[ $(fingerprint_reader name) == "Apple secure enclave fingerprint sensor" ]]; then + duplicate_check=1 +fi # The filters only print; the exit status is fprintd's. -sudo fprintd-enroll "$USER" | enroll_progress "$again" +sudo fprintd-enroll "$USER" | enroll_progress "$again" "$duplicate_check" enroll_status=${PIPESTATUS[0]} if (( enroll_status == 0 )); then echo -e "\e[32m\nFingerprint enrolled successfully!\e[0m" diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index 4d6f642fa20c..59704bd55cd4 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -62,14 +62,15 @@ cat > "$scratch/bin/fprintd-verify" <<'STUB' echo verify >> "$CALL_LOG" exit "${VERIFY_STATUS:-1}" STUB -# fprintd on D-Bus: SCAN_TYPE is the default reader's scan type; unset, fprintd -# doesn't answer. Never the host's own fprintd. +# fprintd on D-Bus: SCAN_TYPE is the default reader's scan type and READER_NAME +# its name; with SCAN_TYPE unset, fprintd doesn't answer. Never the host's own fprintd. cat > "$scratch/bin/busctl" <<'STUB' #!/bin/bash [[ -n ${SCAN_TYPE:-} ]] || exit 1 case "$*" in *GetDefaultDevice*) echo 'o "/net/reactivated/Fprint/Device/0"' ;; *"/net/reactivated/Fprint/Device/0 net.reactivated.Fprint.Device scan-type"*) echo "s \"$SCAN_TYPE\"" ;; + *"/net/reactivated/Fprint/Device/0 net.reactivated.Fprint.Device name"*) echo "s \"${READER_NAME:-Some USB reader}\"" ;; *) exit 1 ;; esac STUB @@ -164,14 +165,15 @@ for scan_type in swipe ""; do done pass "a press sensor is told to touch again, and any other keeps the moving-finger instruction" -# fprintd-enroll's raw results become instructions. The duplicate check's stage -# comes before any sample, so it prints nothing; later stages count as steps, -# never touches, since one stage can take several. +# fprintd-enroll's raw results become instructions. Touch ID's duplicate check +# stage prints nothing; later stages count as steps, never touches, since one +# stage can take several. enroll_lines=$'Using device /net/reactivated/Fprint/Device/0\nEnrolling right-index-finger finger.' for result in stage-passed stage-passed retry-scan stage-passed unknown-error; do enroll_lines+=$'\nEnroll result: enroll-'$result done -INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press ENROLL_OUTPUT=$enroll_lines run_setup +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press READER_NAME='Apple secure enclave fingerprint sensor' \ + ENROLL_OUTPUT=$enroll_lines run_setup expected=$' \u2713 Step 1 done. Keep lifting your finger and touching the sensor. That one didn\'t read. Keep lifting your finger and touching the sensor. \u2713 Step 2 done. Keep lifting your finger and touching the sensor. @@ -195,6 +197,19 @@ source <(sed -n '/^fprintd_chatter()/,/^}/p;/^enroll_progress()/,/^}/p;/^verify_ fail "a failed verify says so" pass "verify results read as instructions" +# Only Touch ID's first stage is its duplicate check. On any other reader, one +# that doesn't identify or one whose duplicate check took a touch, the first +# stage to pass is step 1. +INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press ENROLL_OUTPUT=$enroll_lines run_setup +[[ $(grep -c 'Step [0-9] done' "$scratch/output") == 3 ]] || + fail "another reader's first stage is step 1" "$(cat "$scratch/output")" +INSTALLED=$'libfprint-git\nfprintd\nusbutils' ENROLL_OUTPUT=$enroll_lines run_setup +[[ $(grep -c 'Step [0-9] done' "$scratch/output") == 3 ]] || + fail "a reader fprintd can't name has its first stage counted" "$(cat "$scratch/output")" +[[ $(printf '%s\n' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-stage-passed' | enroll_progress "Again." 1) == \ + $' \u2713 Step 1 done. Again.' ]] || fail "with a duplicate check, the first stage is not a step" +pass "only a reader with a duplicate check leaves its first stage out of the steps" + # sudo's own prompt comes first and is named as such; with sudo already # authenticated there is no prompt to explain. INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press run_setup @@ -225,9 +240,9 @@ pass "a failed sudo stops setup with a reason, before enrolling" # Every retry fprintd 1.94.5 can send keeps enrollment going; only a failure # says it stopped, and a result fprintd adds later is shown, not called a stop. -[[ $(printf '%s\n' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-too-fast' \ +[[ $(printf '%s\n' 'Enrolling right-index-finger finger.' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-too-fast' \ 'Enroll result: enroll-swipe-too-short' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-some-new-result' \ - 'Enroll result: enroll-completed' | enroll_progress "Swipe it again.") == $' Too fast. Swipe it again.\n Too short. Swipe it again.\n \u2713 Step 1 done. Swipe it again.\n enroll-some-new-result\n \u2713 Enrolled.' ]] || + 'Enroll result: enroll-completed' | enroll_progress "Swipe it again." 1) == $' Too fast. Swipe it again.\n Too short. Swipe it again.\n \u2713 Step 1 done. Swipe it again.\n enroll-some-new-result\n \u2713 Enrolled.' ]] || fail "enrollment retries keep going, and an unknown result is shown" [[ $(printf '%s\n' 'Verify result: verify-too-fast (not done)' 'Verify result: verify-some-new-retry (not done)' \ 'Verify result: verify-disconnected (done)' | verify_progress "Swipe it again.") == $' Too fast. Swipe it again.\n That one didn\'t read. Swipe it again.\n \u2717 The check stopped.' ]] || From a1fa8cdc8856c012a1497fad01929fe5003ad884 Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Mon, 5 Oct 2026 18:28:06 -0400 Subject: [PATCH 3/8] Fail fingerprint setup when the enrolled print doesn't verify A failed verify printed its message and fell off the end with status 0; it now exits 1 like a failed enrollment. The test now covers a failed verify after a successful enrollment: setup fails and leaves PAM and the lock screen alone. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 1 + test/shell.d/fingerprint-package-test.sh | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index 77e143373b4e..b32d146101b1 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -210,6 +210,7 @@ if (( enroll_status == 0 )); then echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Ctrl + L)." else echo -e "\e[31m\nVerification failed. You may want to try enrolling again.\e[0m" + exit 1 fi else echo -e "\e[31m\nEnrollment failed. Please try again.\e[0m" diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index 59704bd55cd4..4fc82d4f55ec 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -49,10 +49,10 @@ case "$1" in *) printf 'pacman %s\n' "$*" >> "$CALL_LOG"; exit 99 ;; esac STUB +# Both fail unless ENROLL_STATUS or VERIFY_STATUS says otherwise, stopping +# before PAM. ENROLL_OUTPUT is what fprintd-enroll prints first. cat > "$scratch/bin/fprintd-enroll" <<'STUB' #!/bin/bash -# Stop before verification/PAM; no host authentication files may be changed. -# ENROLL_OUTPUT is what fprintd-enroll prints first. echo enroll >> "$CALL_LOG" [[ -z ${ENROLL_OUTPUT:-} ]] || printf '%s\n' "$ENROLL_OUTPUT" exit "${ENROLL_STATUS:-1}" @@ -96,7 +96,7 @@ run_setup() { fail "setup stops on the simulated enrollment or installation failure" fi if grep -Eq '^(pam |apply-lock$|Unexpected privileged call)' "$CALL_LOG"; then - fail "setup does not change PAM or lock recovery after failed enrollment" + fail "setup does not change PAM or lock recovery after a failed enrollment, installation or verify" fi } @@ -184,6 +184,17 @@ expected=$' \u2713 Step 1 done. Keep lifting your finger and touching the senso grep -q 'Enrollment failed' "$scratch/output" || fail "a failed enrollment still fails setup" "$(cat "$scratch/output")" pass "enrollment results read as instructions, and a failed enrollment still fails setup" +# A failed verify fails setup and leaves PAM and the lock screen alone; the +# success path's order is checked above. +: > "$CALL_LOG" +if INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press ENROLL_STATUS=0 VERIFY_STATUS=1 \ + OMARCHY_PATH="$scratch" "$setup_script" > "$scratch/output" 2>&1; then + fail "a failed verify fails setup" "$(cat "$scratch/output")" +fi +grep -qx verify "$CALL_LOG" && ! grep -Eq '^(pam |apply-lock$|Unexpected privileged call)' "$CALL_LOG" || + fail "a failed verify leaves PAM and the lock screen alone" "$(cat "$CALL_LOG")" +pass "a failed verify fails setup, leaving PAM and the lock screen alone" + # The verify step's results, in fprintd-verify's own format (each with " (done)" # or " (not done)"), through the functions setup uses. source <(sed -n '/^fprintd_chatter()/,/^}/p;/^enroll_progress()/,/^}/p;/^verify_progress()/,/^}/p' \ From 9e61222f9274b19a3b396dd620755599fa72d85f Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Tue, 13 Oct 2026 21:28:01 -0400 Subject: [PATCH 4/8] Name neither scan type when fprintd can't say which When busctl couldn't read the reader's scan type, setup took the swipe branch and told a press reader to swipe its finger across the sensor to enroll and verify. A reader fprintd can't describe is now asked to touch or swipe. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 22 ++++++++---- test/shell.d/fingerprint-package-test.sh | 43 ++++++++++++++++++------ 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index b32d146101b1..5433437d3f6d 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -167,13 +167,21 @@ fi echo -e "\e[32m\nLet's set up your right index finger as the first fingerprint.\e[0m" # A press sensor needs a touch for each sample; a swipe sensor a moving finger. -if [[ $(fingerprint_reader scan-type) == "press" ]]; then - start="Touch the sensor." again="Keep lifting your finger and touching the sensor." - echo -e "Touch the sensor, lift your finger and touch it again, and keep going until it says Enrolled. A step can take a few touches.\n" -else - start="Swipe your finger across the sensor." again="Swipe it again." - echo -e "Keep moving the finger around on sensor until it says Enrolled.\n" -fi +# When fprintd can't say which, the prompts name neither. +case $(fingerprint_reader scan-type) in + press) + start="Touch the sensor." again="Keep lifting your finger and touching the sensor." + echo -e "Touch the sensor, lift your finger and touch it again, and keep going until it says Enrolled. A step can take a few touches.\n" + ;; + swipe) + start="Swipe your finger across the sensor." again="Swipe it again." + echo -e "Keep moving the finger around on sensor until it says Enrolled.\n" + ;; + *) + start="Touch or swipe the sensor." again="Touch or swipe it again." + echo -e "Touch or swipe the sensor, and keep going until it says Enrolled. A step can take a few tries.\n" + ;; +esac # fprintd runs a duplicate check before enrolling on a reader that identifies, # which D-Bus doesn't say. Touch ID does, and its check needs no touch while diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index 4fc82d4f55ec..dc48f97389af 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -151,19 +151,40 @@ fi pass "an inconclusive lock installer cannot report successful lock setup" # A press sensor, such as a Mac's Touch ID, takes a touch per sample, so setup -# says to lift and touch again; a swipe sensor, or none fprintd can name, keeps -# the moving-finger instruction. +# says to lift and touch again; a swipe sensor keeps the moving-finger +# instruction, and one fprintd can't name is told neither. press_text="Touch the sensor, lift your finger and touch it again, and keep going until it says Enrolled. A step can take a few touches." swipe_text="Keep moving the finger around on sensor until it says Enrolled." -INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press run_setup -grep -qF "$press_text" "$scratch/output" && ! grep -qF "$swipe_text" "$scratch/output" || - fail "a press sensor is told to lift and touch again" "$(cat "$scratch/output")" -for scan_type in swipe ""; do - INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=$scan_type run_setup - grep -qF "$swipe_text" "$scratch/output" && ! grep -qF "$press_text" "$scratch/output" || - fail "a ${scan_type:-unnamed} sensor keeps the moving-finger instruction" "$(cat "$scratch/output")" -done -pass "a press sensor is told to touch again, and any other keeps the moving-finger instruction" +unnamed_text="Touch or swipe the sensor, and keep going until it says Enrolled. A step can take a few tries." +check_instruction() { + INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=$1 run_setup + local text + for text in "$press_text" "$swipe_text" "$unnamed_text"; do + if [[ $text == "$2" ]]; then + grep -qF "$text" "$scratch/output" || fail "$3" "$(cat "$scratch/output")" + else + ! grep -qF "$text" "$scratch/output" || fail "$3" "$(cat "$scratch/output")" + fi + done +} +check_instruction press "$press_text" "a press sensor is told to lift and touch again" +check_instruction swipe "$swipe_text" "a swipe sensor keeps the moving-finger instruction" +check_instruction "" "$unnamed_text" "a sensor fprintd can't name is told to touch or swipe" +pass "each scan type gets its own instruction, and an unnamed one is told to touch or swipe" + +# The verify prompt names the reader's scan type, and neither when fprintd +# can't say which, so a press reader is never told to swipe. +check_verify_prompt() { + : > "$CALL_LOG" + INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=$1 ENROLL_STATUS=0 VERIFY_STATUS=1 \ + OMARCHY_PATH="$scratch" "$setup_script" > "$scratch/output" 2>&1 || true + grep -qF "Now let's verify that it's working correctly. $2" "$scratch/output" || + fail "a ${1:-unnamed} sensor is asked to verify with: $2" "$(cat "$scratch/output")" +} +check_verify_prompt press "Touch the sensor." +check_verify_prompt swipe "Swipe your finger across the sensor." +check_verify_prompt "" "Touch or swipe the sensor." +pass "the verify prompt names the scan type only when fprintd gives one" # fprintd-enroll's raw results become instructions. Touch ID's duplicate check # stage prints nothing; later stages count as steps, never touches, since one From 7d64670e4cf2f99e4e2c00d2a1efe442dcc98505 Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Tue, 13 Oct 2026 21:28:01 -0400 Subject: [PATCH 5/8] Say where the Touch ID driver's name comes from Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index 5433437d3f6d..5669828d0790 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -186,8 +186,9 @@ esac # fprintd runs a duplicate check before enrolling on a reader that identifies, # which D-Bus doesn't say. Touch ID does, and its check needs no touch while # nothing is enrolled; any other reader's first stage counts, touched or not. -# The name is the full_name of libfprint-git's Touch ID driver; if it changes, -# Touch ID shows one step early. +# The name is the driver's full_name in libfprint/drivers/aurora/aurora.c, which +# omarchy-pkgs adds to libfprint-git in pkgbuilds/libfprint-git/aurora-apple-sep.patch. +# If it changes there, Touch ID shows one step early. duplicate_check=0 if [[ $(fingerprint_reader name) == "Apple secure enclave fingerprint sensor" ]]; then duplicate_check=1 From a808491ba7aa1dbe7a2edf5ae27c71865e822cac Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Sat, 17 Oct 2026 14:44:59 -0400 Subject: [PATCH 6/8] Say why fingerprint verification stopped verify-disconnected and every other finished failure read the same "The check stopped", hiding what fprintd-verify reported. A disconnect now says so, as enrollment does, and any other failure names fprintd's result. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 3 ++- test/shell.d/fingerprint-package-test.sh | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index 5669828d0790..28fd541af440 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -132,7 +132,8 @@ verify_progress() { case ${line% (*)} in verify-match) echo " ✓ Matched." ;; verify-no-match) echo " ✗ No match." ;; - *) echo " ✗ The check stopped." ;; + verify-disconnected) echo " ✗ The reader was disconnected." ;; + *) echo " ✗ The check stopped (${line% (*)})." ;; esac done } diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index dc48f97389af..b40b8b4d9e34 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -277,7 +277,7 @@ pass "a failed sudo stops setup with a reason, before enrolling" 'Enroll result: enroll-completed' | enroll_progress "Swipe it again." 1) == $' Too fast. Swipe it again.\n Too short. Swipe it again.\n \u2713 Step 1 done. Swipe it again.\n enroll-some-new-result\n \u2713 Enrolled.' ]] || fail "enrollment retries keep going, and an unknown result is shown" [[ $(printf '%s\n' 'Verify result: verify-too-fast (not done)' 'Verify result: verify-some-new-retry (not done)' \ - 'Verify result: verify-disconnected (done)' | verify_progress "Swipe it again.") == $' Too fast. Swipe it again.\n That one didn\'t read. Swipe it again.\n \u2717 The check stopped.' ]] || + 'Verify result: verify-unknown-error (done)' | verify_progress "Swipe it again.") == $' Too fast. Swipe it again.\n That one didn\'t read. Swipe it again.\n \u2717 The check stopped (verify-unknown-error).' ]] || fail "any verify result that isn't done is a retry" pass "every retry keeps the step going, and only a finished failure says it stopped" @@ -309,7 +309,6 @@ check_verify 'verify-swipe-too-short (not done)' ' Too short. Again.' check_verify 'verify-finger-not-centered (not done)' ' Not centered: use the middle of the sensor. Again.' check_verify 'verify-remove-and-retry (not done)' ' Lift your finger off the sensor, then: Again.' check_verify 'verify-too-fast (not done)' ' Too fast. Again.' -for result in verify-disconnected verify-unknown-error; do - check_verify "$result (done)" $' ✗ The check stopped.' -done +check_verify 'verify-disconnected (done)' $' ✗ The reader was disconnected.' +check_verify 'verify-unknown-error (done)' $' ✗ The check stopped (verify-unknown-error).' pass "each enroll and verify result fprintd 1.94.5 sends reads as intended" From aef8d09a294185e5e6af2576f6a3f70fc101c8cc Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Sun, 18 Oct 2026 22:13:04 -0400 Subject: [PATCH 7/8] Keep the fingerprint setup test's check marks under the C locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The expected strings spelled ✓ and ✗ as $'\u2713' and $'\u2717', which bash only turns into those characters under a UTF-8 locale. Under C or POSIX the enrollment check failed even though setup printed the right lines. The fixtures now hold the characters themselves. Co-Authored-By: Claude Opus 5.5 (1M context) --- test/shell.d/fingerprint-package-test.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index b40b8b4d9e34..bcab63b7d080 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -195,10 +195,10 @@ for result in stage-passed stage-passed retry-scan stage-passed unknown-error; d done INSTALLED=$'libfprint-git\nfprintd\nusbutils' SCAN_TYPE=press READER_NAME='Apple secure enclave fingerprint sensor' \ ENROLL_OUTPUT=$enroll_lines run_setup -expected=$' \u2713 Step 1 done. Keep lifting your finger and touching the sensor. +expected=$' ✓ Step 1 done. Keep lifting your finger and touching the sensor. That one didn\'t read. Keep lifting your finger and touching the sensor. - \u2713 Step 2 done. Keep lifting your finger and touching the sensor. - \u2717 Enrollment stopped. If you stopped before it said Enrolled, run this again and keep going.' + ✓ Step 2 done. Keep lifting your finger and touching the sensor. + ✗ Enrollment stopped. If you stopped before it said Enrolled, run this again and keep going.' [[ $(grep -E '^ ' "$scratch/output") == "$expected" ]] || fail "enrollment results read as instructions, counting steps after the duplicate check" "$(cat "$scratch/output")" ! grep -q 'Enroll result:' "$scratch/output" || fail "no raw fprintd result reaches the owner" "$(cat "$scratch/output")" @@ -223,9 +223,9 @@ source <(sed -n '/^fprintd_chatter()/,/^}/p;/^enroll_progress()/,/^}/p;/^verify_ [[ $(printf '%s\n' 'Using device /net/reactivated/Fprint/Device/0' 'Listing enrolled fingers:' ' - #0: right-index-finger' \ 'Verify started!' 'Verifying: right-index-finger' 'Verify result: verify-retry-scan (not done)' \ 'Verify result: verify-finger-not-centered (not done)' 'Verify result: verify-match (done)' | - verify_progress "Touch again.") == $' That one didn\'t read. Touch again.\n Not centered: use the middle of the sensor. Touch again.\n \u2713 Matched.' ]] || + verify_progress "Touch again.") == $' That one didn\'t read. Touch again.\n Not centered: use the middle of the sensor. Touch again.\n ✓ Matched.' ]] || fail "verify results, retries included, read as instructions" -[[ $(printf '%s\n' 'Verify result: verify-no-match (done)' | verify_progress "Touch again.") == $' \u2717 No match.' ]] || +[[ $(printf '%s\n' 'Verify result: verify-no-match (done)' | verify_progress "Touch again.") == $' ✗ No match.' ]] || fail "a failed verify says so" pass "verify results read as instructions" @@ -239,7 +239,7 @@ INSTALLED=$'libfprint-git\nfprintd\nusbutils' ENROLL_OUTPUT=$enroll_lines run_se [[ $(grep -c 'Step [0-9] done' "$scratch/output") == 3 ]] || fail "a reader fprintd can't name has its first stage counted" "$(cat "$scratch/output")" [[ $(printf '%s\n' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-stage-passed' | enroll_progress "Again." 1) == \ - $' \u2713 Step 1 done. Again.' ]] || fail "with a duplicate check, the first stage is not a step" + $' ✓ Step 1 done. Again.' ]] || fail "with a duplicate check, the first stage is not a step" pass "only a reader with a duplicate check leaves its first stage out of the steps" # sudo's own prompt comes first and is named as such; with sudo already @@ -274,10 +274,10 @@ pass "a failed sudo stops setup with a reason, before enrolling" # says it stopped, and a result fprintd adds later is shown, not called a stop. [[ $(printf '%s\n' 'Enrolling right-index-finger finger.' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-too-fast' \ 'Enroll result: enroll-swipe-too-short' 'Enroll result: enroll-stage-passed' 'Enroll result: enroll-some-new-result' \ - 'Enroll result: enroll-completed' | enroll_progress "Swipe it again." 1) == $' Too fast. Swipe it again.\n Too short. Swipe it again.\n \u2713 Step 1 done. Swipe it again.\n enroll-some-new-result\n \u2713 Enrolled.' ]] || + 'Enroll result: enroll-completed' | enroll_progress "Swipe it again." 1) == $' Too fast. Swipe it again.\n Too short. Swipe it again.\n ✓ Step 1 done. Swipe it again.\n enroll-some-new-result\n ✓ Enrolled.' ]] || fail "enrollment retries keep going, and an unknown result is shown" [[ $(printf '%s\n' 'Verify result: verify-too-fast (not done)' 'Verify result: verify-some-new-retry (not done)' \ - 'Verify result: verify-unknown-error (done)' | verify_progress "Swipe it again.") == $' Too fast. Swipe it again.\n That one didn\'t read. Swipe it again.\n \u2717 The check stopped (verify-unknown-error).' ]] || + 'Verify result: verify-unknown-error (done)' | verify_progress "Swipe it again.") == $' Too fast. Swipe it again.\n That one didn\'t read. Swipe it again.\n ✗ The check stopped (verify-unknown-error).' ]] || fail "any verify result that isn't done is a retry" pass "every retry keeps the step going, and only a finished failure says it stopped" From 64685fa2736d908445fce52441084a22d69b2e1a Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Sun, 18 Oct 2026 22:13:19 -0400 Subject: [PATCH 8/8] Say lift and try again in one line when fprintd asks to lift the finger The remove-and-retry line added the step's own "again" prompt after "then:", so a press reader read "Lift your finger off the sensor, then: Keep lifting your finger and touching the sensor." It now says "Lift your finger off the sensor, then try again." on every reader: libfprint sends this retry from swipe drivers too (elanspi, upekts, vfs101), so the line names no gesture. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/omarchy-setup-security-fingerprint | 4 ++-- test/shell.d/fingerprint-package-test.sh | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index 28fd541af440..8bb5fe520b5a 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -95,7 +95,7 @@ enroll_progress() { enroll-retry-scan) echo " That one didn't read. $again" ;; enroll-swipe-too-short) echo " Too short. $again" ;; enroll-finger-not-centered) echo " Not centered: use the middle of the sensor. $again" ;; - enroll-remove-and-retry) echo " Lift your finger off the sensor, then: $again" ;; + enroll-remove-and-retry) echo " Lift your finger off the sensor, then try again." ;; enroll-too-fast) echo " Too fast. $again" ;; enroll-completed) echo " ✓ Enrolled." ;; enroll-duplicate) echo " ✗ That finger is already enrolled." ;; @@ -123,7 +123,7 @@ verify_progress() { case ${line% (*} in verify-swipe-too-short) echo " Too short. $again" ;; verify-finger-not-centered) echo " Not centered: use the middle of the sensor. $again" ;; - verify-remove-and-retry) echo " Lift your finger off the sensor, then: $again" ;; + verify-remove-and-retry) echo " Lift your finger off the sensor, then try again." ;; verify-too-fast) echo " Too fast. $again" ;; *) echo " That one didn't read. $again" ;; esac diff --git a/test/shell.d/fingerprint-package-test.sh b/test/shell.d/fingerprint-package-test.sh index bcab63b7d080..ba599f4fc9f0 100755 --- a/test/shell.d/fingerprint-package-test.sh +++ b/test/shell.d/fingerprint-package-test.sh @@ -290,7 +290,7 @@ check_enroll enroll-completed $' ✓ Enrolled.' check_enroll enroll-retry-scan " That one didn't read. Again." check_enroll enroll-swipe-too-short ' Too short. Again.' check_enroll enroll-finger-not-centered ' Not centered: use the middle of the sensor. Again.' -check_enroll enroll-remove-and-retry ' Lift your finger off the sensor, then: Again.' +check_enroll enroll-remove-and-retry ' Lift your finger off the sensor, then try again.' check_enroll enroll-too-fast ' Too fast. Again.' check_enroll enroll-duplicate $' ✗ That finger is already enrolled.' check_enroll enroll-data-full $' ✗ The reader has no room for another fingerprint.' @@ -307,7 +307,10 @@ check_verify 'verify-no-match (done)' $' ✗ No match.' check_verify 'verify-retry-scan (not done)' " That one didn't read. Again." check_verify 'verify-swipe-too-short (not done)' ' Too short. Again.' check_verify 'verify-finger-not-centered (not done)' ' Not centered: use the middle of the sensor. Again.' -check_verify 'verify-remove-and-retry (not done)' ' Lift your finger off the sensor, then: Again.' +check_verify 'verify-remove-and-retry (not done)' ' Lift your finger off the sensor, then try again.' +# The line names no gesture, so it reads right on press and swipe readers alike. +[[ $(printf 'Enroll result: enroll-remove-and-retry\n' | enroll_progress "Swipe it again.") == ' Lift your finger off the sensor, then try again.' ]] || + fail "a swipe reader asked to lift its finger isn't told to touch" check_verify 'verify-too-fast (not done)' ' Too fast. Again.' check_verify 'verify-disconnected (done)' $' ✗ The reader was disconnected.' check_verify 'verify-unknown-error (done)' $' ✗ The check stopped (verify-unknown-error).'