final fix for fingerprint sensor. UDEV creates a symlink nto /dev/fingerprint_sensor whenever it's attached now.
This commit is contained in:
parent
6c8f89cd50
commit
6c07f5ad50
1 changed files with 15 additions and 6 deletions
|
@ -14,7 +14,6 @@
|
||||||
# Use `findfp.sh` to find the correct USB device.
|
# Use `findfp.sh` to find the correct USB device.
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
usbdevice = "1-4.1";
|
|
||||||
cfg = config.mySystem.system.fingerprint-reader-on-laptop-lid;
|
cfg = config.mySystem.system.fingerprint-reader-on-laptop-lid;
|
||||||
laptop-lid = pkgs.writeShellScript "laptop-lid" ''
|
laptop-lid = pkgs.writeShellScript "laptop-lid" ''
|
||||||
lock=/var/lock/fingerprint-reader-disabled
|
lock=/var/lock/fingerprint-reader-disabled
|
||||||
|
@ -25,10 +24,10 @@ let
|
||||||
grep -Fxq connected /sys/class/drm/card*-HDMI-*/status)
|
grep -Fxq connected /sys/class/drm/card*-HDMI-*/status)
|
||||||
then
|
then
|
||||||
touch "$lock"
|
touch "$lock"
|
||||||
echo 0 > /sys/bus/usb/devices/${usbdevice}/authorized
|
echo 0 > /dev/fingerprint_sensor/authorized
|
||||||
elif [ -f "$lock" ]
|
elif [ -f "$lock" ]
|
||||||
then
|
then
|
||||||
echo 1 > /sys/bus/usb/devices/${usbdevice}/authorized
|
echo 1 > /dev/fingerprint_sensor/authorized
|
||||||
rm "$lock"
|
rm "$lock"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
@ -39,9 +38,19 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.acpid = {
|
services = {
|
||||||
enable = true;
|
acpid = {
|
||||||
lidEventCommands = "${laptop-lid}";
|
enable = true;
|
||||||
|
lidEventCommands = "${laptop-lid}";
|
||||||
|
};
|
||||||
|
# Add udev rule to create symlink for fingerprint sensor
|
||||||
|
# when usb device 27c6:609c is connected or disconnected.
|
||||||
|
# Reason: hubs like caldigit re-orient the device number on each boot.
|
||||||
|
# May requires a reboot to take effect.
|
||||||
|
# or sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||||
|
udev.extraRules = ''
|
||||||
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="27c6", ATTRS{idProduct}=="609c", RUN+="/bin/sh -c 'ln -sf /sys$devpath /dev/fingerprint_sensor'"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable fingerprint reader at login since you can't put in a password when fprintd is running.
|
# Disable fingerprint reader at login since you can't put in a password when fprintd is running.
|
||||||
|
|
Loading…
Reference in a new issue