How to dynamically disable fingerprint reader when the laptop is plugged in the thunderbold docking station
Create and edit the script:
sudo vi /usr/local/bin/thunderbolt-handler.shAdd the following content:
#!/bin/bash
if [ "$1" == "add" ]; then
logger "Thunderbolt device plugged in!"
authselect disable-feature with-fingerprint
echo "Thunderbolt device plugged in"
elif [ "$1" == "remove" ]; then
logger "Thunderbolt device unplugged!"
authselect enable-feature with-fingerprint
echo "Thunderbolt device unplugged"
else
echo "Unknown argument: $1"
fiGrant execution permessions:
sudo chmod +x /usr/local/bin/thunderbolt-handler.shCreate a new rule in /etc/udev/rules.d/99-thunderbolt.rules:
sudo vi /etc/udev/rules.d/99-thunderbolt.rulesPaste this:
SUBSYSTEM=="thunderbolt", ACTION=="add", RUN+="/usr/local/bin/thunderbolt-handler.sh add"
SUBSYSTEM=="thunderbolt", ACTION=="remove", RUN+="/usr/local/bin/thunderbolt-handler.sh remove"Reload rules and trigger:
sudo udevadm control --reload-rules
sudo udevadm triggerThen unplug and replug your Thunderbolt device to test.
-
Check if the rule fired using:
journalctl -xe | grep thunderboltUse
ENV{ID_MODEL}or similar to narrow the match. -
Identify your Thunderbolt device running:
udevadm monitor --environment --udev
Plug in your Thunderbolt device and check the events.