dotfiles/udev/lock-screen-on-hid-connection.sh

4 lines
271 B
Bash
Executable File

#!/bin/sh
echo 'ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usbhid", RUN+="/usr/bin/loginctl lock-sessions", RUN+="/usr/bin/logger New USB HID device found, locking sessions"' | sudo tee /etc/udev/rules.d/00-usbhid-lock-screen.rules >> /dev/null
sudo systemctl reload udev