From 376dbda24224d5c4d798c50026e1405137719eea Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Sun, 8 Sep 2024 15:47:13 -0500 Subject: [PATCH] Fixed a couple of issues and the usb bus changed for the fingerprint sensor? --- nixos/modules/nixos/system/fingerprint-laptop-lid.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nixos/modules/nixos/system/fingerprint-laptop-lid.nix b/nixos/modules/nixos/system/fingerprint-laptop-lid.nix index 59143ea..9c364fa 100644 --- a/nixos/modules/nixos/system/fingerprint-laptop-lid.nix +++ b/nixos/modules/nixos/system/fingerprint-laptop-lid.nix @@ -1,3 +1,4 @@ +# From https://github.com/fzakaria/nix-home/blob/framework-laptop/modules/nixos/fprint-laptop-lid.nix # Originally this file was based on # https://unix.stackexchange.com/questions/678609/how-to-disable-fingerprint-authentication-when-laptop-lid-is-closed # However I found this not to work as the fprintd is started via dbus and masking it doesn't seem to do anything. @@ -12,18 +13,18 @@ let cfg = config.mySystem.system.fingerprint-reader-on-laptop-lid; laptop-lid = pkgs.writeShellScript "laptop-lid" '' - lock=$HOME/fingerprint-reader-disabled + lock=/var/lock/fingerprint-reader-disabled # match for either display port or hdmi port if grep -Fq closed /proc/acpi/button/lid/LID0/state && - (grep -Fxq connected /sys/class/drm/card1-DP-*/status || - grep -Fxq connected /sys/class/drm/card1-HDMI-*/status) + (grep -Fxq connected /sys/class/drm/card*-DP-*/status || + grep -Fxq connected /sys/class/drm/card*-HDMI-*/status) then touch "$lock" - echo 0 > /sys/bus/usb/devices/1-4/authorized + echo 0 > /sys/bus/usb/devices/5-4.1/authorized elif [ -f "$lock" ] then - echo 1 > /sys/bus/usb/devices/1-4/authorized + echo 1 > /sys/bus/usb/devices/5-4.1/authorized rm "$lock" fi '';