usb changed again...
This commit is contained in:
parent
aa8cf61d10
commit
f14534fa93
2 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue