Skip to content

Show fingerprint reader state on the lock screen and in the polkit dialog - #13918

Open
cb2206 wants to merge 4 commits into
omacom:quattrofrom
cb2206:lock-fingerprint-feedback
Open

cb2206 wants to merge 4 commits into
omacom:quattrofrom
cb2206:lock-fingerprint-feedback

Conversation

@cb2206

@cb2206 cb2206 commented Oct 1, 2026 •

Copy link
Copy Markdown

Summary

The lock screen and the polkit dialog show a static fingerprint glyph. You can't tell whether the reader is waiting, has seen your finger, or has rejected it. This PR adds live reader feedback to both.

pam_fprintd only reports the final verdict, so a new shared FingerprintReader (shell/Ui/FingerprintReader.qml) watches fprintd's D-Bus signals (finger-needed, finger-present, VerifyStatus) with a passive gdbus monitor. It is display-only: authentication is still decided by each surface's PAM context.

Scope: this is UI feedback only. It does not change the fingerprint retry behaviour, and it does not fix the 250 ms retry loop or the thermal-guard lockout in #13944, #13906 or #9905.

The fade-over-desktop part that used to be in this PR is now split out into #13962.

1. Lock screen

Reader state Field Icon Status pill
waiting normal fingerprint, breathing "Touch the sensor to unlock"
finger on sensor accent glow that pulses, plus a sweep along the bottom border accent fingerprint "Identifying…"
rejected red border and glow, field shakes ✕ "Not recognized, try again"
match accent glow ✓ "Unlocking…"
  • Touching the sensor wakes a blanked display.
  • Looping animations pause while the display is blank or power saver is on, the same rule the video feed uses.
  • The feedback uses the theme's core accent / urgent colors instead of the lock tokens. Some themes set every lock token to one color (Tokyo Night sets lock.text-error to the foreground), so with the lock tokens a rejected read would look identical to a scan.
  • A rejection only counts after the reader reported a finger on the sensor. The Apple SEP driver answers pam_fprintd's 30 s verify timeout with verify-no-match, which would otherwise flash a rejection on an idle lock.
  • The enrolled-finger check now matches fprintd-list's #N: lines. The old check matched any "finger", which includes "no fingers enrolled".

2. Polkit dialog

The square fingerprint card gets the same states, with a status pill under the card styled like the action label above it:

Reader state Card Status pill
waiting fingerprint, breathing "Touch the sensor to authorize"
finger on sensor accent fingerprint, pulsing "Identifying…"
rejected ✕, red border, card shakes "Not recognized, try again"
match ✓ (the dialog lingers 0.7 s so it lands) "Authorized"

When pam_fprintd runs out of tries it falls through to the password. If the last read was a rejection, the pill says "Fingerprint not recognized, enter password" above the password field.

This builds on the ideas in #11162 (flash on a rejected read) and #11952 (fingerprint status text in the lock and polkit dialogs, and the fprintd-list check). Merging this would overlap with both.

Testing

  • Hardware: M1 MacBook Pro, Touch ID through fprintd and the Apple SEP libfprint driver, running the omarchy-mac 4.0.3 shell.
    • Lock screen: used daily, with both enrolled and unenrolled fingers.
    • Polkit: pkexec true with this commit's PolkitAgent.qml and FingerprintReader.qml dropped into a cb.polkit clone. Screenshots confirmed the waiting, identifying and rejected states, including the return to waiting afterwards. The match check was confirmed by eye.
  • On quattro: all files compile in Quickshell, and the lock, polkit, sleep and runtime-smoke suites under test/shell.d pass at each commit.
  • New tests: fingerprint-feedback-test.sh runs the reader's D-Bus line parser against gdbus monitor output captured from real hardware, and checks the lock and polkit wiring. The lock-fingerprint-indicator fixture covers the lock's visual states.

@cb2206
cb2206 force-pushed the lock-fingerprint-feedback branch from 69fd511 to a3598a0 Compare October 1, 2026 03:06
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds fingerprint reader feedback to lock and authorization screens.

The PR appears safe to merge based on the current review.

Summary

The PR adds passive fprintd state monitoring and live fingerprint feedback to the lock screen and polkit dialog, while leaving authentication decisions with PAM.

  • The latest revision briefly keeps the polkit monitor active to receive a pending read’s final verdict after password fallback.
  • The previous Greptile threads are resolved; no new actionable finding was established.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  F[fprintd signals] --> R[FingerprintReader]
  R --> L[Lock feedback]
  R --> P[Polkit feedback]
  PAM[Surface-specific PAM result] --> A[Unlock or authorize]
Loading

Reviews (6) · Last reviewed commit: "Keep the polkit reader monitor up for th..."

Comment thread shell/plugins/lock/Service.qml Resolved
Comment thread shell/plugins/lock/Service.qml Resolved
Comment thread shell/plugins/lock/Service.qml Resolved
Comment thread shell/plugins/lock/Service.qml Resolved
@cb2206
cb2206 force-pushed the lock-fingerprint-feedback branch from a3598a0 to 56d3feb Compare October 1, 2026 03:22
@jandrusk

