Use case: I want my screen to auto-lock when I unmount my USB drive. (That part is easy.) What's not so easy: I want the screen lock to require the USB drive and the password when I return.
Thus, is there a way block the screen unlock so that it only allows unlocking when some additional condition is met (test whether a file exists, for instance; I'd create that with the help of udev, that's not the problem; or run a check script and disallow unlocking unless that program exits zero)?
I'm using e17 and Gnome, but solutions for kde/lxde/xscreensaver are appreciated too.