Files
omarchycn/bin/omarchy-hw-fingerprint
T
David Heinemeier HanssonandClaude Opus 4.8 e2bf0daaa8 Invite fingerprint setup on first run when a reader is present
Add a first-run notification, alongside the keybindings/Wi-Fi toasts, that
invites anyone with a fingerprint sensor to enable it. Clicking launches
omarchy-setup-security-fingerprint in a floating terminal.

Detection lives in a new omarchy-hw-fingerprint helper that reads sysfs
(device product descriptor plus a fingerprint-vendor allowlist), so it
works before fprintd/usbutils are installed and without nagging machines
that have no reader. The setup script reuses the same helper as an early
gate, bailing before installing any packages when no reader is found
(replacing the old post-install fprintd-list probe).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 14:05:31 -07:00

29 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Returns true when a fingerprint reader is present
# omarchy:hidden=true
# Detect straight from sysfs so this works before fprintd/usbutils are
# installed (the fingerprint setup pulls those in). USB vendor IDs listed here
# ship fingerprint readers; multi-purpose vendors (e.g. Elan/STMicro, which
# also make USB touchscreens) are left out to avoid nagging laptops with no
# reader — those still match on the product string below when present.
fingerprint_vendors=" 27c6 138a 06cb 08ff 1c7a 147e "
for dev in /sys/bus/usb/devices/*; do
# The device's own product descriptor usually names it, e.g. "Goodix
# Fingerprint USB Device" — driver-independent and vendor-agnostic.
if [[ -r $dev/product ]]; then
product=$(<"$dev/product")
product=${product,,}
[[ $product == *fingerprint* || $product == *biometric* ]] && exit 0
fi
if [[ -r $dev/idVendor ]]; then
vendor=$(<"$dev/idVendor")
[[ $fingerprint_vendors == *" $vendor "* ]] && exit 0
fi
done
exit 1