jandrusk commented Oct 1, 2026

Copy link
Copy Markdown

Appreciate the hardware testing notes (M1 Touch ID / fprintd).

Two triage notes:

  1. Please do not treat this as fixing Lock screen: fingerprint reader disabled by libfprint thermal guard after ~3 min, then 250 ms retry loop #13944 / Lock screen retries fingerprint auth every 250ms with no backoff when the reader is unavailable #13906 / Lock screen retries fingerprint PAM every 250ms with no backoff, preventing fprintd recovery #9905 — those need an activity window + backoff so libfprint's thermal guard is not tripped by a 250 ms retry loop. This PR is UI feedback + fade.
  2. At ~1k LOC, splitting fingerprint indicator vs fade-over-desktop would make review easier (and let Greptile threads settle per concern).

Leaving as a product/UX call pending maintainer taste on the fade behavior.

cb2206 added 2 commits October 1, 2026 10:35
Add a shared FingerprintReader that watches fprintd's D-Bus signals, so
the lock shows when the reader is waiting, reading a finger, or rejected
it: a status pill, an accent glow and border sweep while reading, and a
red shake with a cross on a miss. Display only; PAM still decides the
unlock.

A rejection counts only after the reader reported a finger on the
sensor: the Apple SEP driver answers pam_fprintd's 30 s verify timeout
with verify-no-match, which would otherwise flash a blanked lock.
Reuse FingerprintReader so the fingerprint card says when the reader is
waiting or reading a finger, swaps to a check or cross for the verdict,
and shakes with a red border on a miss. A rejection that lands after
pam_fprintd falls through to the password is still reported under the
field. Display only; PAM still decides the authorization.
@cb2206
cb2206 force-pushed the lock-fingerprint-feedback branch from 0ee6d53 to d2247f1 Compare October 1, 2026 16:40
@cb2206 cb2206 changed the title Show fingerprint reader state on the lock screen, and fade the lock over the desktop Show fingerprint reader state on the lock screen and in the polkit dialog Oct 1, 2026
@cb2206

cb2206 commented Oct 1, 2026

Copy link
Copy Markdown
Author

Thanks @jandrusk, both points taken.

  1. Agreed: this doesn't fix Lock screen: fingerprint reader disabled by libfprint thermal guard after ~3 min, then 250 ms retry loop #13944 / Lock screen retries fingerprint auth every 250ms with no backoff when the reader is unavailable #13906 / Lock screen retries fingerprint PAM every 250ms with no backoff, preventing fprintd recovery #9905. The reader feedback is display-only and leaves fingerprintRetryTimer and the 250 ms retry untouched. The description now says so explicitly, so none of those should be closed when this merges.
  2. Split: the fade-over-desktop work is now its own PR, Fade the lock screen in and out over the live desktop #13962, based on quattro and independent of this one. This PR is now only fingerprint feedback. It also adds the same reader states to the polkit fingerprint card, through a shared FingerprintReader component, so the lock and polkit use one D-Bus parser.

Comment thread shell/plugins/polkit/PolkitAgent.qml Resolved
After pam_fprintd falls through to the password, another flow may use the
reader, and its match made the password prompt say Authorized. Fingerprint
mode is when this request's pam_fprintd holds the reader, so every signal
is ours.
Comment thread shell/plugins/polkit/PolkitAgent.qml Resolved
pam_fprintd falls through to the password as soon as it gets the final
VerifyStatus, and the monitor reads the same signal through a pipe, so the
last rejection can arrive after fingerprint mode ends. Stopping the monitor
then dropped it, and the dialog never said the finger wasn't recognized.

A finger landing while this request holds the reader now keeps the monitor
listening until that read's verdict, for at most 500 ms after the reader
is let go. A new request or a closed dialog ends the wait.
@cb2206

cb2206 commented Oct 2, 2026

Copy link
Copy Markdown
Author

Tested cc620a3f on hardware: MacBook Pro 14" M1 Pro (j314s), Apple SEP Touch ID through fprintd, /etc/pam.d/polkit-1 with pam_fprintd (default max-tries=3) before pam_unix.

  • Unenrolled finger 3×, then password (pkexec true): the dialog showed "not recognized" with the shake for all three no-matches. That includes the third one, the case greptile flagged, where pam_fprintd gives up and the dialog switches to the password field. It stayed visible before the switch. The kernel logged the three no-matches at 12:01:46, :49 and :52. Password auth went through at :58.
  • Enrolled finger (pkexec true): match shown, the dialog closed, and pkexec ran 20 ms after the kernel's match.

No QML errors after the plugin reload.

@omarchybot

Copy link
Copy Markdown
Collaborator

The enrolled-entry matcher is incorporated in merged #7158. Passive reader feedback, animations and polkit status remain separate UI work. Keeping this open; the landed error recovery is not a substitute for those features.

GPT-6 in Codex and Claude Opus 5.5 Medium checked the coverage against the landed source; Claude's agreement does not guarantee independence. This closure review was read-only and did not rerun runtime tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants