diff --git a/bin/omarchy-hw-fingerprint b/bin/omarchy-hw-fingerprint index 9984e9d5..c5f119d9 100755 --- a/bin/omarchy-hw-fingerprint +++ b/bin/omarchy-hw-fingerprint @@ -10,6 +10,20 @@ # reader — those still match on the product string below when present. fingerprint_vendors=" 27c6 138a 06cb 08ff 1c7a 147e " +# libfprint drives every reader it supports from userspace over libusb, so a +# real reader sits there with no kernel driver bound to any of its interfaces. +# The other things these vendors build — Synaptics webcam bridges (usbio-bridge +# on the Dell XPS 14), touchpads and touchscreens (usbhid), cameras (uvcvideo) +# — all bind one. Only the vendor-ID guess needs this; a device that names +# itself a fingerprint reader is trusted outright. +has_kernel_driver() { + local intf + for intf in "$1"/*:*; do + [[ -e $intf/driver ]] && return 0 + done + return 1 +} + 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. @@ -21,7 +35,8 @@ for dev in /sys/bus/usb/devices/*; do if [[ -r $dev/idVendor ]]; then vendor=$(<"$dev/idVendor") - [[ $fingerprint_vendors == *" $vendor "* ]] && exit 0 + [[ $fingerprint_vendors == *" $vendor "* ]] && + ! has_kernel_driver "$dev" && exit 0 fi done diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 8e69f72b..2e94e8dc 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -147,7 +147,7 @@ "setup.default.editor.emacs": {"icon":"","label":"Emacs","when":"omarchy-cmd-present emacs","checked":"[[ \"$(omarchy-default-editor)\" == \"emacs\" ]]","action":"omarchy-default-editor emacs"}, "setup.security": {"icon":"","label":"Security"}, "setup.config": {"icon":"","label":"Config"}, - "setup.security.fingerprint": {"icon":"󰈷","label":"Fingerprint","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-fingerprint"}, + "setup.security.fingerprint": {"icon":"󰈷","label":"Fingerprint","when":"omarchy-hw-fingerprint","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-fingerprint"}, "setup.security.fido2": {"icon":"","label":"Fido2","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-fido2"}, "setup.security.sshd": {"icon":"󰣀","label":"SSHD","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-sshd"}, "setup.security.passwordless-sudo": {"icon":"󰟵","label":"Passwordless Sudo","action":"omarchy-launch-floating-terminal-with-presentation omarchy-sudo-passwordless"},