Skip to content

Instantly share code, notes, and snippets.

@Thann
Created January 2, 2020 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thann/1f3bd72dd43e22a4fd5af5e95b40e8f9 to your computer and use it in GitHub Desktop.
Save Thann/1f3bd72dd43e22a4fd5af5e95b40e8f9 to your computer and use it in GitHub Desktop.
Lock computer on USB remove
# Note: use following to determine "ID_MODEL" and replace "Micromax_A74" with it
# udevadm monitor --environment --udev
cat << EOF | sudo tee /etc/udev/rules.d/busKill.rules
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_MODEL}=="Micromax_A74", RUN+="DISPLAY=:0 xscreensaver-command -lock"
EOF
sudo udevadm control --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment