usb changed again...

This commit is contained in:
Joseph Hanson 2024-09-10 09:41:04 -05:00
parent aa8cf61d10
commit f14534fa93
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
2 changed files with 4 additions and 2 deletions

View file

@ -27,6 +27,7 @@ let
"tyriar.sort-lines"
"yzhang.markdown-all-in-one"
"bmalehorn.vscode-fish"
"hashicorp.hcl"
# "github.copilot-chat"
];
# Nixpkgs Extensions. These are updated whenver they get around to it.

View file

@ -14,6 +14,7 @@
# Use `findfp.sh` to find the correct USB device.
{ config, lib, pkgs, ... }:
let
usbdevice = "1-4.1";
cfg = config.mySystem.system.fingerprint-reader-on-laptop-lid;
laptop-lid = pkgs.writeShellScript "laptop-lid" ''
lock=/var/lock/fingerprint-reader-disabled
@ -24,10 +25,10 @@ let
grep -Fxq connected /sys/class/drm/card*-HDMI-*/status)
then
touch "$lock"
echo 0 > /sys/bus/usb/devices/5-4.1/authorized
echo 0 > /sys/bus/usb/devices/${usbdevice}/authorized
elif [ -f "$lock" ]
then
echo 1 > /sys/bus/usb/devices/5-4.1/authorized
echo 1 > /sys/bus/usb/devices/${usbdevice}/authorized
rm "$lock"
fi
'';