Compare commits

...

2 commits

3 changed files with 41 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{ {
imports = [ imports = [
./borg ./borg
./fingerprint-laptop-lid.nix ./fingerprint-reader-on-laptop-lid
./impermanence.nix ./impermanence.nix
./incus ./incus
./motd ./motd

View file

@ -11,6 +11,7 @@
# ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd # ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd
# On Framework 16 the USB is: # On Framework 16 the USB is:
# Bus 005 Device 007: ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd # Bus 005 Device 007: ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd
# Use `findfp.sh` to find the correct USB device.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.mySystem.system.fingerprint-reader-on-laptop-lid; cfg = config.mySystem.system.fingerprint-reader-on-laptop-lid;

View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
find_usb_device() {
local idVendor=$1
local idProduct=$2
local device_id="${idVendor}:${idProduct}"
for device in /sys/bus/usb/devices/*; do
if [ -f "$device/idVendor" ] && [ -f "$device/idProduct" ]; then
vendor=$(cat "$device/idVendor")
product=$(cat "$device/idProduct")
if [ "${vendor}:${product}" = "$device_id" ]; then
echo "$device"
return 0
fi
fi
done
return 1
}
# Example usage
idVendor="27c6"
idProduct="609c"
device_path=$(find_usb_device "$idVendor" "$idProduct")
if [ -n "$device_path" ]; then
echo "Device found at: $device_path"
# Print additional information
manufacturer=$(cat "$device_path/manufacturer" 2>/dev/null)
product=$(cat "$device_path/product" 2>/dev/null)
echo "Manufacturer: ${manufacturer:-N/A}"
echo "Product: ${product:-N/A}"
else
echo "Device not found"
fi