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"
|
"tyriar.sort-lines"
|
||||||
"yzhang.markdown-all-in-one"
|
"yzhang.markdown-all-in-one"
|
||||||
"bmalehorn.vscode-fish"
|
"bmalehorn.vscode-fish"
|
||||||
|
"hashicorp.hcl"
|
||||||
# "github.copilot-chat"
|
# "github.copilot-chat"
|
||||||
];
|
];
|
||||||
# Nixpkgs Extensions. These are updated whenver they get around to it.
|
# Nixpkgs Extensions. These are updated whenver they get around to it.
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
# 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
|
||||||
|
@ -24,10 +25,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/5-4.1/authorized
|
echo 0 > /sys/bus/usb/devices/${usbdevice}/authorized
|
||||||
elif [ -f "$lock" ]
|
elif [ -f "$lock" ]
|
||||||
then
|
then
|
||||||
echo 1 > /sys/bus/usb/devices/5-4.1/authorized
|
echo 1 > /sys/bus/usb/devices/${usbdevice}/authorized
|
||||||
rm "$lock"
|
rm "$lock"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue