nixos-hardware icon indicating copy to clipboard operation
nixos-hardware copied to clipboard

Feature Request: Framework 13 Automatic fingerprint sensor switching

Open JustinLex opened this issue 7 months ago • 3 comments

Hi, I use the following snippet to enable and disable my fingerprint sensor when docking my Framework 13. Could this be added as an option to the Framework 13 module?

  services.acpid = {
    enable = true;
    lidEventCommands =
      let goodixVendor = "27c6";
      in ''
        grep -q closed /proc/acpi/button/lid/LID0/state
        if [ $? = 0 ]; then
          ${pkgs.fd}/bin/fd "-" /sys/bus/usb/devices --exec /bin/sh -c '${pkgs.gnugrep}/bin/grep -qs ${goodixVendor} {}/idVendor && ${pkgs.coreutils}/bin/echo 0 > {}/authorized'
        else
          ${pkgs.fd}/bin/fd "-" /sys/bus/usb/devices --exec /bin/sh -c '${pkgs.gnugrep}/bin/grep -qs ${goodixVendor} {}/idVendor && ${pkgs.coreutils}/bin/echo 1 > {}/authorized'
        fi
      '';
  };

JustinLex avatar Mar 31 '25 00:03 JustinLex