Deadbolt automatically locks your Mac when you remove a USB device of your choosing such as an iPhone or Yubikey. Or you can set a global keyboard shortcut.
Deadbolt leverages existing habits (taking your phone with you) to help you remember to keep your machine locked when you step away.
If you love it, purchase Deadbolt in-app for only $10, and install on up to two computers.
Deadbolt lives in your Mac's menubar. Start by selecting a USB device to watch.
Then, whenever you remove that USB device, Deadbolt locks your Mac for you.
Prefer working from a keyboard? Set a global keyboard shortcut to lock your Mac.
You can also choose whether to simply lock your Mac, or start the screensaver. (But you should remember to set your screensaver to require a password to unlock!)